Accessing the Bid and Ask Contracts at specific price levels

I am researching a NinjaScript project and would like to confirm what is possible before starting development.

My primary chart uses a custom Renko BarsType.

I am considering adding a secondary 1-tick volumetric data series using AddVolumetric().

My goal is to determine whether I can access bid volume and ask volume at a specific price level from NinjaScript, independent of the primary bar type.

Example:

  1. A custom Renko bar forms a swing high at a price of 45250.

  2. I want to query the volumetric data and retrieve:

    • Bid volume at 45250

    • Ask volume at 45250

Specifically, I would like to know:

  1. Can a custom NinjaScript indicator or strategy access bid/ask volume at an individual price level through a secondary volumetric series?

  2. Can GetBidVolumeForPrice() and GetAskVolumeForPrice() be used when the primary series is a custom Renko BarsType and the volumetric series is added as a secondary data series?

  3. Is there a recommended way to locate which volumetric bar contains a given price/time event from the primary series?

  4. Are there any limitations when using a custom BarsType together with a secondary volumetric series?

  5. Is Tick Replay required for this type of access, or can volumetric price-level data be accessed without Tick Replay?

I am not looking to calculate volume profiles or footprints. I only need to query bid and ask volume at specific prices from NinjaScript.

Any guidance on the recommended architecture would be appreciated.

1 Like

Yes you can access bid volume and ask volume at a specific price level from NinjaScript. Search for this in the ninjatrader documentation. I’ve built numerous types of this in custom bar types like ninzarenko.


These are ninzarenko bars (custom bar type)

2 Likes

Thank you for your quick reply. I’m looking to use a custom Renko bar, as in your screenshot. Did you use a 1 tick volumetric data series? And if so, is this reliable for pulling the bid/ask volume? Thanks again for your time.

Maybe have a look at OnMarketDepth(MarketDepthEventArgs e)?
Provides depth information for all price levels independently of what bars type is on the chart.

the 1-tick series can pull bid/ask stamps, but on custom Renko bars it did not produce identical results to the OnMarketData tick replay path, I want absolute accuracy with historicals so I opt for this method.

Now it all depends on your accuracy requirements, but for a footprint where every price level counts, tick replay and onMarketData was more reliable and accurate.

Might be a help: onMarketData() vs OnBarUpdate() - NinjaTrader Support Forum

Also, you can use one of the AI tools to search the whole of the past forum and sort things out real quick.

Another person here @ fc77 built something like you’re looking for without the need for tick replay, you might want to give that person a shout

Thank you guys this helps tremendously