Once per condition
-
Hello Guys,
First of all, I hope everyone is fine during Covid pandemic.
So this might have been answered already but I just could not find an answer to it on forum. How can I make EA to open trade once per condition only.For example a simple MA cross, lets say I want EA to buy when 5 ema<13 Ema, EA will buy and I set take profit to 10 pips, take profit hits but then EA opens another trade because 5EMA is Still > 13 EMA. I dont want EA to do this and only want to do this if a fresh cross happens again.
Thanks in advance
-
But if the condition is true, a new trade should be open. You mean may be that you just want one trade per day?
-
hello guys i am looking for a solution for this exact problem. he is saying he only wants the ea to make only one trade whenever the conditions are met. anytime you have a condition it will start a trade and if that trade ends in profit it will also open another trade because ema 5 is still less than ema13. we want it to make only one trade .
-
@l-andorrà as the above user said, I just want one trade per condition. When condition is true a trade did open and then it hit my profit target at that point there should not be another trade just because condition is still true and 5 ema still above 13 ema. A new trade should only open when a fresh cross happens means 5 ema goes below 13 ema and then again crosses above then only a new trade should open.
Thanks
-
Anyone please ? Maybe @FXDREEMA-0 you can help?
Thanks
-
@singh use this condition: x> (cross above) instead > (above)

-
Another option is using a boolen variable indicating when the first condition happened and not being reinitialized until an opposite crossing happened.
-
@l-andorrà how can we do that?
-
@nehemiah7 That depends on what you need and how it is supposed to happen. There is not a specific way to do it.