Say I'm running my strategy, in a 10 minute chart. I'd like to get the EMA(20) value from the 10 minute, 5 minute, and 1 minute charts. How to do? Thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Getting the EMA from two different time frames?
Collapse
X
-
Getting the EMA from two different time frames?
How to I get the EMA (or other indicator value) from two different time frames?
Say I'm running my strategy, in a 10 minute chart. I'd like to get the EMA(20) value from the 10 minute, 5 minute, and 1 minute charts. How to do? ThanksTags: None
-
Hello timmbbo,
Thank you for your note.
To calculate the values of an indicator for a time series which is not the primary series, you would have to add additional data series, for example,
See AddDataSeries section of our helpguide,Code:AddDataSeries(BarsPeriodType.Minute, 5); AddDataSeries(BarsPeriodType.Minute, 10);
Then you should add current bar checks to make sure each series has enough bars, for example,
See more about current bar checks at "Make sure you have enough bars in the data series you are accessing" reference example,Code:if(CurrentBars[0] <20 || CurrentBars[1]<20 || CurrentBars[2]<20) return;
Then you can set the value of the indicator to a plot or a variable or use in your conditions.
I have attached a sample strategy which adds 2 additional data series and sets plot values equal to the simple moving average of the primary, secondary, and third data series.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
-
Here's a strategy that simply adds a secondary series and prints the SMA(20) from the two different series on each tick. This is what helped me wrap my head around it. LinkOriginally posted by timmbbo View PostHow to I get the EMA (or other indicator value) from two different time frames?
Say I'm running my strategy, in a 10 minute chart. I'd like to get the EMA(20) value from the 10 minute, 5 minute, and 1 minute charts. How to do? Thanks
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment