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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X