Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddRenko() instrument name in Strategy Analyzer Optimization

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

    AddRenko() instrument name in Strategy Analyzer Optimization

    Hello, I have created a strategy that adds a renko data series to to the OnStateChange() method in the State.Configure block as shown below

    AddRenko(this.Instrument.FullName, 3, MarketDataType.Last);

    When running optimizer in the Strategy Analyzer the follow error occurs:

    "Error on calling 'OnStateChange' method: Object reference not set to an instance of an object."

    It appears that "this.Instrument.FullName" only works during the first iteration in optimizer but is null after. When hard coding the contract in place it works. Is this a bug or expected?

    #2
    Hello mvdn73,

    Thank you for your note.

    You should hardcode the instrument in your AddRenko call, as this.Instrument.FullName is not guaranteed to be known.

    At the following link, see the 3rd warning.



    I will add your vote to the feature request which covers dynamically adding data series.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    30 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    124 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    64 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X