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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X