I am working with 1 tick secondary dataseries and i am getting incorrect bars reported. A trimmed down version of my indicator:
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
IsChartOnly = true;
IsOverlay = true;
DisplayInDataBox = false;
DrawOnPricePanel = true;
IsSuspendedWhileInactive = false;
Calculate = Calculate.OnEachTick;
MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
BarsRequiredToPlot = 0;
}
else if (State == State.Configure)
{
// Other modes not supported.
Calculate = Calculate.OnEachTick;
AddDataSeries(Instrument.FullName, BarsPeriodType.Tick, 1, MarketDataType.Last);
}
}
#endregion
protected override void OnBarUpdate()
{
if (CurrentBars[0] < BarsRequiredToPlot || CurrentBars[1] < BarsRequiredToPlot)
return;
var barTime = Time[0].ToString("yyyy-MM-dd HH:mm:ss.ffffff");
Print((BarsInProgress == 0 ? "BARS" : "TICK") + $" BARS={CurrentBars[0]} TICK={CurrentBars[1]} TIME={barTime} CLOSE={Close[0]} VOL={Volume[0]}");
}
If this is a bug, it seems to be quite a major one. Or maybe this is my fault somehow? Does anyone encounter anything like this? Is there any known workaround maybe?

Comment