Download MetaTrader 5
To add comments, please log in or register
Do you want to learn MQL5? 300 articles will help you!
MThomp
63
MThomp 2015.09.27 15:53 
MThomp
63
MThomp 2015.11.01 19:27  
 Alert on next bar :  if (close[I-1] > open[I-1]) Alert ("next bar");
please is this correct based on 15 MTF. Thank you

 
qjol
3243
qjol 2015.11.02 06:02  

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

Keith Watford
Moderator
8017
Keith Watford 2015.11.02 07:01  
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
Keith Watford
Moderator
8017
Keith Watford 2015.11.02 07:05  

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 

qjol
3243
qjol 2015.11.02 07:15  
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

Keith Watford
Moderator
8017
Keith Watford 2015.11.02 07:30  
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
qjol
3243
qjol 2015.11.02 07:54  
but in EA/script ?
Keith Watford
Moderator
8017
Keith Watford 2015.11.02 08:51  
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

/
To add comments, please log in or register