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 AlessioCianini12, Today, 01:55 PM
      0 responses
      2 views
      0 likes
      Last Post AlessioCianini12  
      Started by rajneesh.sehgal, Today, 12:06 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by mo_fi, 01-21-2021, 10:08 PM
      22 responses
      1,313 views
      0 likes
      Last Post Wessel
      by Wessel
       
      Started by ezrollin, 01-12-2022, 03:43 PM
      2 responses
      38 views
      0 likes
      Last Post iq200
      by iq200
       
      Started by Red_70, Today, 11:07 AM
      3 responses
      16 views
      0 likes
      Last Post Red_70
      by Red_70
       
      Working...
      X