Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

bars.Instrument.MasterInstrument.FundamentalData.AverageDailyVolume in onDataPoint

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

    bars.Instrument.MasterInstrument.FundamentalData.AverageDailyVolume in onDataPoint

    Hi,
    I am testing to get average daily volume in a bar type via bars.Instrument.MasterInstrument.FundamentalData.A verageDailyVolume.Value
    but it's .HasValue = false all the time, even if I waited to go to the next day... Is this being set/used by the framework?

    How about: bars.Instrument.MarketData.DailyVolume.Volume - even checking it for != null throws an exception:
    2022-05-16 18:57:43:427|3|4|Failed to call 'Add' method: System.NullReferenceException: Object reference not set to an instance of an object.
    at NinjaTrader.NinjaScript.BarsTypes.AvRenko.OnDataPo int(Bars bars, Double open, Double high, Double low, Double close, DateTime time, Int64 volume, Boolean isBar, Double bid, Double ask)
    at NinjaTrader.Data.BarsSeries.Add(Bars bars, Double open, Double high, Double low, Double close, DateTime time, Int64 volume, Double tickSize, Boolean isBar, Double bid, Double ask)

    Are any of these objects set by the framework?

    #2
    Hello momchi,

    That specific property may be used internally for instrument subscriptions, the AverageDailyVolume is part of the fundamental data which would not be handled by a BarsType. That could be used in an indicator or addon


    From OnDataPoint you would have to accumulate volume and then use math to create an average for the given period of time if you wanted to recreate that type of value.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sjsj2732, Today, 04:31 AM
    0 responses
    20 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    280 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    279 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    130 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    90 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X