I made a very simple double EMA indicator and am attempting to have it draw arrows upon a crossover. The following freezes and shuts me down every time. It works fine without the Arrow code:
protected override void OnBarUpdate()
{
fastEma.Set(CurrentBar == 0 ? Input[0] : Input[0] * 2.0 / (1 + Fast) + (1 - (2.0 / (1 + Fast))) * fastEma[1]);
slowEma.Set(CurrentBar == 0 ? Input[0] : Input[0] * 2.0 / (1 + Slow) + (1 - (2.0 / (1 + Slow))) * slowEma[1]);
double FastEMA = fastEma[0];
double SlowEMA = slowEma[0];
FastEma.Set(FastEMA);
SlowEma.Set(SlowEMA);
if(CrossAbove(RaiderEMACross(Close, 12, 26).FastEma, RaiderEMACross(Close, 12, 26).SlowEma, 1));
{
DrawArrowUp("CurrentBar", 0, RaiderEMACross(Close, fast, slow)[0] - 1, Color.Lime);
}
}

Comment