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

Additional Data Serie not working in Strategy Analyzer

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

    Additional Data Serie not working in Strategy Analyzer

    Hi guys!

    My strategy uses a secondary data serie (Heiken-Ashi). However, this data serie does not seem to be supported in the strategy analyzer:
    Code:
    else if (State == State.Configure)
    {
    
    // Trading hours template
    string tradeHours = "Default 24 x 7";
    
    // Data series
    AddHeikenAshi(Instrument.FullName, BarsPeriodType.Minute, 1, MarketDataType.Last, tradeHours, false); // BarsInProgress = 1
    
    }
    gives an error of "Error on calling 'OnStateChange' method: Object reference not set to an instance of an object." in the strategy Analyzer. However it works fine in a regular chart. If I change this Heiken-Ashi Data Serie for a 1-minute candles chart, it works in the strategy analyzer.

    Thanks!

    edit: it works in Backtest mode, but not in the Optimization mode which is the one I want.
    Last edited by RT001; 11-28-2021, 06:11 PM.

    #2
    Hello RT001,

    You cannot use Instrument.FullName (or any other data series information) in an AddDataSeries() method like AddHeikenAshi.

    You can use null for the instrument and this will default to the primary series instrument.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      OMG this is awesome!! It works very well now! Many thanks : )

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by junkone, Today, 11:37 AM
      0 responses
      2 views
      0 likes
      Last Post junkone
      by junkone
       
      Started by quantismo, 04-17-2024, 05:13 PM
      5 responses
      34 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by proptrade13, Today, 11:06 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by love2code2trade, 04-17-2024, 01:45 PM
      4 responses
      34 views
      0 likes
      Last Post love2code2trade  
      Started by cls71, Today, 04:45 AM
      2 responses
      10 views
      0 likes
      Last Post eDanny
      by eDanny
       
      Working...
      X