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

Interpreting "GetCurrentAskVolume(0)" and "BuySellVolume().Buys[0]"

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

    Interpreting "GetCurrentAskVolume(0)" and "BuySellVolume().Buys[0]"

    I'd like to clarify in my own language what I believe these indicators to represent. I'm looking for confirmation or correction.

    Let's assume my strategy updates with each tick. My understanding is as follows:

    When I get a result for "GetCurrentAskVolume(0)" it represents the exhange's reported volume of shares/contracts offered at the Ask price at the instant my computer make its 1 tick pass through the code. It's an instant snapshot. During the course of the single tick the volume figure can and does change, but the intial snapshot is what I've got because the strategy is only updated once per tick.

    When I get a result for "BuySellVolume().Buys[0]" I'm no longer dealing with shares/contracts offerred. We're talking actual transactions reported AT AND ABOVE the Ask price at the instant of the snapshot. No unfilled orders are included in the "BuySellVolume().Buys[0]" result. As is the case with "GetCurrentAskVolume(0)", the figure can and does change during the course of the tick, but we don't have supercomputers scanning code every nanosecond, so our strategies work with the once-per tick snapshot.

    Have I got the basic picture? If not, please set me straight. Thanks.


    #2
    Hello Doctor JR,

    Thanks for your post.

    Your understanding seems to be correct.

    To clarify, the most granular interval that a strategy can process OnBarUpdate() logic is by using Calculate.OnEachTick. This will allow the script to process OnBarUpdate() logic for each incoming tick that occurs.

    Calculate: https://ninjatrader.com/support/help.../calculate.htm

    GetCurrentAskVolume() would get the current real-time ask volume for each incoming tick when using Calculate.OnEachTick. Note that when accessed during State.Historical, the Volume of the evaluated bar series is substituted. To access historical Ask Volumes, please see Developing for Tick Replay.

    GetCurrentAskVolume(): https://ninjatrader.com/support/help...taskvolume.htm

    BuySellVolume().Buys[0] from would return the real-time buy volume from the BuySellVolume indicator's histogram for each incoming tick when using Calculate.OnEachTick. Trades are categorized in real-time as a buy (at the ask or above) or as a sell (at the bid or below). Trades in between the market are ignored.

    BuySellVolume(): https://ninjatrader.com/support/help...sellvolume.htm

    Please let me know if I may assist further.


    ​​
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    24 views
    0 likes
    Last Post algospoke  
    Started by ghoul, Today, 06:02 PM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    46 views
    0 likes
    Last Post jeronymite  
    Started by Barry Milan, Yesterday, 10:35 PM
    7 responses
    23 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by AttiM, 02-14-2024, 05:20 PM
    10 responses
    181 views
    0 likes
    Last Post jeronymite  
    Working...
    X