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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    47 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    15 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X