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 Radano, 06-10-2021, 01:40 AM
    19 responses
    605 views
    0 likes
    Last Post Radano
    by Radano
     
    Started by KenneGaray, Today, 03:48 AM
    0 responses
    4 views
    0 likes
    Last Post KenneGaray  
    Started by thanajo, 05-04-2021, 02:11 AM
    4 responses
    470 views
    0 likes
    Last Post tradingnasdaqprueba  
    Started by aa731, Today, 02:54 AM
    0 responses
    5 views
    0 likes
    Last Post aa731
    by aa731
     
    Started by Christopher_R, Today, 12:29 AM
    0 responses
    11 views
    0 likes
    Last Post Christopher_R  
    Working...
    X