• 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

How to calculate Bid/Ask volume from Last volume + Bid/Ask Offers

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

    How to calculate Bid/Ask volume from Last volume + Bid/Ask Offers

    Hey,

    I am trying to figure out what the process would be to calculate what the Bid/Ask volume traded at each price. We have the following snippet of code which will update whenever the number of available Bids or Offers updates or some quantity of contracts was traded at the Last price. When the Bid or the Ask volume change, this does not necessarily mean any quantity was traded at those prices, it could just be that more Bids or Offers were added or taken away from those prices. :

    protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
    {
    // Print some data to the Output window
    if (marketDataUpdate.MarketDataType == MarketDataType.Last)
    Print(string.Format("Last = {0} {1} ", marketDataUpdate.Price, marketDataUpdate.Volume));
    else if (marketDataUpdate.MarketDataType == MarketDataType.Ask)
    Print(string.Format("Ask = {0} {1} ", marketDataUpdate.Price, marketDataUpdate.Volume));
    else if (marketDataUpdate.MarketDataType == MarketDataType.Bid)
    Print(string.Format("Bid = {0} {1}", marketDataUpdate.Price, marketDataUpdate.Volume));
    }

    If you were to take the above code and add up for the volume for each bar and run it on a 200 tick chart you will notice that the Last quantity broadly adds up to 200 and the Bid and Ask volume is in the thousands. So I am guessing you have to infer the Bid and Ask by perhaps tracking the Delta between consecutive Last updates?

    My question is how do these market footprint indicators infer the numbers at the various levels for the Bid and Ask volume traded?
    Last edited by Nice-Spread; 02-22-2020, 03:05 AM.

    #2
    Hi Nice-Spread, thanks for your post.

    Please see this help guide section on how to access bid and ask prices historically:

    "An example below shows how to access historical Bid and Ask prices with Tick Replay"
    https://ninjatrader.com/support/help...ick_replay.htm

    The standard Volume Profile indicator also shows how to access bid and ask values from OnMarketData when Tick Replay is on.

    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thank you! I remember seeing this page some time ago but must have forgotten about it. I’ll give this a try and see if the accuracy of my volume calculations improve.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by billythekid72, Today, 07:10 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Gav_G, 05-28-2020, 01:23 PM
      3 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jim  
      Started by JustinOfNazareth, Today, 07:22 AM
      0 responses
      1 view
      0 likes
      Last Post JustinOfNazareth  
      Started by Josey, Today, 07:17 AM
      0 responses
      17 views
      0 likes
      Last Post Josey
      by Josey
       
      Started by tgordon78, Today, 07:09 AM
      0 responses
      3 views
      0 likes
      Last Post tgordon78  
      Working...
      X