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, 05: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 WHICKED, Yesterday, 11:12 PM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_Jim  
      Started by Christopher Leggit, Today, 01:54 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by bojim, Yesterday, 08:35 PM
      2 responses
      15 views
      0 likes
      Last Post bojim
      by bojim
       
      Started by tminusten.0, Today, 02:33 AM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by Thomas79, Today, 02:26 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Jim  
      Working...
      X