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 f.saeidi, Today, 12:14 PM
    4 responses
    11 views
    0 likes
    Last Post f.saeidi  
    Started by Russ Moreland, Today, 12:54 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by philmg, Today, 12:55 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by TradeForge, 04-19-2024, 02:09 AM
    2 responses
    32 views
    0 likes
    Last Post TradeForge  
    Started by aprilfool, 12-03-2022, 03:01 PM
    3 responses
    329 views
    0 likes
    Last Post NinjaTrader_Adrian  
    Working...
    X