Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MarketDataEvnArgs or GetCurrentAskVolume

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

    MarketDataEvnArgs or GetCurrentAskVolume

    I am trying to get a running sum of block bid and ask volumes that have actually transpired... i.e. Sum ask volume > 4

    Which is correct to use

    GetCurrentAskVolume()... Is this actual trading volume that has transpired or is this the volume currently being offered at the asking price?

    Or

    OnMarketData

    protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)

    if (marketDataUpdate.MarketDataType == MarketDataT ype.Ask)
    Print("Ask = " + marketDataUpdate.Price + " " + marketDataUpdate.Volume);


    Under OnMarketData() The help guide says this method does not return a value


    Method Return Value
    This method does not return a value.

    Although the page under MarketDataEvnArs indicates it returns a double value


    Thank you for clarifying


    #2
    Hello sdauteuil,

    These essentionally would be the same.

    GetCurrentAskVolume() gets the snapshot volume of the most recent ask update at the time it's requested.

    OnMarketData()'s argument.Volume is that same data, but from every update, processed in order, instead of just when requested.

    OnMarketData does not return a value. This is a void. The argument (marketDataUpdate) has the data. If you need this outside of OnMarketData, then you would need to save that information to a variable or array.

    Some of the argument properties are doubles like .Ask and .Bid and some are longs like .Volume. Some properties are bools like .IsReset or instruments like .Instrument. The arugument and the arguments properties are not returned, as you cannot call OnMarketData() yourself as a calling method. NinjaTrader calls OnMarketData() and provides the data to the argument.
    https://ninjatrader.com/support/help...aeventargs.htm
    Last edited by NinjaTrader_ChelseaB; 04-11-2021, 05:12 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the clarification

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      127 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X