Help required for EA development & Learning
-
Hey Guys, I've added this thread to this forum (a bit more appropriate).
I've hit my limit on how much I can do at my current level of understanding without assistance so sorry in advanced for asking if it is a super obvious answer, I've attempted several ways to include "continuation" trades into my first EA without complete success. Any help is much appreciated.
And shared link: https://fxdreema.com/shared/gggh3P0rc
The EA I'm attempting to build is based off an indicator which behaves in the same way as the RSI.
EA Requirements:
Enters longs when price crosses above the 20
Enters shorts when price crosses below the 80.Trades are entered in two parts, risked at 1% of account equity each;
The first part having a SL = 1.5 * ATR, and a TP of 1* ATR
The second part having a SL of 1.5* ATR, and no TPIf the First part hits TP, the second part moves its SL to BE
and
If price is >2x ATR, a trail stop of 1.5* ATR is placed on the second part.
And finally trades are exited if:
For Longs; price crosses below the 50 or 80 level
for shorts; price crosses above the 50 or 20 levelI've successfully got everything up until this point running perfectly. However I've become stuck at one of the final steps when trying to add "continuation" trades.
My aim is to add functionality where the following occurs;
-
If either the initial pairs of short or long entries hit their SL before taking profit and there is no exit signal, then both trade parts re-enter with new adjusted ATR based SL/TP levels. These trades are to keep re-entering if they keep getting stopped out until an exit signal or opposite buy/sell signal is given or until the take profit level is hit.
-
If a trailing stop or break-even stop is hit, I'd also like it to re-enter with a new trailing stop behind it, and it is to continue re-entering if it gets stopped out again until an exit signal or opposite buy/sell signal is given.
I've tried to have a solid attempt at dealing with continuation trades with the trailing stops (aka part 2), however I think the issues I'm having relate to the conditions that qualify when continuation trades should take place. (I.e. the trouble area below).

If someone is able to help me finish off this EA it would be awesome for my own learning & so I can adapt this further. I'm more than happy to sort anyone out through paypal if they nail the whole thing.
Cheers!
-
-
Progress update below
https://fxdreema.com/shared/xbXTtlf3e
I'm trying to find a way to have a condition that says "where signal line hasn't crossed below a certain level to allow my continuation trades to re-enter.
I tried pre-defining key cross over levels as a bool = true variable, and then stating the variable is "False" as a work around for "hasn't crossed" above/below a level, however this didn't work



-
@gwydaer I already answered you previous thread for this question. Please select just one of them and don't duplicated threads.