Download MetaTrader 5

Please help to describe close price 5 minute ago in mt4

To add comments, please log in or register
Carry on your private correspondence in your profile. It is secure!
huylucdao
9
huylucdao 2014.01.03 15:37 
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.
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.01.03 15:42  
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.

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)
huylucdao
9
huylucdao 2014.01.04 00:49  
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 . . .


To add comments, please log in or register