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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      133 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X