Move stop loss on multiple trades.
-
Hi please see my shared project below.
https://fxdreema.com/shared/6XKA0FB0b
So basically I am following a signal provider that needs me to open 3 trades (Buy or Sell) He provides 3 take profits targets and a stoploss. So after putting the EA on the desired currency pair you have some inputs to enter first.
- Original stoploss (SL)
- Take profit 1 (TP1)
3 Take Profit 2 (TP2)
4 Take Profit 3 (TP3)
(ignore opening price inputs, in the input screen as they are not in use)
I have setup a screen button that opens 3 buy trades. It records the value of the first open trade to the screen, as the next two will be similar. I got it to print that value to screen just to confirm that it is working. it opens 3 trades with the SL and the 3 TP's. It does this just fine.
If it hits the original stop loss with out first hitting TP1 it closes the 3 trades no problem.
However if it hits TP1 it closes the first trade as it should, but fails to move the SL for the next two trades to break even (opening price)The same with TP2 - it does not move the SL to TP1 for the last trade
Then what is supposed to happen is when the price hits 80% of its TP3 target the SL is supposed to go to 60% of the TP3 value.
Please ignore the sell section of the project. WIP
Hope someone can help me out.

Laurence -
@larryh Try using a purple block on the on trade tab, so when 1 group hits TP it does something with the others, when 2 hits TP it does something with the last
-
@jstap Thanks - will check into that.
-
@jstap Isn't that what I did for each group of trades - using the purple block to identify group 1, group2 etc - and then purple block to modify stoploss? Or am I misunderstanding? sorry - could well be.
-
@larryh To be honest not sure, on chart doesn't work on back test, on trade does, I use on chart only to transfer what I know works on back test to live/demo.
-
@jstap thanks for coming back to me

yes this only works on live/demo not back test -
@larryh Not my point, get working on back test then transfer to where needed to work on live demo.