@l-andorrà Thank you for looking at this and your reply. I have made the changes and it is still not working unfortunately.
https://fxdreema.com/shared/ESSZIaJdb
Maybe this image will help

@l-andorrà Thank you for looking at this and your reply. I have made the changes and it is still not working unfortunately.
https://fxdreema.com/shared/ESSZIaJdb
Maybe this image will help

Hi, I have managed to get the last fractal values correctly as they print on the screen. This is part of a bigger EA but I have simplified as I can't get this section to work.
I have these last fractal values as variables. I would like to use them as price points that a candle must be above or below before a trade can be opened. For instance, for a buy the candle open price level of candle ID 1 must be below the price value of the last up Fractal. The opposite for sells.
I have been working on this for weeks and no further ahead so any help would be very much appreciated.
Many thanks
Thank you so much. so many times of looking and kept missing it!
Hi, I cant work out what is wrong with this, Ive looked at the examples and I am sure its correct? The EA sets the take profit and stop loss correctly. However the trailing stop and break even don't do anything. Help would be very much appreciated.
Hi, I have nearly completed this EA but except one part I just can't figure out.
Simply if Trade 1 of lot size 0.01 goes correctly it makes a profit, say £5. However if it goes too far the wrong way a second rescue trade of higher lot size e.g. 0.03 comes in. Once the combined profit of trades 1 + 2 = £5 I would like both to close. e.g. trade 1 may be -£13 and trade 2 £18 = £5.
Hope that makes sense. Thank you
Hi, I have exported an EA and the MT4 stratery tester came up with this message:

I cannot work out what is wrong with it? https://fxdreema.com/shared/kSqFDO2Eb
The same thing happened with another project. I had to take it all apart and put it back together exactly the same way and it worked. I don't want to have to do it with this as it is much larger.
Any ideas? Many thanks
@miro1360 That worked perfectly, thank you
Thanks Miro, however I am still not sure how to get the open price of an original trade as the stop loss of the new trade. Lets just say I had a trade that was in negative and wanted to drop the EA on afterwards to manage that trade because it was going negative in the wrong direction.
I have played with the pink blocks but cant fine a combination that will find that for me?
Hi, I am trying to come up with an EA that hedges against a previous trade. If a trade that is running already goes a certain distance the wrong way, I want smaller trades in the opposite direction to take some profits.The only part I am struggling with is that every time a new hedge trade opens, I want its stop loss to be at the trade opening price of the original trade that is in negative. I cant work out how to have the stop loss set for this level? Maybe I am being stupid?!?
https://fxdreema.com/shared/GTSSrYaqe
Many thanks
Hi, I am manually placing trades quickly on a 1 minute chart, and don't have time to set the TP and SL. I am trying to design an EA that can do that for me once the trade is in. I thought it would be simple but I cant get it to work! Thank you
Hi Does anyone know the answer to the above? The formula to set the variable for the ATR stop loss works on a Buy or Sell now. However why does it not work on a pending order? What if you don't want a trailing stop for it? Thank you
Hi Bedeka, thank you for you help on this. I don't want the stop to be trailing though, I want to be 2 x 14 day ATR at the time the trade opens and then stays there. I tried doing it the same way but without trailing stop and it doesnt seem to work.
Many thanks
Hi, I have been trying to set my pending order stop loss at 2 x the 14 day ATR. It doesn't work if you simply put that in the buy/sell pending order block. So I used some formula blocks to work out what that would be as a variable. It doesn't seem to do anything like this either.
Some help would be appreciated, many thanks.
Wow you are a genius! That is what I have been trying to do. With the trailing stop I have set it to what I thought was 2 x the 14 day ATR. However is seems to be a lot less than that. I adjusted it with *2 so not sure why?
Thank you
Hi, thank you for that, so quick! It is certainly is getting closer. There seem to lots of trades opening on each candle (day).

I am trying to get a buy trade to open when it hits the blue line which is the highest price of the last 21 days, and only one to
open. I want the trade to stay open until it drops and crosses the lowest price of the last 10 days which is the opposite red line. The same for the sell trades but the reverse, i.e. one sell trade to open when it hits the lowest blue line and then to close when it rises past the 10 day price high, the opposite red line.
It is meant to be a trend/breakout system on a daily chart.
Thank you
Hi, I have been trying for weeks to get this EA to work and tried absolutely everything I can, with no joy. Its a simple EA, I want to buy when the current price goes higher than the previous high price of the last 21 days and to sell when the opposite happens. No take profit and a stop loss of twice the 14 day ATR. The trade will close after the buy trade crosses the lowest price of the last 10 days and the opposite for selling. I feel like I am close, however it is just the condition blocks which are not working and I don't understand why, Thank you. (the trace is so I can see the trades are taken/closed at the right points)
Thank you for your help on this. I tried it, but unfortunately it still does not seem to work. I have put a trace on the 52 day candle high & low in blue and the 21 day high and low in red. I am trying to buy when it hits the top blue line and come out when it hits the bottom red. The reverse for selling. The trades seem to be coming in the middle
Image doesn't want to attach "Sorry, the board attachment quota has been reached"
This is what I have done so far which isnt working!