I understand how to approach this but I am not sure about the specific. I know that I have to create a new indicator and add the 1min bar object to the indicator. But how do I refference Volume[0] from the 1min chart, and actually paint the bars on the volume chart ?
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
Multi Time frame indicator
Collapse
X
-
Multi Time frame indicator
I have a indicator running on a 1min chart that changes the color of the bars whenever a volume condition is met. Now i want to change the colors of the bars on a constant volume chart whenever the same volume condition is met on the 1min chart.
I understand how to approach this but I am not sure about the specific. I know that I have to create a new indicator and add the 1min bar object to the indicator. But how do I refference Volume[0] from the 1min chart, and actually paint the bars on the volume chart ?Tags: None
-
Hi trader413,
The basic framework for multiseries NinjaScript is available in all platforms. Click Tools > Edit NinjaScript > Strategy > Open SampleMultiTimeFrame. Documenation for this is available here:
Volume for a secondary series can be accessed using:
Volumes[1][0]
You can also use a BarsInProgress filter to define the context of bar updates.
if (BarsInProgress == 1) //Seconday series or first added series.
double myVolume = Volume[0];Ryan M.NinjaTrader Customer Service
-
Ok thanks for the reply. I tried your approach but still having some problems.
Why am I not getting the value for BetterVolume3(10,true,true,true).VolEMA[0] from the 1min chart ?
"betterVolAve" remains 0 in the output window.
protected override void Initialize()
{
Add(PeriodType.Minute, 1);
Add(new Plot(Color.FromKnownColor(KnownColor.Tomato), PlotStyle.Line, "SPOI"));
Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "LPOI"));
Overlay = false;
CalculateOnBarClose = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (BarsInProgress == 1)
{
myVolume = Volume[0];
Print(myVolume);
}
if (BarsInProgress == 1)
{
BetterVolume3(BarsArray[1],10,true,true,true).VolEMA[0] = betterVolAve;
Print( betterVolAve + "......Ave");
}
Comment
-
Great the basic functionality is working for you. Unfortunately we could not advise how to see it working with the custom script. We are not familiar with the inputs expected, or how it may be used in a multiseries scripts. Best is to contact the author or vendor. Let them know how you plan on using their script and see if they have any further advice.Ryan M.NinjaTrader Customer Service
Comment
-
But all I am trying to do is to access that data from a different time series. Thats all, I have reference this indicator in other custom indicators without a problem. its just a matter of figuring how to access its 1min calculations from a constant volume chart .
Comment
-
We can't advise how to work this using custom scripts. The issue could be anything.
Here is similar functionality using the built in SMA indicator to calculate a simple moving average of volume from a secondary series:
double mySMAVolume = SMA(Volumes[1], 14)[0];Last edited by NinjaTrader_RyanM1; 07-18-2011, 11:37 AM.Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by wzgy0920, 04-20-2024, 06:09 PM
|
2 responses
26 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:43 PM
|
||
Started by wzgy0920, 02-22-2024, 01:11 AM
|
5 responses
32 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:33 PM
|
||
Started by wzgy0920, 04-23-2024, 09:53 PM
|
2 responses
49 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:29 PM
|
||
Started by Kensonprib, 04-28-2021, 10:11 AM
|
5 responses
193 views
0 likes
|
Last Post
by Hasadafa
Yesterday, 10:19 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
11 responses
3,235 views
0 likes
|
Last Post Yesterday, 08:07 PM |
Comment