Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Use of Cumulative Delta within another indicator

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

    Use of Cumulative Delta within another indicator

    Hi,
    I am trying to create a momentum indicator starting from the Order Flow Cumulative Delta indicator. The indicator code would be:

    CDMomentum = OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[0] - OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).DeltaClose[Period];

    to be applied on e.g. a 5 min bar chart. The issue is that as no tick data are loaded, it does not work and as far as I know I cannot use AddDataSeries in an Indicator script.
    Could you please suggest me how to fix this?

    Thank you
    Martin

    #2
    Hello Martin,

    Thanks for your post.

    AddDataSeries() can be used within a custom NinjaScript indicator.

    To access Order Flow Cumulative Delta indicator values within your custom indicator, you would need to add a 1-tick data series to the script by calling AddDataSeries() in State.Configure.

    Then, check if BarsInProgress == 0 and access your OrderFlowCumulativeDelta() indicator values within that condition. Make sure to also call .Update() on the indicator in BarsInProgress 1 to make sure the values we get in BarsInProgress == 0 are in sync. An example of this could be seen in the sample code on the help guide.

    See the help guide documentation below for more information and sample code.

    OrderFlowCumulativeDelta: https://ninjatrader.com/support/help...orderflowcumul
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    577 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X