Converting Takeprofit % to ATR, pips and time in order to close the order
-
Hello guys,
Is that possible: “Let’s say my tp target is 1%, 1% is equal to 600 pips at the time, I’m on 1h chart and atr is 60 pips which means I expect my order to close with profit in 10 hours. So, my bot must measure 1% as pips, then divide it to 60 minutes to find the max. stay open time for the order, and finally if the order can’t reach the tp target and the max stay open time is over then bot will close the order. So, for the case above, if the order can’t reach 1% (600 pips) target after 10th bar (which means after 10th hours) bot must close the order.
Is it possible? If yes, how can I write it?
-
In the buy or sell block. You can set the expiration time.
By the way, provided that 60 pips for 1 hour, it may require about 100 hours to have ATR of 600 pips.
According to my rough estimation, the ATR is proportional to the square root of time.
One more complication, the interval from entry point to SL/TP is just part of the ATR. So the time needed may even longer than 100 hours (on average in theory)
-
Let me make a rough verification by using current EURUSD as an example (both n is equalized to 10 weeks)
Current hourly ATR (n=1200) is 0.00137
Current weekly ATR (n=10) is 0.01790.00137 x SquareRoot(120) = 0.015, which is quite close to 0.0179 as an estimation
-
Thank you for your feedback @sktsec. So, how can I write it?