I am trying to write code on the bar update that will only be hit when the larger, indicator added bars close, not the smaller candle from the chart. Is there any way to do this?
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
multiple data series bar update ?
Collapse
X
-
multiple data series bar update ?
so i have an indicator with multiple data series, i have the chart data series, and I add in 2 larger candle data series in the indicator.
I am trying to write code on the bar update that will only be hit when the larger, indicator added bars close, not the smaller candle from the chart. Is there any way to do this?Tags: None
-
Hello ErikY,
Thank you for your reply.
Yes, you can check the BarsInProgress value of the series that is currently iterating through OnBarUpdate and only execute code if it is currently on a specific series.
For example, if we have a primary data series of one minute, and we add two secondary series, a 5 and a 15 minute like below:
Code:AddDataSeries(BarsPeriodType.Minute, 5); AddDataSeries(BarsPeriodType.Minute, 15);
Code://within OnBarUpdate if (BarsInProgress == 0) { // code in here will only be executed when the 1 minute series is processing in OnBarUpdate } else if (BarsInProgress == 1) { // code in here will only be executed when the 5 minute series is processing } else if (BarsInProgress == 2) { // code in here will only be executed when the 15 minute series is processing }
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
- Likes 1
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by geotrades1, Today, 10:02 AM
|
1 response
4 views
0 likes
|
Last Post Today, 10:19 AM | ||
Started by ender_wiggum, Today, 09:50 AM
|
1 response
5 views
0 likes
|
Last Post Today, 10:10 AM | ||
Started by rajendrasubedi2023, Today, 09:50 AM
|
1 response
12 views
0 likes
|
Last Post Today, 10:05 AM | ||
Started by bmartz, Today, 09:30 AM
|
1 response
9 views
0 likes
|
Last Post Today, 09:48 AM | ||
Started by geddyisodin, Today, 05:20 AM
|
3 responses
26 views
0 likes
|
Last Post Today, 09:36 AM |
Comment