Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cumulative delta

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Cumulative delta

    I have used below code to get cumulative delta candle close of current candle and open and close of previous one


    double delclose0 = OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[0];
    double delclose1 = OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[1];
    double delopen1 = OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaOpen[1];
    Print("Deltaclose0" + delclose0);
    Print("Deltaclose1" + delclose1);
    Print("Deltaopen0" + delopen1);



    after printing output i'm completely getting different values
    hope above code is correct

    #2
    Hello siddhugaddi,

    The script must have a 1 tick series added and must update the indicator when that series is updating.

    See the example in the help guide.
    Code:
    // A 1 tick data series must be added to the OnStateChange() as this indicator runs off of tick data
    else if (State == State.Configure)
    {
    AddDataSeries(Data.BarsPeriodType.Tick, 1);
    }
    
    
    // OnBarUpdate() logic
    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 Close: " + OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[0]);
    }
    else if (BarsInProgress == 1)
    {
    // 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);
    }

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank You will check and give you the update
      Last edited by siddhugaddi; 09-17-2024, 11:25 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X