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 NullPointStrategies, Today, 05:17 AM
|
0 responses
52 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
70 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
43 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
48 views
0 likes
|
Last Post
|

Comment