Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error reflecting property 'MarketDataUpdate'

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

    Error reflecting property 'MarketDataUpdate'

    I am getting an error when running a strategy.

    The strategy is actually broken into a base strategy:

    public abstract class TradeBase : Strategy, INotifyPropertyChanged

    ... and a strategy calling the base....

    ​ public class StrategyExample : TradeBase

    Everything works fine (I have been using this for months). I tried to add a secondary data series to the base (same instrument, different time frame) and when I try to execute I get the following error:


    There was an error reflecting type 'NinjaTrader.NinjaScript.Strategies.xxxxxxxx'. ---> System.InvalidOperationException: There was an error reflecting property 'MarketDataUpdate'. ---> System.InvalidOperationException: There was an error reflecting type 'NinjaTrader.Data.MarketDataEventArgs'. ---> System.InvalidOperationException: There was an error reflecting property 'Instrument'. ---> System.InvalidOperationException: There was an error reflecting type 'NinjaTrader.Cbi.Instrument'. ---> System.InvalidOperationException: Cannot serialize member 'NinjaTrader.Cbi.Instrument.HistoricalData' of type 'NinjaTrader.Data.BarsBytes[]

    Do all the data series need to be defined in StrategyExample or is there another way to address this?

    #2
    Hello kenconcannon,

    Custom inheritance is not supported in NinjaScript so that is not something we can assist with. While you can use that C# feature it may cause problems with various parts of the platform. We suggest to only use the standard inheritance that the platform creates such as public class MyStrategy : Strategy

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    77 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X