Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Cumulative Delta not giving me expected results

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

    Cumulative Delta not giving me expected results

    What am I missing here? I'm drawing the delta close below the candles here. I've highlighted the most dramatic case, but as you can see here the delta close is not matching the actual indicator. I'm using BarDelta vs Session and BidAsk DeltaType.

    And here is the test indicator code.

    Delta Test. GitHub Gist: instantly share code, notes, and snippets.

    #2
    Hi, thanks for posting.

    The scripts needs to update the Cumulative Delta in the 1 tick series (BarsInProgress == 1), and the Cumulative Delta you have on the chart needs to be set to "Bar".

    Code:
    if (BarsInProgress == 0)
    {
        Draw.Text(this, "close" + CurrentBar, ""+ CD.DeltaClose[0], 0, Low[0] - 30);
    }
    else if (BarsInProgress == 1)
    {
        // We have to update the secondary series of the hosted indicator to make sure the values we get in BarsInProgress == 0 are in sync
        CD.Update(CD.BarsArray[1].Count - 1, 1);
    }
    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Awesome, thanks Chris. This was driving me crazy until I finally broke down and decided to ask.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      4 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      12 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      13 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,982 views
      3 likes
      Last Post jhudas88  
      Working...
      X