• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Build Volume Ladder for Bid/Ask Volumne of current bar

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

    Build Volume Ladder for Bid/Ask Volumne of current bar

    Hi Ninjatrader team,

    I am trying to build a strategy using Bid/Ask Volume per bar (basically the same thing as Volumetric Bars, but used in a strategy). I saw this as an example of what I am looking for, but this is for Order Book data. Is there a way to gather the actual bid/ask volume for each price in a bar in the same way and put it into a price ladder?

    https://ninjatrader.com/support/help...vel_ii_dat.htm

    Any help is greatly appreciated.

    #2
    Hello Deterministic J, thanks for your post.

    You would want to use the OnMarketData method to accomplish this. OnMarketData will give you a stream of current bid, ask, and last prices along with their volume.

    Best regards.
    Last edited by NinjaTrader_ChrisL; 06-20-2019, 11:57 AM.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply, Chris.

      Am I able to aggregate this in the same way the sample in my post does? Would it not be easier to create a price ladder and use barsType.Volumes[CurrentBar].GetAskVolumeForPrice and barsType.Volumes[CurrentBar].GetBidVolumeForPrice for each price in the bar?

      Comment


        #4
        Hello Deterministic J, thanks for your reply.

        The volumetric bars do not take level 2 data into consideration, only the trades filled at either bid or ask price i.e. level 1 data. You will build your bar on that incoming data. OnMarketData will stream updates and the price type will either be of type bid, ask, or last. You will notice that when a "last" price update comes through, it is either equal to previous bid update or the previous ask update, and the volume of that "last" update will be subtracted from the volume of the respective bid or ask level.

        Since you need to sum and store the volume values at each tick level, you would need to implement something similar to the level2 book sample. You would need to make a custom series, and that series would hold a complex object that can hold A. price data and B. volume data for every bar. The list would hold every tick level that the bar saw while it was being built.

        Please let me know if you have any additional questions.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi Chris,

          Thanks for the idea. Maybe we are misunderstanding each other. I just want to make sure we are on the same page. I only want level 1 data for each tick in a bar. Exactly the same thing that the Volumetric bars output so I can use it in a strategy.

          So for example in the picture below I want to capture:

          2947.25 Bid Volume = 0
          2947.25 Ask Volume = 18
          2947 Bid Volume = 71
          2947 Ask Volume = 221
          2946.75 Bid Volume = 113
          2946.75 Ask Volume = 62

          All bid/ask volume aggregated together on each tick in price then after that bar is closed, reset.


          Would OnMarketData stream still be what I am looking for in order to do this?
          Attached Files
          Last edited by Deterministic J; 06-20-2019, 11:26 AM.

          Comment


            #6
            Hello, thanks for your reply.

            I apologize, it turns out the example I gave does not implement OnMarketData. I will edit that post accordingly.

            One good example of gathering bid-ask volume would be the BuySellVolume indicator. If the last price >= e.ask price, that would be a buy. If the last price <= e.bid price, that would be a sell. The basic overview would be "When I receive a call to OnMarketData, note the price, check if it is a buy or sell, then place the volume of that price level into the series of lists, sort the list by price, repeat the procedure", or something along those lines.

            Also, note that you can add a Volumetric bars type to your strategy right now with AddVolumetric(). Or your primary series on the chart can be Volumetric bars and you can use the example from this page on how to access the data:
            https://ninjatrader.com/support/help...tric_bars2.htm
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by nerverenew0, Today, 10:43 PM
            0 responses
            1 view
            0 likes
            Last Post nerverenew0  
            Started by CandySNK, Today, 10:24 PM
            1 response
            5 views
            0 likes
            Last Post jiva12
            by jiva12
             
            Started by user1986, Today, 07:28 PM
            2 responses
            11 views
            0 likes
            Last Post NinjaTrader_EricB  
            Started by ericson, Today, 08:14 PM
            0 responses
            7 views
            0 likes
            Last Post ericson
            by ericson
             
            Started by jertrade, Today, 06:57 PM
            0 responses
            5 views
            0 likes
            Last Post jertrade  
            Working...
            X