: "10/26/2011 10:51:17 PM Default Error on calling 'OnBarUpdate' method for indicator 'WForEntry' on bar 0: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart. "
CODE: WForEntry - using 5 min tick bars
protected override void Initialize()
{
//Add Comparison Product
Add(ComparisonProduct, PeriodType.Minute, TimePeriod);
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "WForEntryPlot"));
Overlay = false;
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 0)
{
if(HIdentified(comparisonProduct,5)[0] == 1)
{
WForEntryPlot.Set(Lows[0][1] - 1 * TickMultiplier);
dataSetTime = Time[0];
}
else if ((LIdentified(comparisonProduct, 5).Count > 0)&& (LIdentified(comparisonProduct, 5)[0] == 1))
{
WForEntryPlot.Set(Highs[0][1] + 1 * TickMultiplier);
dataSetTime = Time[0];
}
if(dataSetTime != Time[0])
{
WForEntryPlot.Set(0);
}
}
}
Comment