Announcement

Collapse
No announcement yet.

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.


    ​​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    56 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    133 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X