joshua74133
Member
the goal is to only get arrows when the 3ema crosses the 6ema above the 50ema
Code:
input price = close;
input fastLength = 10;
input slowLength = 20;
input averageType = AverageType.EXPONENTIAL;
plot FastMA = MovingAverage(averageType, price, fastLength);
plot SlowMA = MovingAverage(averageType, price, slowLength);
FastMA.AssignValueColor(if FastMA > SlowMA then color.green else color.red);
SlowMA.AssignValueColor(if FastMA > SlowMA then color.green else color.red);
plot ArrowDN = if FastMA crosses SlowMA < ema45
then high
else double.nan;
else double.nan;
ArrowDN.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
ArrowDN.SetLineWeight(3);
ArrowDN.SetDefaultColor(Color.Red);