I am trying to build a Currency Index. Is there a template available that someone can show me?
Also, i am having problems accessing the correct data from the secondary series with "Open[1][0]"
> So to get this data, i have resorted to using the "BarsArray[1].GetOpen(0));"
> But this is returning a different value to "Open[0]" when i have the same instrument as the Primary series (loaded on chart), and also the secondary series (imported)
> Why am i getting an incorrect value when using BarsArray object?
Thanks,
else if (State == State.Configure)
{
ClearOutputWindow();
AddDataSeries("EURUSD", Data.BarsPeriodType.Minute, 1); //BarsInProgress index = 1 | Close[1][0]
}
}
protected override void OnBarUpdate()
{
//if (Time[0].Hour == 17 && Time[0].Minute == 00)
if (BarsInProgress == 0)
{
Print("Time : " + Time[0]);
Print("Open Series 0 : " + Open[0]);
//Print("Open Series 0 : " + Open[0][0]);//Error : CS0021
Print("BarsArray 0 : " + BarsArray[0].GetOpen(0));
}
if (BarsInProgress == 1)
{
Print("Time : " + Time[0]);
Print("Open Series 1 : " + Open[0]);
// Print("Open Series 1 : " + Open[1][0]); //Error : CS0021
Print("Open Series 1 : " + BarsArray[1].GetOpen(0));
}
}
}
}

Comment