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
How can Ninjascript AddDataSeries reference a symbol universally
Collapse
X
-
How can Ninjascript AddDataSeries reference a symbol universally
How do I code Ninjascript AddDataSeries to reference a symbol without referencing its expiration date so it rolls over without code change.Tags: None
-
Hello ProfitPilgrim,
Thanks for your post.
You can use an overload that does not use a string to describe the instrument name, or you can use null for the instrument name to use the instrument of the primary data series. This is noted in the Warnings section of the AddDataSeries documentation page. I've requested that this gets moved to Tips so it is easier to find.
Publicly available AddDataSeries documentation can be found here - https://ninjatrader.com/support/help...dataseries.htm
If you are adding additional data series of other futures contracts, the full expiry must be used.
Please let me know if you have any additional questions.JimNinjaTrader Customer Service
-
Thanks Jim. Do I correctly understand that whenever the rollover date of added symbols in accustom indicator is reached, the indicator will stop working correctly until the code is modified, effectively every 1 to 3 months? As a vendor, that is awkward for clients leasing as they will all have to be updated with new code whenever added symbols rollover. Is there an alternative?
Comment
-
Hello ProfitPilgrim,
If "null" is passed as the instrument name, it will grab the instrument of the primary data series. The client should only have to hit the Rollover button to rollover and load the new front month. Once the chart is reloaded with the new front month, each NinjaScript will then be reloaded. Since the primary data series is updated and the script calls AddDataSeries(null, Data.BarsPeriodType.Minute, 5); or similar, the newly rollover Contract month will be used. You should not have to perform any additional work to update the script for the client.
Let me know if there is anything else I can do to help.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by traderqz, Today, 12:06 AM
|
10 responses
17 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
5 responses
46 views
0 likes
|
Last Post Today, 02:36 PM | ||
Started by arvidvanstaey, Today, 02:19 PM
|
1 response
4 views
0 likes
|
Last Post Today, 02:33 PM | ||
Started by mmckinnm, Today, 01:34 PM
|
3 responses
5 views
0 likes
|
Last Post Today, 02:12 PM | ||
Started by f.saeidi, Today, 01:32 PM
|
2 responses
8 views
0 likes
|
Last Post
by f.saeidi
Today, 02:10 PM
|
Comment