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 benmarkal, Yesterday, 12:52 PM
      3 responses
      22 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by helpwanted, Today, 03:06 AM
      1 response
      18 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      11 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      6 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      244 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Working...
      X