@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