I need supporting with correct sintax to get order flow parameters from dataseries (for instance: BarDelta).
I tried something like below but I receive some erros related "barsType" declaration:
private long DeltaOfPreviousBar1
private long DeltaOfPreviousBar2
if (State == State.Configure)
{
AddVolumetric("CL 06-23", BarsPeriodType.Minute, 5, VolumetricDeltaType.BidAsk, 1);
AddVolumetric("CL 09-23", BarsPeriodType.Minute, 5, VolumetricDeltaType.BidAsk, 1);
}
protected override void OnBarUpdate()
{
if (State == State.Historical)
return;
if(BarsInProgress == 0)
{
NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = Bars.BarsSeries.BarsType as
NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
// my code here
}
if (Bars == null)
return;
if (barsType == null)
return;
if(BarsInProgress == 1)
{
NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = BarsArray[1].BarsType as
NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
DeltaOfPreviousBar1 = barsType.Volumes[Current].BarDelta;
}
if(BarsInProgress == 2)
{
NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = BarsArray[2].BarsType as
NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
DeltaOfPreviousBar2 = barsType.Volumes[Current].BarDelta;
}
}

Comment