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 zstheorist, Today, 07:52 PM
        0 responses
        3 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Working...
        X