Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible for strategy to change main instrument used

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

    Possible for strategy to change main instrument used

    Mostly, NT works by taking a chart with a loaded instrument and applying a strategy or indicator to it. Is it possible for a strategy, by itself, to replace the loaded instrument with another instrument?

    For instance, start a strategy with futures contract instrument ESU22 and the strategy will change the instrument on rollover date, for example, to ESZ22.

    #2
    Hello bfalls,

    That would not be possible by using any supported code, that would also restart the strategy assuming the instrument is changed in a chart where the strategy is applied.

    Comment


      #3
      Thanks. Actually, thinking about it, I should be able to load another instrument as a series, and base the strategy on that particular series to make trading decisions; but can the strategy make trades on the secondary loaded instrument instead of the main instrument loaded in the chart?
      Code:
      EnterShort(int barsInProgressIndex, int quantity, string signalName)
      I'm thinking the strategy should be able to reload the secondary instrument with a different instrument while the strategy keeps running. There may be limitations like no open orders using that instrument. All I see for supporting multi-instrument strategies is AddDataSeries but I don't see DeleteDataSeries or any management functions to manage the instrument objects. Any ideas along these lines?

      Comment


        #4
        Hello bfalls,

        You can place trades to secondary series, you would use the entry methods that have BarsInProgress. A secondary series would be bars in progress 1.

        AddDataSeries is not something which can be dynamic, that requires hard coding the instrument and is not something which can change again without reloading the strategy. That is part of the strategies startup and defines how the functions like OnBarUpdate will run when the script is active.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        51 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        127 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X