NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 06-25-2012, 01:12 PM   #1
egan857
Senior Member
 
Join Date: Jan 2012
Location: Austin Texas
Posts: 126
Thanks: 31
Thanked 4 times in 4 posts
Default Calculating an indicator on a multi-time frame

Hi, my primary timeframe is a minute bar on the stock and my secondary timeframe is the minute bar on another stock (DIA). Is there any way to calculate an indicator like ADX on the secondary timeframe?

It looks like the answer is going to involve IDataSeries somehow, but I don't get how to associate a set of closing bar prices from one data series to an IDataSeries variable. Any help would be appreciated.
egan857 is offline  
Reply With Quote
Old 06-25-2012, 01:14 PM   #2
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

egan857,

Yes, your understanding is correct.

Indicators usually have an overloaded method where you can call them and pass a data series to them

For example : ADX(Closes[1], 14)[0] would be the ADX of the secondary series Close prices.

Please let me know if I may assist further.
NinjaTrader_AdamP is offline  
Reply With Quote
The following user says thank you to NinjaTrader_AdamP for this post:
Old 06-25-2012, 01:19 PM   #3
egan857
Senior Member
 
Join Date: Jan 2012
Location: Austin Texas
Posts: 126
Thanks: 31
Thanked 4 times in 4 posts
Default

Oh! That's so much simpler than I thought it would be. It works great. Thanks!
egan857 is offline  
Reply With Quote
Old 06-25-2012, 01:22 PM   #4
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

egan,

No problem. Please feel free to contact us or post in the forum any time. We monitor our forum as well as watch the support email.
NinjaTrader_AdamP is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi Time frame indicator trader413 Indicator Development 7 07-18-2011 11:28 AM
Multi-time-frame indicator easyfresh3000 Version 7 Beta General Questions & Bug Reports 3 05-27-2010 11:25 PM
multi time frame indicator voyager Indicator Development 2 01-04-2010 10:01 AM
Multi time frame indicator nigeleyre Indicator Development 11 08-23-2009 06:39 PM
Multi-Time Frame Indicator fy260498 Indicator Development 5 02-11-2009 12:41 PM


All times are GMT -6. The time now is 05:03 PM.