Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to detect what instrument the strategy is on?

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

    how to detect what instrument the strategy is on?

    i was wondering how to detect what instrument the strategy is currently on, and have it only work on certain ones. Example: I want my strategy to only run on ES, so if it is on something else it wont run and will display an error message.

    #2
    Hello Laces2,

    You can see information for the instrument class below:


    Unfortunately we don't provide support for restricting the instrument that the strategy is run against. Instrument selection happens in the GUI, before running the core strategy logic. You may be able to check for this in the strategy OnBarUpdate(), but there's no way to prevent selecting other instruments in the GUI.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Max238, Today, 01:28 AM
    4 responses
    33 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by r68cervera, Today, 05:29 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by geddyisodin, Today, 05:20 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by timko, Today, 06:45 AM
    2 responses
    13 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by habeebft, Today, 07:27 AM
    0 responses
    6 views
    0 likes
    Last Post habeebft  
    Working...
    X