if(RSI < 30 && FastMA0 > SlowMA0 && SlowMA1>FastMA1)
if(RSI < 30) // enter trade with magix X if(FastMA0 > SlowMA0 && SlowMA1>FastMA1) // enter trade with magix Y
Moreover, for both of the strategies, I only want them to have a single trade.
You can count trades with specific magic number to check if the strategy has already opened a position:
int countX(int magic) { int counter=0; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i, SELECT_BY_POS)) { if(OrderType()>1) continue; if(OrderMagicNumber()==magic) counter++; } } return counter; }
You have only four choices:
-
Search for it (CodeBase or Market). Do you expect us to do your research for you?
- Try asking at:
- Coding help - MQL4 programming forum
- Make It No Repaint Please! - MQL4 programming forum
- MT4 to MT5 code converter - MQL5 programming forum
- Please fix this indicator or EA - General - MQL5 programming forum
- Requests & Ideas (MQL5 only!) - Expert Advisors and Automated Trading - MQL5 programming forum
- Indicator to EA Free Service - General - MQL5 programming forum
-
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
-
Or pay (Freelance) someone to code it. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2019)
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
No free help (2017)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, can anyone advise me on how to create a robot with multiple entry conditions and all of them can only have a single trade. For example, I have 2 strategies:
1. RSI strategy
2. MA crossover strategy
If RSI < 30 I'll enter a trade and when 20MA cross above or below 50MA I'll also enter another trade. However, both of the conditions are independent and for different trades. It's not like
if(RSI < 30 && FastMA0 > SlowMA0 && SlowMA1>FastMA1)
Since it's not "AND".
Moreover, for both of the strategies, I only want them to have a single trade. I know you can use Magic number to identify the EA and OrderTotal to see the total trades. However, what if it's the same expert advisor with different strategies?
My apology for poor explanations and I hope to hear from you soon whether is this feasible or not? Thank you and have a nice day.