Quote:
Originally Posted by Dave137
What is an easy statement to check to see if 2 moving averages have crossed within 5 bars before the current bar?? Can anybody help me with this??
Dave
|
PHP Code:
ma1_0 = iMA(....,0);
ma2_0 = iMA(....,0);
ma1_5 = iMA(....,5);
ma2_5 = iMA(....,5);
if((ma1_0 - ma2_0) * (ma1_5 - ma2_5) < 0) cross = true;