void CheckForMaCross()
{
double PreviousFast = iMA(NULL,0,FastMA,FastMaShift,FastMaMethod,FastMaAppliedTo,2); // Calculates FastMA on second candle back.double CurrentFast = iMA(NULL,0,FastMA,FastMaShift,FastMaMethod,FastMaAppliedTo,1); // Calculates FastMA on 1 candle back.double PreviousSlow= iMA(NULL,0,SlowMA,SlowMaShift,SlowMaMethod,SlowMaAppliedTo,2); // Calculates SlowMA on second candle back.double CurrentSlow = iMA(NULL,0,SlowMA,SlowMaShift,SlowMaMethod,SlowMaAppliedTo,1); // Calculates SlowMA on 1 candle back.if(PreviousFast<PreviousSlow && CurrentFast>CurrentSlow)
if(PreviousFast>PreviousSlow && CurrentFast<CurrentSlow)
}
I would like to learn how to record into a variable the price at the time of the crossing,please help me or point me to the right material.
Thank you.
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.
Here I have function that checks for MAs cross: