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

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 Max238, Today, 01:28 AM
      1 response
      22 views
      0 likes
      Last Post CactusMan  
      Started by giulyko00, Yesterday, 12:03 PM
      2 responses
      10 views
      0 likes
      Last Post giulyko00  
      Started by r68cervera, Today, 05:29 AM
      0 responses
      4 views
      0 likes
      Last Post r68cervera  
      Started by geddyisodin, Today, 05:20 AM
      0 responses
      7 views
      0 likes
      Last Post geddyisodin  
      Started by JonesJoker, 04-22-2024, 12:23 PM
      6 responses
      38 views
      0 likes
      Last Post JonesJoker  
      Working...
      X