Huylucdao:
Hello everybody.
I am trying to code a EA:
x = close current - close at 5 minute ago.
x>30pips ->buy
x stoploss=30pips, takeprofit=80pips, trailing stop = 30pips.
Time frame 4 hour.
The problem: how to describe close price at 5 minutes ago in mt4 ?
The close price at 5 minutes ago will change value with time.
Anyone help me ? Thank you so much.
Hello everybody.
I am trying to code a EA:
x = close current - close at 5 minute ago.
x>30pips ->buy
x stoploss=30pips, takeprofit=80pips, trailing stop = 30pips.
Time frame 4 hour.
The problem: how to describe close price at 5 minutes ago in mt4 ?
The close price at 5 minutes ago will change value with time.
Anyone help me ? Thank you so much.
There is no "close price" 5 minutes ago . . . close price applies to a bar and discrete packets of time, not x minutes ago. You can get the close of a M1 bar 5 bars ago . . .
iClose(NULL, PERIOD_M1, 5)
Thank RaptorUK so much :)
RaptorUK:
There is no "close price" 5 minutes ago . . . close price applies to a bar and discrete packets of time, not x minutes ago. You can get the close of a M1 bar 5 bars ago . . .
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am trying to code a EA:
x = close current - close at 5 minute ago.
x>30pips ->buy
x stoploss=30pips, takeprofit=80pips, trailing stop = 30pips.
Time frame 4 hour.
The problem: how to describe close price at 5 minutes ago in mt4 ?
The close price at 5 minutes ago will change value with time.
Anyone help me ? Thank you so much.