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 Thomas79, Today, 02:03 PM
      0 responses
      6 views
      0 likes
      Last Post Thomas79  
      Started by Mirasol, Today, 11:32 AM
      2 responses
      19 views
      0 likes
      Last Post Mirasol
      by Mirasol
       
      Started by Scalper1969, 10-09-2024, 10:37 AM
      13 responses
      46 views
      0 likes
      Last Post Scalper1969  
      Started by MikM45, 10-12-2024, 01:12 PM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by CDXTrader, Today, 01:46 PM
      0 responses
      8 views
      0 likes
      Last Post CDXTrader  
      Working...
      X