Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Data Series, Beginner Question.
Collapse
X
-
Data Series, Beginner Question.
New to working with NT. I had a question that I assume there is a very simple answer to, but I am unable to figure out. I am creating a strategy that trades on 30 min. bars. However, I want to add an EMA rule based on daily data, such as only go long when the 14 day EMA is above the 50 day EMA. I am having troubles getting this rule to work, since the indicator defaults to the data series being used in the strategy developer and charting, i.e. the 30 minute bars. There has to be an easy answer I am missing. Thanks.Tags: None
-
You need to create a multi-timeframe script. Add the Weekly timeframe and make the necessary calculations. It is all in the NT help manual, and there is a an example shipped with NT. You will find the example in the Strategy folder when you try to edit a stategy.Originally posted by thebluescout View PostNew to working with NT. I had a question that I assume there is a very simple answer to, but I am unable to figure out. I am creating a strategy that trades on 30 min. bars. However, I want to add an EMA rule based on daily data, such as only go long when the 14 day EMA is above the 50 day EMA. I am having troubles getting this rule to work, since the indicator defaults to the data series being used in the strategy developer and charting, i.e. the 30 minute bars. There has to be an easy answer I am missing. Thanks.
-
Hello thebluescout,
Thank you for your post.
You will need to add an additional time frame to the code and then use BarsArray as the Input Series of the Indicator. For example:
The example Koganam refers to is under Tools > Edit NinjaScript > Strategies > SampleMultiTimeFrame. You can find information on multiple time frames and instruments in your code at the following link: http://www.ninjatrader.com/support/h...nstruments.htmCode:Add(PeriodType.Day, 1); ... if(EMA(BarsArray[1], 14)[0] > EMA(BarsArray[1], 50)[0]) { // Do something. }
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
64 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
41 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
22 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
25 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
52 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment