Recording price

 

Here I have function that checks for MAs cross:

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.

 
t0mbfunk:

Here I have function that checks for MAs cross:

Variable = Bid;
 

Thank you )