Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to add additional Data Series to chart?
Collapse
X
-
How to add additional Data Series to chart?
Hello, I made this indicator that tracks the Open-Close-Median of the the 30 minute bar. I can see it on a 1-minute chart if I manually add the 30 minute data series. Is there a way to do it without manually adding the second data series?Tags: None
-
Hello JohnS52,
Thank you for your post.
So I may better assist you, please answer the following questions:- When you say you are manually adding the 30 minute data series, do you mean adding that series to the chart visually?
- When you configure the indicator, which series are you using as the input series?
- Do you receive any errors on the Log tab of the Control Center? If so, what do the errors report?
Emily C.NinjaTrader Customer Service
-
Hi Emily,
By manually adding the 30 minute data series I mean Right Click on chart > Data Series > add the 30 minute on the same panel as the 1 minute.
When I configuring the indicator I use the default input (e.g. 1 minute).
Log error messages pertain to the OnBarUpdate trying to create the indicator before it has enough bars. Easy to fix I think.
Thank you for any assistance.
Comment
-
Hello JohnS52,
Thank you for your reply.
You are correct; it seems that OnBarUpdate() is trying to access a series before there are enough bars. We have a page about preventing this type of error in the help guide:
In your script, you have a CurrentBars check of the primary series to see if it is less than 1. You may need to consider your logic and check if there are enough bars to satisfy the period in the added 30 minute series.
This is what you currently have:
Code:if (CurrentBars[0] < 1) return;
This would check if the added series has enough bars for the SMA period selected:
Code:if (CurrentBars[1] < SMA_period) return;
Emily C.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by StockTrader88, 03-06-2021, 08:58 AM
|
45 responses
3,992 views
3 likes
|
Last Post Today, 09:51 AM | ||
Started by TAJTrades, Today, 09:46 AM
|
0 responses
7 views
0 likes
|
Last Post
by TAJTrades
Today, 09:46 AM
|
||
Started by rhyminkevin, Yesterday, 04:58 PM
|
5 responses
62 views
0 likes
|
Last Post
by dp8282
Today, 09:36 AM
|
||
Started by realblubb, Today, 09:28 AM
|
0 responses
8 views
0 likes
|
Last Post
by realblubb
Today, 09:28 AM
|
||
Started by AaronKoRn, Yesterday, 09:49 PM
|
1 response
19 views
0 likes
|
Last Post
by Rikazkhan007
Today, 09:24 AM
|
Comment