One trade per condition
-
Hi, i would like for the EA to open one trade only once when the condition is met.
This is the code i have so far
https://fxdreema.com/shared/a414Eb3JdWhen MA 1 crosses above MA 2 a buy trade is open and TP or SL is hit.
The buy trade scalps really quick and closes. In turn the condition may still be true, causing the EA to re open a new trade.
How do i get it to open one trade per cycle and onced close (from TP or SL), only open a new trade when a new crossing of MA 1 and MA 2 happens? (whether its 5 mins or 1 hour after)
-
Good question, I have tried to solve this issue several times, people pls, help here.
-
@thugwig first you have to use no trade block then once per bar...even you can use variables block to reset your strategy
-
@massoudsl thank you, would you be able to show me an example of how to reset using variable blocks? and is no trade and no position the same thing?
-
-
@massoudsl thank you, your a legend, this appears to have work. will do some more testing on it
-
I believe both codes are good and would do