Trade nextbar

 
 
 Alert on next bar :  if (close[I-1] > open[I-1]) Alert ("next bar");
please is this correct based on 15 MTF. Thank you

 
 

there is no close or open in MQL and even it's your own declared array, no one here can see from here until your computer or your mind

second what's I

unless you post the relevant code no one here can understand if it's Alert for next bar or the next restaurant

 
qjol:

there is no close or open in MQL and even it's your own declared array, no one here can see from here until your computer or your mind

second what's I

unless you post the relevant code no one here can understand if it's Alert for next bar or the next restaurant

close and open are constants passed to OnCalculate. So they are basically the same as Open and Close
 

Memma30:

 Alert on next bar :  if (close[I-1] > open[I-1]) Alert ("next bar");
please is this correct based on 15 MTF. Thank you

 



No, it is not correct.

It just finds if the close price is higher than the open (bullish).

You need to use the Time to find if you have a new bar and iTime if a different time-frame to the chart time-frame 

 
GumRai:
close and open are constants passed to OnCalculate. So they are basically the same as Open and Close

maybe, and maybe not,  [i admit] it's (just) a calculated guess, but you never know for sure 

for example: the OP can use datetime/double/int/whatever open[]; and store whatever he wants there, unless we can see the relevant code we can't assume nothing

 
qjol:

maybe, and maybe not,  [i admit] it's (just) a calculated guess, but you never know for sure 

for example: the OP can use datetime/double/int/whatever open[]; and store whatever he wants there, unless we can see the relevant code we can't assume nothing

In OnCalculate at least open[] is a constant double and cannot be modified
 
but in EA/script ?
 
qjol:
but in EA/script ?

As far as I know, you are free to use open[] or close[] for your own values anywhere except in an indicator in OnCalculate.

qjol:

there is no close or open in MQL 

 I was responding to the above statement