when i have following, the bold statement doesnt work, it seems like data from indicator shifts one bar further and currently not evaluating that current close is above previous open
Close[0] > Open[0]
&& && (Deltaclose > Deltaopen) && Deltaclose > Math.Max(DeltaopenPr1, DeltaclosePr1)
Deltaclose [0]= (OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[0]);
DeltaclosePr [0]= (OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[1]);
In my indicator i have following line
{
// We have to update the secondary series of the cached indicator to make sure the values we get in BarsInProgress == 0 are in sync
OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).Update(OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).BarsArray[1].Count - 1, 1);
}
Can someone advice?
IT seems opening correctly in backtesting, but when in market replay its either doesnt open at all or opens not taking cumulative delta into consideration
Update.
On second image delta is 2508, delta close and delta signal close point to the same value but it prints different values in Prints
Below values are from indicactor
if (BarsInProgress == 0)
{
// Print the close of the cumulative delta bar with a delta type of Bid Ask and with a Session period
Print("Delta Signal Close: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[0] + " " + Time[0]);
Print("Delta Signal Open: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaOpen[0] + " " + Time[0]);
Print("Delta Signal High: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaHigh[0] + " " + Time[0]);
Print("Delta Signal Low: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaLow[0] + " " + Time[0]);
Print("-----------------");
Print("Delta Previous Close: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[1] + " " + Time[0]);
Print("Delta Previous Open: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaOpen[1] + " " + Time[0]);
Print("Delta Previous High: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaHigh[1] + " " + Time[0]);
Print("Delta Previous Low: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaLow[1] + " " + Time[0]);
Print("-----------------");
Print("Delta Previous2 Close: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[2] + " " + Time[0]);
Print("Delta Previous2 Open: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaOpen[2] + " " + Time[0]);
Print("Delta Previous2 High: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaHigh[2] + " " + Time[0]);
Print("Delta Previous2 Low: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaLow[2] + " " + Time[0]);
}
else if (BarsInProgress == 3)
{
// We have to update the secondary series of the cached indicator to make sure the values we get in BarsInProgress == 0 are in sync
OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).Update(OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).BarsArray[3].Count - 1, 1);
}
if (BarsInProgress == 0)
{
Deltaclose [0]= (OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[0]);
Deltaopen [0]= (OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaOpen[0]);
Deltahigh [0]= (OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaHigh[0]);
Deltalow [0]= (OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaLow[0]);
Comment