Prev Day close + ATR go long - how to do it?
-
Hi, I try to make an EA where it buys after 15m candle close above a level that is some pips (based on atr) above prev day close.
Another words:
Prev day close price + ATR = go long level
Prev day close price - ATR = go short level
and the triger is a 15m candle close above or belov those levels. Sort of breakout strategy.I can't come up with a way of doing it... can any one help?
Thanks in advance
-
@fabiow In here, you'll see how to get ATR in pips: https://fxdreema.com/forum/topic/12802/atr-pips add this value to day candle 0 close, this will change as charts move so your timings will change the result, if you get these numbers into variables once per day and levels won't change.
-
i did it like this:
https://fxdreema.com/shared/il2kksEib
but I don't think i did it right... am I close or totaly wrong?

-
@fabiow Standard atr will give you the price fraction, this is why converting to pips needs to be done.
-
I am getting closer. I have EA working like I want it to work, I have D1close and ATRvalue in variabels as value/numeric, but I don't know why EA is not taking any trades. This are conditions I tried:
https://fxdreema.com/shared/q747ZGIDb
-
@fabiow When creating EA's test 1 condition at a time, if working add another, keep doing this until you find the block that's stopping EA from working.