atr based break out
-
Hi, im trying to make a simple ea that buys when a bull candle has a total pip size bigger than 2x ATR.
1: I use a formula block to get the atr value and multiply it by 2. I put the output value into the variable "atr"
2: I use a formula block to multiply the vairable "atr" with 10000 to convert it into a pip value. I put this output into the variable "atr_multiplied".
3: I set a condition that if candle 1 has a total pipsize larger than "atr_multiplied", then buy now.Something is not working properly. When the ea opens trades, the rules are met. But sometimes the rules are met, but no postions are opened, and i dont understand why.
https://fxdreema.com/shared/Isch6Fofd

-
@piptheripper In this link you will see how I convert ATR to pins for every pair. Hope this helps
-
@jstap Thanks for the code. very usefull! In my case, I basically have done the same(atr * 10000) for a 5 digit currency/broker. Im using icmarkets and testing on EURUSD. I printed comments and I can see that the variables are working fine. I just cant understand why sometimes, even if the "buy now" conditions are met i.e -> candle is larger than 2xATR(in pips) the ea does not open any trades.. Any ideas?
-
In the screenshots you can see what i mean.
The comment in lower left corner is the ATR in pips x 2.
The comment in the lower right corner is the candle pipsize.In the first example you see the ea opens a trade as the candle size is bigger than ATRx2
In the second example the candle is bigger than ATRx2, but no trade is opened..
!

-
@piptheripper Hi, I do not see why it wouldn't because logically it has no reason not to. If you put a shared link on here then I will gladly look to see if anything is wrong.
-
@piptheripper Your condition block is using pips calculatio 'as is'. You should use 'as price fraction' instead.
-
@jstap here is the link. Thanks! https://fxdreema.com/shared/Isch6Fofd
-
@piptheripper Your condition's are saying if candle is equals or less than ATR multiplied buy/sell, is this not backwards? Should it not be if candle is equals or greater than ATR multiplied buy sell?
-
@l-andorrà Thanks for your reply! I tried that, but when using "price fraction" the ea opens trades at any time as long as there is no other trade open. So it does not follow the condition block..
-
@jstap sorry about that. I had already corrected this in my main project. Didnt realize the settings were still wrong in this shared project. Here is another link https://fxdreema.com/shared/cPLFW1U8d
-
@piptheripper If you change price fraction to as is it should work, at the minute you are comparing pips to fraction.

-
@jstap still the same thing. If you look at the screen shot below.
The comment in the top left corner is the ATR value multiplied by 2.
The comment in the bottom left corner is the ATR (multiplied by 2) in pips.
The comment in the bottom right corner is the candle size (which is bigger than the ATR multiplied)I really do not understand what is happening..
here is the project link updated https://fxdreema.com/shared/vBmhTsxGb

-
@piptheripper I have readvised the ATR pips to work with MT5 link, I have tested and all seems to work. Hope this helps.
-
Sorry for the late reply, been working on other things. Really appreciate your help!