I am unable to retrieve the values of the heikenAshi8 indicator.
I keep getting an array index error. I don't see where I'm going wrong. I'm having trouble understanding bar indexes.
My code is :
namespace NinjaTrader.NinjaScript.Indicators.JIT
{
public class JITAlertsArrows : Indicator
{
private HeikenAshi8 HA;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"";
Name = "testonha";
Calculate = Calculate.OnEachTick;
IsOverlay = true;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = false;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
IsSuspendedWhileInactive = false;
BarsRequiredToPlot = 1;
}
else if (State == State.DataLoaded)
{
HA = HeikenAshi8();
}
}
protected override void OnBarUpdate()
{
Print("0 = "+HA.HAClose[0]);
Print("1 = "+HA.HAClose[1]);
Print("2 = "+HA.HAClose[2]);
}
Thanks for your hel

Comment