ATR value BASED PARTIAL TP

Jajaofopobo

Trader
Sep 6, 2021
70
7
24
Is it possible to get the ATR value of an Open order price when price has gone past it (now in profit)?
Post automatically merged:

would this work?


OrderOpenPrice()+ iATR(Instrument,PERIOD_M15,ATRPeriod,Shift)*3;
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,245
1,507
144
Odesa
www.earnforex.com
Do you mean to move an open's trade TP to some multiplier of ATR? Why not. This will work. However, if your first sentence means that you want to set such a TP when the current price is already above that price, then no, that won't work - for a Buy trade, the TP should be below the current price.
 

Jajaofopobo

Trader
Sep 6, 2021
70
7
24
Do you mean to move an open's trade TP to some multiplier of ATR? Why not. This will work. However, if your first sentence means that you want to set such a TP when the current price is already above that price, then no, that won't work - for a Buy trade, the TP should be below the current price.
YES, I meant to move an open's trade TP to some multiplier of ATR.

but is it now possible for it to be the ATR value of the order open price candle
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,245
1,507
144
Odesa
www.earnforex.com
YES, I meant to move an open's trade TP to some multiplier of ATR.

but is it now possible for it to be the ATR value of the order open price candle
Yes, your EA can get the order's open time with OrderOpenTime(), then find the right bar using iBarShift(), then get the relevant ATR value using a call to iATR() at that bar. That's if you are updating the order when some time has passed after its opening. If you are setting such a TP on opening, there is no need for such difficulties and you just call iATR() with zero shift.
 
  • 🚀
Reactions: Jajaofopobo