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 AaronKoRn, Today, 09:49 PM
        0 responses
        11 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Today, 08:42 PM
        0 responses
        10 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Today, 07:51 PM
        0 responses
        11 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,980 views
        3 likes
        Last Post jhudas88  
        Started by rbeckmann05, Today, 06:48 PM
        0 responses
        9 views
        0 likes
        Last Post rbeckmann05  
        Working...
        X