For instance, start a strategy with futures contract instrument ESU22 and the strategy will change the instrument on rollover date, for example, to ESZ22.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Possible for strategy to change main instrument used
Collapse
X
-
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.Tags: None
-
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?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?Code:EnterShort(int barsInProgressIndex, int quantity, string signalName)
Comment
-
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 Mindset, 04-21-2026, 06:46 AM
|
0 responses
90 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
137 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
120 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
72 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment