First, make a change to your code:
1.strings
CTrade trade; trade.SetExpertMagicNumber(MagicNumber);
need to be placed in the "header" of the expert
input double DecreaseFactor = 30 ; // Descrease factor //--- CTrade trade; trade.SetExpertMagicNumber(MagicNumber);
2. Correct the 'iRSIMQL4' function - in MQL5, the indicator handle must be created once in OnInit. Better yet, do not use MQL4 words in the MQL5 code - otherwise you will constantly make mistakes.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello Guys,
I have created a simple RSI based EA. I would like to add one bar confirmation in it.
For example, lets say that if EA would take a "BUY" trade when RSI is 60.....then instead of taking a trade right away.......EA should wait for one more candle and if it is also green then only EA should take a "BUY" trade. (And vice-versa for Short trades)
I am attaching my EA code below. It would be great if anyone could explain me how to do it or redirect me to some tutorial link.
thanks :)