protected override void Initialize()
{
Overlay = false;
Add(PeriodType.Tick, 1);
CalculateOnBarClose = false;
Add(new Plot(Color.FromKnownColor(KnownColor.Transparent), PlotStyle.Square, "EntryPrice"));
Add(new Plot(Color.FromKnownColor(KnownColor.Transparent), PlotStyle.Square, "ExitTime"));
Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "WinPercentage"));
addedTime = (10000 * hours) + (100 * minutes) + (1 * seconds);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (BarsInProgress == 0)
{
if (CurrentBar < 20) return;
--------> Print(ToTime(Times[1][0])); <--------
if (FirstTickOfBar
&& BarsInProgress == 0)
{
inTrade = false;
EntryPrice.Set(0);
ExitTime.Set(0);
}
I've placed it everywhere in this program and it always throws the same exception.
On a second note, Times[0][0] works for the primary data series, and Time[0] works for both of them if it's outside of if (BarsInProgress == 0).

Comment