MetaTrader 4 Build 529 beta released with new compiler - page 42

 
zigan:


That's news to me! I'm so used to the five-by-five double:

It never even occurred to me that there might be a whole... there's a range of 1 to 3. And what's the point of integer representation? Just to make it work faster?



I don't know, I think the developers had some purpose or no purpose ...
 
St0nE:

Yes, that's how I define the new bar and now, on 509 it works stable.

Today I updated to 537 and got an error when working with an array. Opened the new doc, and yes, there are two ways to use Bars.

That's why I asked here. If you don't mind, could you please suggest another workable way of defining a new bar?

Thank you...


void Fun_New_Bar()                              // Ф-ия обнаружения ..
  {                                             // .. нового бара
   static datetime New_Time=0;                  // Время текущего бара
   New_Bar=false;                               // Нового бара нет
   if(New_Time!=Time[0])                        // Сравниваем время
     {
      New_Time=Time[0];                         // Теперь время такое
      New_Bar=true;                             // Поймался новый бар
     }
But it should be understood that if you change the period of the graph, the function will crash... I'm running away now, no time to code, the failure is corrected by iTime()
 
alexvd:

Can you describe the settings set in the strategy tester, the input parameters, the tick generation model... + attach the Expert Advisor to be tested.

Send all of this to the Service Desk.


Application #882960
 

To the developers of

Please implement REASON_TEMPLATE as a reason for EA deinitialization.

Of course I would also like to have a "complete list" of all possible reasons, not different from MT5.

 
VOLDEMAR:

But you must understand that the function will fail when the period of the chart is changed ... I have no time to code now. Failure is corrected via iTime()

Thank you! That's about it...

My period doesn't change on the fly, so not relevant yet... :-)

I understand this function will work on every tick, won't it be slower than my variant?

 
St0nE:

Thank you! That's about it...

My period doesn't change on the fly, so not relevant yet... :-)

I take it this function will work on every tick, won't it be slower than my variant?



Your version can not be used, you request the number of bars in the history and compare it, it makes sense logically, but with the kind of history that brokers give us, this approach can not be used ... It simply won't work correctly ...

There are often holes in the history, many brokers have different history period, some from 1970 and some from the beginning of 2012, the number of bars will be different, if you change timeframe to a smaller or larger the number of bars will also change, the terminal will pump the history or the holes will be closed, the number will also change ....

 

Released 538 build with fixes.

In particular iVolume bug fixed

 
VOLDEMAR:


Your version cannot be used, you request the number of bars in the history and compare, yes logically it makes sense, but with the kind of history brokers give us, this approach cannot be used ... It simply won't work correctly ...

There are often holes in the history, many brokers have different history period, some from 1970 and some from the beginning of 2012, the number of bars will be different, if you change timeframe to a smaller or larger the number of bars will also change, the terminal will update the history or the holes will be closed, the number will also change ....


what difference does it make how many bars are there since 1970 or since 2012? what we need is to determine if there is a new bar. when you change the timeframe, the terminal re-initializes, ExpertBars=Bars; new bar ExpertBars!=Bars appeared, so code
bool isNewBar=false;

if (ExpertBars!=Bars) {
ExpertBars=Bars;
isNewBar=true;
}
working
 
Descriptions of the problems have gone to Service Desk, including the latest version - 538. The programmes are attached.
 
mr_Johns:

What difference does it make how many bars are there since 1970 or 2012? What we need to do is to detect when there is a new bar. When we change timeframes, we get re-initialized, ExpertBars=Bars; a new bar ExpertBars!=Bars appeared, so the code
The bool isNewBar=false;

if (ExpertBars!=Bars) {
ExpertBars=Bars;
isNewBars=true;
}
working

then good luck ))))
Reason: