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

    https://ninjatrader.com/support/help...aeventargs.htm
    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 wooofad, 06-15-2020, 01:08 PM
      8 responses
      91 views
      0 likes
      Last Post echoxray  
      Started by bubblegum, Today, 12:00 AM
      0 responses
      1 view
      0 likes
      Last Post bubblegum  
      Started by eseorvuda, Yesterday, 10:28 PM
      0 responses
      1 view
      0 likes
      Last Post eseorvuda  
      Started by ctrent, Yesterday, 09:58 PM
      0 responses
      4 views
      0 likes
      Last Post ctrent
      by ctrent
       
      Started by cxbnbvc, Yesterday, 09:25 PM
      0 responses
      2 views
      0 likes
      Last Post cxbnbvc
      by cxbnbvc
       
      Working...
      X