Partial close after 1 ATR at the time of trade open
-
Hi All,
I have a pretty basic EA which correctly works when placing the trades but i'm having trouble with my exit strategy for profitable trades. The exit strategy is as follows: Close 50% of the trade when price is at 1 ATR (ATR should be based off of the value at the time of opening the trade) and then the child trade (remaining 50%) should move the stop loss to break-even and the trade should close when the MACD signal and main lines cross.
I have tried using the modify variable block, the pips away from open block as well as conditions based off of an ATR formula but can't get any of them to work. I'm not sure what i'm doing wrong. Any help would be much appreciate. Thanks, KP. Here is my setup:

-
@krunal20 I would save the current atr at trade open like you have done with formula, in here https://fxdreema.com/forum/topic/12802/atr-pips you'll see how to put atr into pips so you can use in all your conditions.
-
Thanks for that @jstap - That's really helpful.
Just out of curiosity, do you know why my current setup isn't already doing this? Because as you said, i'm using the formula blocks after the buy/sell to save the trade open price +/- ATR into a variable and then using that variable in the 'pips away from open price' block to close half of the trade. As I would only ever have 1 live trade per symbol, the variable would only update once at trade inception (because of where I have placed the formula block) so there shouldn't be any issue of the ATR updating as time moves on. Thanks, KP.
-
@krunal20 To be honest I'm not sure, that would save it as a price fraction, so if that's what you were using in pips away it should have worked. I tend to always use pips, probably to do with me but previous problems is what's caused this.