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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        238 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        154 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        163 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        246 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        199 views
        0 likes
        Last Post CarlTrading  
        Working...
        X