Trade nextbar

Back to topics list To post a new topic, please log in or register
avatar
23
Memma30 2015.09.27 17:53
 

avatar
23
Memma30 2015.11.01 20: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

 

avatar
3134
qjol 2015.11.02 07: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

avatar
Moderator
3407
GumRai 2015.11.02 08: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
avatar
Moderator
3407
GumRai 2015.11.02 08: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 

avatar
3134
qjol 2015.11.02 08: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

avatar
Moderator
3407
GumRai 2015.11.02 08: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
avatar
3134
qjol 2015.11.02 08:54 #
 
but in EA/script ?
avatar
Moderator
3407
GumRai 2015.11.02 09: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

Back to topics list  

To add comments, please log in or register