Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Best practice to get Bar Delta Average

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

    Best practice to get Bar Delta Average

    Hello,

    I'm trying to get an average of the last 5 max negative delta from the previous 5 bars.
    barsType.Volumes[CurrentBar].GetMaximumNegativeDelta();
    Tried adding SMA to the current bar but it doesn't work.
    Is there a way to calculate it properly?

    Thank you
    Nadav

    #2
    Hello Nadav,

    Thanks for your post.

    You could consider creating a custom Series<double> variable named something like MaxNegDelta and saving the .GetMaximumNegativeDelta() value to the custom MaxNegDelta series.

    Then pass in the MaxNegDelta Series in for the Series<double> input parameter when calling SMA() and pass in a period parameter of 5.

    See the help guide documentation below for more information.

    Creating Custom Series<double> Variables: https://ninjatrader.com/support/help...t8/seriest.htm
    VolumetricBars: https://ninjatrader.com/support/help...tric_bars2.htm
    SMA: https://ninjatrader.com/support/help...simple_sma.htm
    <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


      #3
      Hello Nadav,

      This does not provide a series that can be supplied to an indicator.

      An average would be all of the values added together then divided by the number of values.

      private double myValue;

      if (CurrentBar > 4)
      {
      myValue = ( barsType.Volumes[CurrentBar].GetMaximumNegativeDelta() + barsType.Volumes[CurrentBar - 1].GetMaximumNegativeDelta() + barsType.Volumes[CurrentBar - 2].GetMaximumNegativeDelta() + barsType.Volumes[CurrentBar - 3].GetMaximumNegativeDelta() + barsType.Volumes[CurrentBar - 4].GetMaximumNegativeDelta() ) / 5;
      }
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Thank you!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 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