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 bortz, 11-06-2023, 08:04 AM
      47 responses
      1,603 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      8 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      18 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      4 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      12 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X