Errors, bugs, questions - page 3034

 

An error appeared on the freelance jobs pages today:

Chrome browser. What does this have to do with?

 
Aleksey Vyazmikin:

Am I right to understand that if an EA working on M1 uses an indicator on M1 (or any other TF?), which takes data from the upper TF, then on the first tick of a new bar it will not be able to return the actual value in any case, because it will take n ticks before the upper TF is calculated?


Actually, OnTick is not synchronized with OnCalculate by the same symbol. Theoretically, OnTick may be late and by its start all indexes of all TFs will be calculated?

 
Slava:

From the other timeframe, the data will be taken that is currently ready. That is, in the output all data will be perfectly synchronized.

Why then the indicator cannot receive them at the first request?

How can I make a normal multi-TF (and ideally - multi-character) indicator without using a timer?

 
Andrey Khatimlianskii:

Why then can't the indicator retrieve them on the first request?

How do you make a normal multi-TF (and ideally multi-character) indicator without using a timer?

+

I'm worried that delays in signal reception by the EA will be unavoidable with the current architecture, unfortunately

 
Hello

When optimizing using Mql Cloud, an error appears:

2021.05.31 18:24:57.348 MQL5 Cloud Europe pass 34 tested with error "critical runtime error 0 in OnInit function (error code 0, module Experts\Advisors\123 expert.ex5, file 65535, line 1, col 1)" in 0:00:00.001 (PR 274)


Please advise what may be the problem?

When optimizing without Mql Cloud, everything works. The problem started on 05/29. Before that, everything was fine.

 
Marat Bayburin:
Hello

An error appears during optimization using Mql Cloud:

2021.05.31 18:24:57.348 MQL5 Cloud Europe pass 34 tested with error "critical runtime error 0 in OnInit function (error code 0, module Experts\Advisors\123 expert.ex5, file 65535, line 1, col 1)" in 0:00:00.001 (PR 274)


Please advise what may be the problem?

When optimizing without Mql Cloud, everything works. The problem started on 29.05. Before that everything was ok.

I think the problem is with the compiler build. I get the same errors.
I.e. we compiled with new build, but the agents are still on the old ones, .... Like so.
 
Marat Baiburin:
So just wait for the agents to update?

If these are errors due to different builds of agents and your desktop PC, then yes, wait. My agents for example are still 2949, not updated to 2950.

 
Andrey Khatimlianskii:

Why then can't the indicator retrieve them on the first request?

How to make a normal multi-TF (and ideally multi-character) indicator without using a timer?

At the first request, the indicator may not receive the data from its symbol, but for another timeframe only for one reason - the desired timeseries hasn't been built or has already been destroyed after some time, when there were no requests.

After an unsuccessful request, just send a command to your chart to update it and terminate OnCalculate immediately. It is guaranteed that OnCalculate will be called and the timeseries will be ready by this time

Документация по MQL5: Операции с графиками / ChartSetSymbolPeriod
Документация по MQL5: Операции с графиками / ChartSetSymbolPeriod
  • www.mql5.com
ChartSetSymbolPeriod - Операции с графиками - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Slava:

At the first request, the indicator may not receive data from its symbol but another timeframe only for one reason - the required timeseries has not yet been built or has already been destroyed after some time, when there were no requests.

After an unsuccessful request, just send a command to your chart to update itand terminate OnCalculate immediately.
It's guaranteed that OnCalculate will be called and it's guaranteed that the needed timeseries will be prepared by this time.


On the first indicator call, the calculation is looped through all data.

//Расчёт количества просчитываемых баров
int limit = rates_total-prev_calculated;
   
//Если первый запуск
if(limit > 1)
{
   //какая нибудь инициализация
   
}

//================================================================
for(int i=limit; i>=0 && !IsStopped(); i--)
{
   ...  

If in this loop there was a failed request, what should be returned in return ?
Limit+1 on which it was unsuccessful?
Or what? I don't understand this point.

 
Roman:


Please tell me, the first time the indicator is called, for example, the calculation is run in a loop over all the data.

And if there was a failed request in this loop, what should be returned in return ?
Limit+1 on which it was unsuccessful?
Or what? I don't understand this point.

Can't you check it yourself?