Percentage/Most of conditions occur
-
Hello,
If I have 10 conditions for Long, how to design the EA to trigger ger buy/sell if 70 percent of these conditions are met and not all of them.For simplicity, I am sharing a project that has three conditions only: MACD Cross, RSI above 50, and Price above MA
Shared Project:
https://fxdreema.com/shared/34rmRWNKcI want to only buy when two of these conditions are met.
I used Flags in this project but did not work for me.
Thanks,
-
I want to expand more:
What I really want to do is perform something similar to Excel.
If RSI is above 5 then a value of 1
If MACD (main) above (signal) then a value of 1
If close above MA then value of 1If the total is equal to or greater than 2 then buy.
————
Is there a way to create a variable with such conditions and then add them?Thanks
-
@mohamed80 That is a good idea. You can create as many 0/1 variables as conditions an then another variable called 'Sum' of something like that. You tehn sum all 0/1 variables and if the result is 7 or more, bingo!
-

Yup, you can use variable and formula to do these.
Let me know if this work, I just do it in a hurry
-
@l-andorrà Thanks
-
Thank you for the detailed screenshot.
-
@cedietradermax nicely done, upvoted!
-
@cedietradermax Impressive example. Congrats!

-
@mohamed80

Sorry, I think I made a mistake when I
look to it again on the 2nd modify variables link, sorry my bad