Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to get volume at each price level of a historical day bar

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

    How to get volume at each price level of a historical day bar

    Hi

    I would like to get the volume of contracts traded at each price level of a historical day bar. Is there a command like GetVolumeAt[double price] or some other method that accomplishes this? Please give me an idea how this can be achieved. Thanks in advance.

    #2
    Hello mbesha, and thank you for your question.

    Due to the way volume information comes in to NinjaTrader, the situation is slightly complicated. Between bar closings, which is when most NinjaScript strategies execute, volumes change several times.

    There is an indicator that will give you all the information you are looking for. That indicator is the VolumeProfile indicator. You will need to enable TickReplay for this indicator to work properly. I am providing some instructions on doing so.

    Originally posted by http://ninjatrader.com/support/helpGuides/nt8/en-us/?developing_for__tick_replay.htm
    Tick replay MUST be manually enabled on the primary Data Series and the option to allow this mode is hidden by default. The option to allow for Tick Replay is located in Tools > Options > Market Data > "Show Tick Replay"
    After enabling the checkbox, you can then access a chart's Data Series window (ctrl + f) and check the Tick Replay box that now shows.

    I would recommend studying the code for that indicator by opening it up in the NinjaScript editor, while also testing it in a chart with 10 second bars. Once you thoroughly understand this indicator and how it works, being able to access volume and any other MarketData information that occurs intra-bar will be very easy.

    We are happy to help with any questions that come up.
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by mmckinnm, Today, 01:34 PM
    0 responses
    2 views
    0 likes
    Last Post mmckinnm  
    Started by f.saeidi, Today, 01:32 PM
    0 responses
    2 views
    0 likes
    Last Post f.saeidi  
    Started by traderqz, Today, 12:06 AM
    9 responses
    16 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by kevinenergy, 02-17-2023, 12:42 PM
    117 responses
    2,766 views
    1 like
    Last Post jculp
    by jculp
     
    Started by Mongo, Today, 11:05 AM
    5 responses
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X