Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add new instrument to Instrument Manager through code

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

    Add new instrument to Instrument Manager through code

    I am backtesting a portfolio from a file of signals.

    The signals for several hundred instruments are in a file that is read into NT. NT identifies the unique instruments and then adds them, i.e. this.Add(WXYZ), in the Initialize() method.

    If the instrument is not already in Instrument Manager, I get ...

    The strategy 'MyStrategy' has called the Add() method with an invalid instrument. Either 'WXYZ does not exist in the Instrument Manager or the specified exchange has not been configured.
    If possible, I would like to handle this in the code by adding the instrument and moving on...

    Can this be done?

    #2
    Hello AnotherTrader,

    Thank you for your post.

    Unfortunately, there are no supported methods or functions to achieve this in NinjaScript. And I am unaware of any unsupported methods as well.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    52 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X