Multiple Open Positions Issue
-
Hello everyone,
I would appreciate your assistance with an issue I am experiencing.
Strategy:
- When a candle closes above the 12 EMA, a buy position is opened.
- If, while that buy position is still open, a new candle closes below the 12 EMA, a sell position is opened.
Problem:
After the sell position is opened, every new candle that crosses back above the 12 EMA, then below the 12 EMA and closes, creates additional sell positions. This results in multiple sell trades being opened instead of just one.Question:
How can I prevent this from happening? I only want one active position per direction until either the stop loss or take profit is reached. I have already tried using the "Once Per Bar" block, but it has not resolved the issue.Any advice would be greatly appreciated. Thank you!
-
Here is the link to the project https://fxdreema.com/shared/1moIlMrV
-
You need to specify buys only or sells only on the 'no position' block. That way you will be able to stop all new buys and all new sells as far as the first one each is still active.
-
@l-andorrà thank you for your response. I just tried that, but its still doing the same thing. Opening multiple positions.
-
Hi Peter,
actually, it does work—see the EA in the attachment. So, something else must be wrong. -
You need to add close position block
-
Hi guys, thanks for the assistance, yes the error was on my side, There was a setting that was left unchanged. All is well now. Thanks for the help. I appreciate it.