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 sidlercom80, 10-28-2023, 08:49 AM
|
172 responses
2,277 views
0 likes
|
Last Post
by sidlercom80
Today, 04:40 AM
|
||
Started by Irukandji, Yesterday, 02:53 AM
|
2 responses
17 views
0 likes
|
Last Post
by Irukandji
Today, 03:55 AM
|
||
Started by adeelshahzad, Today, 03:54 AM
|
0 responses
3 views
0 likes
|
Last Post
by adeelshahzad
Today, 03:54 AM
|
||
Started by CortexZenUSA, Today, 12:53 AM
|
0 responses
3 views
0 likes
|
Last Post
by CortexZenUSA
Today, 12:53 AM
|
||
Started by CortexZenUSA, Today, 12:46 AM
|
0 responses
1 view
0 likes
|
Last Post
by CortexZenUSA
Today, 12:46 AM
|
Comment