Errors, bugs, questions - page 134

 
EQU:

Sitting... Watching...

I will never believe that MQL5 and MQL4 were written by the same team.(((

MQ4 - flying...

MQ5 is child's play. No offence intended - but...(((


How long has it been since the release of MT4? In 2 years and MT5 will be considered a "perfect trading system"...
 
Dmitriy2:

I haven't seen this thread... same thing...

The thing is, I'm not going to stupidly make checks on every line for all occasions confusing and cluttering up the code. If that's out of the question then... crutches are added, a big enough project is finally completely redone and working...

And in general, I'm just amazed at this approach... It turns out that not the first time such a question arises (and I'm sure more than once in the future will arise in other people), and every time "for the first time" to spend a lot of your and others' work time to explain what you need to do to bypass this bug ...

The only thing to do is to add into TESTER that recommended in that thread only ONE Sleep(1000) at start of Expert Advisor.

It must not be so that the shell would imply glitches, and those glitches must be avoided in the code. And the TERMINAL is working properly and correctly, there are NO ERRORS (in this situation). But the operation of the tester is DIFFERENT from that of the terminal.

ps EQU hello:)

Once again, I repeat. We recommended beforehand how to work with indicators, described it in documentation (someone just does not read the documentation).

Right after you create an indicator handle, there is no data yet. They must be calculated in a different thread. The fact that you immediately get data in the client terminal, consider it luck. Once again you may not get the data.

The tester is more deterministic than the terminal - everything is much more synchronous there. And immediately after creating a handle you will never get data. In this case "never" is equivalent to "sometimes". For "sometimes" you still need to arrange some kind of check. So put in a check loop with a slip. And everything will be as in life.

PS Well, don't create a new handle at each iteration - it's wrong from any point of view.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Типы индикаторов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Типы индикаторов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Типы индикаторов - Документация по MQL5
 
stringo:

Once again, I repeat. We have recommended beforehand how the indicators should be handled and described it in the documentation (someone just doesn't read the documentation).

Right after the indicator handle has been created, there is no data yet. They must be calculated in a different thread. The fact that you immediately get data in the client terminal, consider it luck. Once again you may not get the data.

The tester is more deterministic than the terminal - everything is much more synchronous there. And immediately after creating a handle you will never get data. In this case "never" is equivalent to "sometimes". For "sometimes" you still need to arrange some kind of check. So put in a check loop with a slip. And everything will be as in life.

PS Well, you shouldn't create a new handle at each iteration - it's wrong from any point of view.

Then we need two functions (extra time...). This is taking into account the fact that the data for the indicator in the code are always different. Will it be ok?

   if(ХендлПараболик(ТФОткрытияпоSAR,SAR_stepОткрытияпоSAR,SAR_maximumОткрытияпоSAR,2)==true)
      ЗначениеПараболик=Параболик(ТФОткрытияпоSAR,SAR_stepОткрытияпоSAR,SAR_maximumОткрытияпоSAR,1);

//+----------------------------------------------------------------------------+
//Функция создания и проверки хендла Parabolic SAR                    MQL5     |
//+----------------------------------------------------------------------------+
bool ХендлПараболик(ENUM_TIMEFRAMES период,double step,double maximum,int бар)
  {
   Parabolic=iSAR(СИМВОЛ,период,step,maximum);
   for(int i=0;i<100;i=i+1)
     {
      if(BarsCalculated(Parabolic)>бар)
         return(true);
      Sleep(50);
     }
   return(false);
  }
//+------------------------------------------------------------------+


//+----------------------------------------------------------------------------+
//Функция Parabolic SAR                                               MQL5     |
//+----------------------------------------------------------------------------+
double Параболик(ENUM_TIMEFRAMES период,double step,double maximum,int бар)
  {
   double ЗначениеParabolic[1];
   CopyBuffer(Parabolic,0,бар,1,ЗначениеParabolic);
   return(ЗначениеParabolic[0]);
  }
 
Does anyone know how to get index of current trading session for SymbolInfoSessionTrade() function. Help only says session number for which I want to get start time and end time. Indexing of sessions starts from 0.
Документация по MQL5: Получение рыночной информации / SymbolInfoSessionQuote
Документация по MQL5: Получение рыночной информации / SymbolInfoSessionQuote
  • www.mql5.com
Получение рыночной информации / SymbolInfoSessionQuote - Документация по MQL5
 
 
Rosh:
Read the article Restrictions and checks in experts

Thanks for the tip.
 

Please advise. Is this line at the beginning of the EA necessary

void OnTick()
{
   if(!MQL5InfoInteger(MQL5_TRADE_ALLOWED)) return;
If not, when is it needed?
 
gpwr:

Please advise. Is this line at the beginning of the EA necessary

If not, when is it needed?

This function checks if this checkbox is enabled:


 
gpwr:

Please advise. Is this line at the beginning of the EA necessary

If no, in what cases is it needed?

If trading in mql5-program is prohibited (for example, if you have unchecked the box allowing trading in this EA when you start it), then no trading will be performed. The Expert Advisor itself will work as usual. Check it out for yourself.
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций - Документация по MQL5
 
Urain:

This function checks whether this check box is enabled:

No, this is a message about another check box that is checked when the expert or script is started


Reason: