After reading the documentation I am left a little confused. This is what I have, simplified:
private OrderFlowCumulativeDelta cumulativeDelta1; private OrderFlowCumulativeDelta cumulativeDelta2;
if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Tick, 1);
AddDataSeries(Data.BarsPeriodType.Minute, 3);
AddDataSeries(Data.BarsPeriodType.Minute, 5);
}
if (State == State.DataLoaded)
{
cumulativeDelta1 = OrderFlowCumulativeDelta(Closes[2], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0);
cumulativeDelta2 = OrderFlowCumulativeDelta(Closes[3], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0);
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 0) // my 1 minute chart?
{
// I do not want to do anything here(?)
}
else if (BarsInProgress == 2) // my 3 minute chart?
{
// I want to get the cumulative delta of the 3 minute chart. is that here?
Print("Delta1 Close: " + cumulativeDelta1.DeltaClose[0]);
}
else if (BarsInProgress == 3) // my 5 minute chart?
{
// I want to get the cumulative delta of the 5 minute chart. is that here?
Print("Delta2 Close: " + cumulativeDelta2.DeltaClose[0]);
}
}
And what's going on in your example where this happens. Do I need to do it twice? And if so, where?
cumulativeDelta1.Update(cumulativeDelta1.BarsArray[1].Count - 1, 1); cumulativeDelta2.Update(cumulativeDelta2.BarsArray[1].Count - 1, 1);
My goal is to be able to use both Cumulative Delta's to make a decision:
if(
cumulativeDelta1 > ABC
cumulativeDelta2 > XYZ
) {
// do something
}
Phil

Comment