Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Indicator on Indicator
Collapse
X
-
Indicator on Indicator
I have defined an indicator 1 and another indicator 2 that takes in the indicator 1 as the primary time series. Indicator 1 takes in 1 minute bars time series as the primary input series. What is the best way to plot the indicator 2 and provide it the indicator 1 as input? I am able to plot indicator 2 with 1 minute bars for example as input in a separate panel with the bar chart. thanksTags: None
-
Newworldguy,
Thank you for your post.
You can add the Indicator 2 to the chart and change the input series to use Indicator 1.
To do this, follow the step below –
1. From your chart open the Indicators Window, Right click in the chart and select Indicators
2. If you haven't already add Indicator 2 by selecting the indicator on the left list and click new.
3. To the right will be parameters for that Indicator.
4. Under ‘Data’ change the Input series by clicking in and then the ‘…’ button that appears to the right.
5. This will bring up the Input Series window.
6. Double click Indicators and select Indicator 1. Below you can change the parameters of the indicator if you want
8. Click OK.
9. Click Apply and then OKCal H.NinjaTrader Customer Service
-
I did exactly what you said. As a result now Indicator 2 is using Indicator 1 as the primary input series. In the code of indicator 2, I was using the Time function to access the time series. When I used the ES 06-14 1 m bars as the input series, indicator 2 worked just fine. Now when I use Indicator 1 as the input series, The Time function returns a NULL. Do i have to create the Time Array in my Indicator 2 code? If so please, can you share an example? thanks,
Comment
-
Script attached.
Please advice. thanks
This is of course Indicator 2 that takes in indicator 1 as an input. The 2 calls that are problematic as far as I can see are Time and Volume. Since I am passing an indicator to the indicator as input series which is more than an IDataSeries, I am wondering if I have to do something to the effect of:
protected override void OnBarUpdate()
{
Indicator indicatorInput = (Indicator)Input;
and then:
if(index != -1)
{
aatod += indicatorInput.Volume[index];
before making these calls...?
In general it will be good to post an example of an indicator that takes in an indicator as an input, I cannot currently find one. And the wizard doesn't seem to support an indicator as an Input type.Attached Files
Comment
-
Find attached the code for Indicator 1 (FlowStats.cs) and Indicator 2 (AverageAtTimeOfDay.cs) and the dll(NinjaCompanion) that is referenced.
Look forward to your assistance.
Comment
-
Simple Test
To simplify the matter I created the following test using the wizard and just changed 2 lines in TestIndicatorOnindicator.cs:
protected override void OnBarUpdate()
{
Print(Time[0].ToString());
Plot0.Set(Volume[0]);
attached are screenshots and output window. neither time nor volume worked as i expected...
Can you please suggest how I can get this simple example to work? In other words, how can I access the underlying time series and of of TestIndicator1 and the volume of the input to the TestIndicator1 (which is 1 min ES 06 bars)
Comment
-
Cal,
This still plots the close and not the high. did you try it? Also any suggestions on my original question, i.e. can I pass an indicator to an indicator as the primary series?
Comment
-
in fact it doesn't matter what i set the plot in IndicatorOnIndicator to:
Plot0.Set(TestIndicator1(Volume, 1)[0]);
Will also print the Plot set in TestIndicator1!
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
647 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
368 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 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
571 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment