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
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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?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.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by RDTrader16, Today, 10:19 PM
|
0 responses
5 views
0 likes
|
Last Post
by RDTrader16
Today, 10:19 PM
|
||
Started by gemify, 03-08-2023, 08:02 AM
|
9 responses
148 views
0 likes
|
Last Post
by culpepper
Today, 10:14 PM
|
||
Started by elirion, Today, 10:03 PM
|
0 responses
1 view
0 likes
|
Last Post
by elirion
Today, 10:03 PM
|
||
Started by RaddiFX, Today, 09:55 PM
|
0 responses
9 views
0 likes
|
Last Post
by RaddiFX
Today, 09:55 PM
|
||
Started by Trader146, 03-29-2024, 01:22 PM
|
4 responses
27 views
0 likes
|
Last Post
by Trader146
Today, 09:53 PM
|
Comment