Is there a way to programatically detect how many series are active on a chart, the instruments and their times and types? For example, suppose I create a chart with 5 min ES candlestick chart (primary series), a 1000V HiLo bar chart of ES, and a 500 Tick Box chart of NQ. Can I retieve this info programatically? Thanks for any suggestions.
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
Multi Series Programming
Collapse
X
-
Multi Series Programming
Hi,
Is there a way to programatically detect how many series are active on a chart, the instruments and their times and types? For example, suppose I create a chart with 5 min ES candlestick chart (primary series), a 1000V HiLo bar chart of ES, and a 500 Tick Box chart of NQ. Can I retieve this info programatically? Thanks for any suggestions.Tags: None
-
Hello Zeos6,
Yes, you can do so using the unsupported ChartControl class.
Code:ChartControl.BarsArray[0]; //returns the primary series ChartControl.BarsArray[1]; //returns the secondary series
JoydeepNinjaTrader Customer Service
-
Hi Joydeep,
Thank you. I am aware of those ChartControl objects. It provides more info than I need, but the chart type has to be obtained separately. I simply thought there might be a cleaner way to get this info.
However, is there any way to determine how many data series are present?
Thank you.
Comment
-
Hi Joydeep,
One additional issue came up for me. When you have a multi data series chart and add an indicator, say an EMA, you can add the indicator for each of the data series in the chart - there is an Input Data Series option in the indicator parameters.
1. Is there a way to create an Input Data Series input variable parameter for use in custom code so that the code will only run on that data series in a multi data series environment?
2. Give a data series in a multi data seies chart, is there a way to determine its BarrsArray[Index] value?
Any help would be greatly appreciated. Thank you.
Comment
-
Hi Joydeep,
The issue is as follows:
Some of the indicators, for example EMA, allow you to specify the input series to be used with that indicator. How can I specify the input series to be used with a custom indicator and get the BarsArray index of that input series for use in a multi data series/mullti instrument chart?
Based on the EMA code it would appear that the Input series input indicator parameter is linked to the Value data series objects. Is that correct?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by helpwanted, Today, 03:06 AM
|
1 response
16 views
0 likes
|
Last Post Today, 03:35 AM | ||
Started by Brevo, Today, 01:45 AM
|
0 responses
11 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by aussugardefender, Today, 01:07 AM
|
0 responses
6 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
244 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
387 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
Comment