How do I access the time frame for a given chart from NinjaScript?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
referencing data on a different chart
Collapse
X
-
referencing data on a different chart
Is it possible to reference the results of an indicator on a different chart? If so, how?
How do I access the time frame for a given chart from NinjaScript?Last edited by saroj; 08-30-2009, 06:19 PM. Reason: incorrect observation... both the CL 4R and CL 12R are displayedTags: None
-
saroj,
Unfortunately an indicator only knows what is happening on the current chart it resides in.
To access timeframe of the chart it is currently on you can use this: http://www.ninjatrader-support.com/H...V6/Period.htmlJosh P.NinjaTrader Customer Service
-
How to store data in a way that it can be shared across charts like a global variable
Thanks, Josh...Originally posted by NinjaTrader_Josh View Postsaroj,
Unfortunately an indicator only knows what is happening on the current chart it resides in.
To access timeframe of the chart it is currently on you can use this: http://www.ninjatrader-support.com/H...V6/Period.html
... so in NT 6.5 there is no way to create a global variable? I want to use the 12R chart to set direction/trend, but use a 4R chart to trigger entries in that direction. Any way to accomplish this?
If no, will this change in NT7?
Comment
-
Not exactly a "global variable", but this thread describes how to share values between indicators/strategies.Originally posted by saroj View Post... so in NT 6.5 there is no way to create a global variable?
That thread adds detail to Exposing indicator values that are not plots, which is the most applicable sample for your situation.AustinNinjaTrader Customer Service
Comment
-
Will Global Variables be available in NT7
Thanks Austin... I could be missing something, but I read through that thread and also the one about "Exposing... values...not plots..." however I don't see how that would solve my problem. I want to know what is happening on a 12R chart (giving trend and direction) from an indicator / strategy in a 4R chart (fine tuning entries). Thus, I want to share values between different charts, not different indicators or strategies.Originally posted by NinjaTrader_Austin View PostNot exactly a "global variable", but this thread describes how to share values between indicators/strategies.
That thread adds detail to Exposing indicator values that are not plots, which is the most applicable sample for your situation.
I'm new to both NinjaScript and C# and OOP so excuse me if it is there in that thread and I simply don't see it or understand it.
still wondering about NT7 in this regard.
Comment
-
Only way you can share this information is to build it directly into a multi-time frame strategy to begin with. http://www.ninjatrader-support.com/H...ameInstrumentsJosh P.NinjaTrader Customer Service
Comment
-
What capability will exist in NT7 for cross-chart reference?
Josh? Anyone? (4th time I've asked)Originally posted by NinjaTrader_Josh View PostOnly way you can share this information is to build it directly into a multi-time frame strategy to begin with. http://www.ninjatrader-support.com/H...ameInstruments
Comment
-
The only way to share information between charts is to create two different indicators for each chart. It isn't possible without an indicator/strategy on each chart.Originally posted by saroj View PostI want to know what is happening on a 12R chart (giving trend and direction) from an indicator / strategy in a 4R chart (fine tuning entries).
One indicator is applied to the 12R chart and this indicator could expose any variable inside the indicator.
The second indicator/strategy on the second chart (4R) would read the exposed variables from the first indicator and could then use those exposed values in it's own calculations.
The links I gave you earlier contain code that demonstrates this idea.AustinNinjaTrader Customer Service
Comment
-
YES, BUT i GOT TOTALLY THROWN OFF BY JOSH'S ORIGINAL REPLAY TO MY ORIGINAL QUESTION WHEN HE SAID "Unfortunately an indicator only knows what is happening on the current chart it resides in."Originally posted by NinjaTrader_Austin View PostThe only way to share information between charts is to create two different indicators for each chart. It isn't possible without an indicator/strategy on each chart. OK... I'M WITH YOU SO FAR
One indicator is applied to the 12R chart and this indicator could expose any variable inside the indicator.
The second indicator/strategy on the second chart (4R) would read the exposed variables from the first indicator and could then use those exposed values in it's own calculations.
OK... MAKES SENSE... SO AS LONG AS THEY ARE NAMED DIFFERENTLY, THEY COULD PERFORM THE SAME FUNCTION AND THE 4R CHART COULD READ THE "EXPOSED" VALUE GENERATED FROM THE 12R CHART...
The links I gave you earlier contain code that demonstrates this idea.
NOW I'M LEFT WITH TRYING TO PUT THESE TWO OPPOSITE RESPONSES TOGETHER
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
628 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
359 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
562 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment