You use MQL4, not MQL5. and you forgot to use the last input for iRSI, the code should be :
double currentSymbolRSI = iRSI(NULL,0,14,PRICE_CLOSE,0); //the RSI of previous bar if(currentSymbolRSI>40) Alert("Bigger than 70"); else if(currentSymbolRSI<30) Alert("Less than 30");
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
Dear all,
I am complete new to Expert advisor programming. Hope you could shed some light on.
I have written following code in on_tick method:
double currentSymbolRSI = iRSI(NULL,0,14,PRICE_CLOSE); //the RSI of previous bar
if(currentSymbolRSI>40)
Alert("Bigger than 70");
else if(currentSymbolRSI<30)
Alert("Less than 30");
but the point is currentSymbolRSI variable is always 10.0.
While the RSI chart is 49.5.
What am I doing wrong?