Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Check validity of InstrumentName/Access Strategy Name

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

    Check validity of InstrumentName/Access Strategy Name

    Hi Ninja team,

    In NT7 is there a way to check the validity of an instrument name? For example, if an indicator or strategy is expecting user input of an instrument for a second data series?

    Second, is there a way to programatically access the name of a strategy from within that strategy? For example;

    if (something happens)
    {
    PrintWithTimeStamp(MyStrategyName+" halted due to P&L rules");
    }

    Thanks!

    #2
    Hi MXASJ, are you referring to checking if an instrument with this name exists in the database? This is unfortunately not possible.

    For your second request, I believe you could set the Name to a custom string in the Initialize() and then use this to Print it to the output window.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    47 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    23 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    33 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X