Is there any event to use in an Expert Advice that triggers when a new bar is created?
I think OnChartEvent
, OnTick
, OnTimer
doesn't do that.
As per MQL4
documentation, built-in OnTick()
, OnTimer()
et al functions, are pre-defined handlers.
If needed, may try to create one's own, using built-in szstem variable Bars
( iBars()
is rather a heavyweight alternative ):
bool aNewBarEVENT(){
static int anAlreadyObservedBarCOUNT = EMPTY; // .INIT
if ( Bars > anAlreadyObservedBarCOUNT ){ // .TEST
anAlreadyObservedBarCOUNT = Bars; // .UPD
return( True ); // .ACK
}
return( False ); // .NACK
}