If it is relative to the indicator, would that mean that NT would be loading 2 of the same price series into memory if both indicators happen to be ADD()-ing the same data, or would NT know that it already has that bartype series in memory and both indicators would use the 1 data series?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
What is ADD() data relative to?
Collapse
X
-
What is ADD() data relative to?
Creating a chart uses a primary data series. If I then create a multi-instrument indicator and ADD() a second data series, it's Close price would be Closes[1][0]. If I then place another indicator on the chart that also has an ADD(), would that 3rd data series be relative to the indicator (BarsArray[1]) or absolute to the chart (BarsArray[2])?
If it is relative to the indicator, would that mean that NT would be loading 2 of the same price series into memory if both indicators happen to be ADD()-ing the same data, or would NT know that it already has that bartype series in memory and both indicators would use the 1 data series?Tags: None
-
Hello,
Thank you for your note.
The Add() method is a multiple function method.
When you Add() and indicator it does not add it as a multi series indicator. It simply adds it to the chart when you run the strategy.
To access the indicator in the strategy where you need to use this you simply type SMA(10)[0] when you need to access an indicators value.
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
-
[QUOTE=NinjaTrader_Brett;201489]Hello,
Thank you for your note.
The Add() method is a multiple function method.
When you Add() and indicator it does not add it as a multi series indicator. It simply adds it to the chart when you run the strategy.
To access the indicator in the strategy where you need to use this you simply type SMA(10)[0] when you need to access an indicators value.
---------------------------------------------------------------------------------
Perhaps this a better explanation of what I mean:
In TradeStation, you add multiple data series to a chart (making them visible or hidden) and then access them in code via their assigned number.
Since NT does not allow "Hidden", you can Add() a series in an indicator in Initialize() to plot values from. NT would assign BarsArray[1] to hold that data.
But then how are they numbered if I happen to add another indicator that also Add()s a series, and then manually add another through the menu? How are those dataseries accessed via code?
In Tradestation the numerous data series are tied to the individual chart, numbered in the order they are added. How is it handled in NT?Last edited by Tarkus11; 10-30-2010, 06:20 PM.
Comment
-
Hello,
They are added in the order they are added just like in TradeStation.
Therefor,
BarsInProgress or BarsArray 0 will be the chart/dataseries the indicator or stratewgy is running on always.
Then when you add multiple data series with Add(), the first Add() call gets assigned BarsArray[1], then the second Add() is BarsArray or BarsInProgress == 2 so on and so on.
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
Comment
-
Ok. So for clarity's sake it works as follows?Originally posted by NinjaTrader_Brett View PostHello,
They are added in the order they are added just like in TradeStation.
Therefor,
BarsInProgress or BarsArray 0 will be the chart/dataseries the indicator or stratewgy is running on always.
Then when you add multiple data series with Add(), the first Add() call gets assigned BarsArray[1], then the second Add() is BarsArray or BarsInProgress == 2 so on and so on.
Let me know if I can be of further assistance.
1)Create Chart - > BarsArray[0] (i.e. ES)
2)Add first indicator to chart with Add() in Intialize() -> BarsArray[1] (i.e. NQ)
3)Add second indicator to chart with Add() in Intialize() -> BarsArray[2] (i.e. NQ)
4)Manually add another Data Series thru the menu -> BarsArray[3]
If 2 & 3 are the same data series (say, indicator 1 is a MACD and indicator 2 is a volume accumulation), are there 2 identical data series in memory - so that if I added another indicator to the chart that needed the NQ data, using a parameter to point the logic to use BarsArray[1] would be the same as pointing it to use BarsArray[2]?
Comment
-
Tarkus,
I dont think you understood my first post.
When you add an indicator Add(IndicatorName()); It doesnt add it as a data series.
You can add indicators all day long to an indicator/strategy and the BarsArray() will still be 0.
The only time a new data series is added aka instrument data is when you Add an instrument.
The only thing you will use BarsArray for is Multi Instrument and Multi Time Frame Strategies or Indicators.
Aka the name BarsArray. Bars array only stores Bar data.
However to answer your question of Add line 2 and Add Line 3 both added for example a 5 min NQ 12-10 chart/instrument data then use they both would be the same.
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
Comment
-
Thank you. I think we are talking past each other.Originally posted by NinjaTrader_Brett View PostTarkus,
I dont think you understood my first post.
When you add an indicator Add(IndicatorName()); It doesnt add it as a data series.
You can add indicators all day long to an indicator/strategy and the BarsArray() will still be 0.
The only time a new data series is added aka instrument data is when you Add an instrument.
The only thing you will use BarsArray for is Multi Instrument and Multi Time Frame Strategies or Indicators.
Aka the name BarsArray. Bars array only stores Bar data.
However to answer your question of Add line 2 and Add Line 3 both added for example a 5 min NQ 12-10 chart/instrument data then use they both would be the same.
Let me know if I can be of further assistance.
My focus was on the Data Series. I don't care about the indicator, other than for a non-visible data series to be used, you have to Add() one using an indicator in Intialize()
Explicitly:
Add("NQ 12-10", PeriodType.Minute, 5);
Now if I have 2 indicators each Add()ing NQ 5min (one using price, the other using volume), then I am getting 2 copies of NQ 5min loaded according to what you are saying, as a 2nd and 3rd data series.
For me, this would mean it is more efficient to create a single "load" indicator for all "invisible" dataseries I wish to use, then parametrize the subsequently added calculating indicators to "x", where x = Closes[x][0] or Opens[x][0] etc.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
344 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment