[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 172

 
100yan:
It asks for an integer value, but an array can also be declared as a variable?!

Do you know what a variable is? It is a cell in memory that can be changed. int is a type of variable.

https://book.mql4.com/ru/basics/vars

https://book.mql4.com/ru/basics/types

 
To test a trading system in MT4 on historical data, I need to load an archive of quotes, select the currency pair of interest, select all timeframes, including the minute one, and load it. There are no chart mismatches during testing, but there is a problem that significantly affects the results of testing and optimization. There are often time gaps in the quotes. For example, in the H1 chart after the candle from May 7, 2010 there is a candle from July 8, 2010, i.e. a gap of 1 month. Repeated downloading of the quote archive does not solve the situation. I have more than enough free space on my hard disc to download the quotes.

The question: How can I correctly download all quotes without time gaps to MT4?
 
polsvv:

Can you tell me what the meaning of this crap in the logs is? How can I avoid it? The Expert Advisor trades with this indicator, after an error the trade freezes until you restart the terminal because restarting the Expert Advisor may crash again.

22:39:53 +ZigZag_Levels CLJ1,M5: uninit reason 3
22:39:53 Zigzag CLJ1,M5: uninit reason 1

22:39:53 Zigzag CLJ1,M5: removed

Maybe it's because I'm using the terminal on a remote server and on my own computer at the same time?

https://docs.mql4.com/ru/constants/uninit check reasons for deinitialisation, it looks like you are changing period/symbol chart with EA running, hence the crashes.
 
wizmon:
Question: how to correctly download all the quotes without any time gaps in MT4?

+ before uploading (if you have such holes), it is advisable to delete the existing history

+ set the history depth in the settings at least 10 000 000 bars

+ After loading the history you need to click again on the "Load" button and confirm the recalculation of all the TFs.

 
polsvv:

Expert trades using this indicator, after an error the trade stops

Probably a looped code.
 
polsvv:

Can you tell me what the meaning of this crap in the logs is? How can I avoid it? The Expert Advisor trades with this indicator, after an error the trade freezes until you restart the terminal because restarting the Expert Advisor may crash again.

22:39:53 +ZigZag_Levels CLJ1,M5: uninit reason 3
22:39:53 Zigzag CLJ1,M5: uninit reason 1

22:39:53 Zigzag CLJ1,M5: removed

Maybe it's because I use terminal on remote server and on my PC at the same time?

I don't think the code is looped. What does uninit reason 1 or 3 mean anyway ? Do you have a decoding ?

EA has been trading normally for 2 days.

Once again I would like to repeat the question about terminals.

If I have a terminal with EA on a remote server and run the same terminal on my PC, I do my business on it. I optimize them and so on. I would like to remind that the EA is not in the window of a trading tool in the home terminal because it is running locally on my (remote) computer and not on the broker's server.

So may the EA fail if it is running in one terminal, which is running 2 times at the same time?

 
polsvv:

I don't think the code is looped. What does uninit reason 1 or 3 even mean ? Is there a decoding ?

read my answer above
 
polsvv:

I don't think the code is looped. What does uninit reason 1 or 3 even mean ? Any decoding ?


REASON_REMOVE1The program is removed from the chart
REASON_CHARTCHANGE3Chart symbol or period has been changed
 
alsu:
https://docs.mql4.com/ru/constants/uninit check the reasons for deinitialisation, it looks like you are changing the period/symbol graph with the EA running, hence the crashes.
Yes. Apparently that's the reason. Thanks for the tip!
 

Hello.

Taking apart and modifying the Laguerre indicator, just not working out very well. Please help with the code.

At the end Laguerre started its code.

i=CountBars-1;
   while(i>=0)
   {
      L0A = L0;
      L1A = L1;
      L2A = L2;
      L3A = L3;
      L0 = (1 - gamma)*Close[i] + gamma*L0A;
      L1 = - gamma *L0 + L0A + gamma *L1A;
      L2 = - gamma *L1 + L1A + gamma *L2A;
      L3 = - gamma *L2 + L2A + gamma *L3A;

      CU = 0;
      CD = 0;
      
      if (L0 >= L1) CU = L0 - L1; else CD = L1 - L0;
      if (L1 >= L2) CU = CU + L1 - L2; else CD = CD + L2 - L1;
      if (L2 >= L3) CU = CU + L2 - L3; else CD = CD + L3 - L2;

      if (CU + CD != 0) LRSI = CU / (CU + CD);
      val1[i] = LRSI;
          i--;
        }
for(int a=0; a<Bars; a++ )
{if(LRSI[i]>0.45)
   LastLag++;
  
  }
 

As I understand it, the indicator line itself is called LRSI.

So I can't assign a counter value to it. For example, when the line crosses 0.45 up, LastLag is added by one.

So far, the only problem is assigning a counter value. I can write the whole idea later. Thank you.

Files:
laguerre.mq4  4 kb