Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi
I want to include a MA on the RSI into my ea without calling an custum indicator.
Is it possible to calculate the MA right in the expert advisor instead of calculation it in the indicator?
In the ea I want to include a check if MAonRSI crosses Value of RSI like this:
bool FilterRSIMACrossShort()
{
double rsi0=iRSI(NULL,RSITimeframe,RSIPeriode,RSIPrice,0);
double rsi1=iRSI(NULL,RSITimeframe,RSIPeriode,RSIPrice,1);
double marsi0=iMA(NULL,MATimeframe,MAPeriod,0,MAMethod,MAPrice,MAShift); //this uses MA on Price not on RSI
double marsi1=iMA(NULL,MATimeframe,MAPeriod,0,MAMethod,MAPrice,MAShift+1);
if(RSIMACrossFilteraktiv &&
marsi1>rsi1 && marsi0 < rsi0) //ma crosses
return(true); else return(false);
}
But iMA takes the MA of the price not of the RSI.
I read some comment, about using iMAOnArray, or ArraySetAsSeries ...
I tried a lot, but nothing worked. Was not able to compile without errors.
Has anyone an idea how to include without custom indicator? Thanks for your help.