Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Feature Request - Delta of a bar

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

    Feature Request - Delta of a bar

    Hi Support,

    I request you to add a feature,where in, buyvolume of a bar can be accessed like buyvolume[0],buyvolume[1],buyvolume[2],..etc

    and sellvolume of a bar can be accessed like sellvolume[0],sellvolume[1],sellvolume[2],..etc

    and delta ( (buyvolume - sellvolume) of a particular bar) of a bar can be accessed like,..delta[0],delta[1],delta[2]

    Thanks
    Commodity_trader

    #2
    Thanks for your suggestion. We do have plans for NT7 to introduce historical bid/ask data which likely can be manipulated to get what you need.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks Ray.

      In NT 6.5 version is there any simple way to get delta of a bar by coding it? I saw a few threads on this,but they weren't calculating delta of a bar accurately. Below is the code, I came up with after looking/modifying at a few threads trying to achieve similar thing. I modified it slightly to get delta directly,but still appears there are missing things or the "OnMarketData" is not working properly.


      protected override void OnMarketData(MarketDataEventArgs e)
      {
      if (e.MarketDataType != MarketDataType.Last || e.MarketData.Ask == null || e.MarketData.Bid == null)
      return;

      if (e.MarketDataType == MarketDataType.Ask)
      delta += e.Volume;
      else if (e.MarketDataType == MarketDataType.Bid)
      delta -= e.Volume;
      }


      Do you see any obvious thing missing here?

      Thanks
      Commodity_trader

      Comment


        #4
        Are you looking for a running total of +- last traded volume relative to bid/ask price? If yes, what you are doing is for sure not going to accomplish that. What you are doing is add/subtracting current ask/bid size.

        If you want to do what I think you want to do -

        - Create bid/ask price variables outside of OnMarketData()
        - Monitor OnMarketData() to update these variables
        - Monitor OnMarketData() for the last price event and compare this price to the variables to determine whether to add/subtract from delta
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        155 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        307 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        244 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        346 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        176 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X