NinjaTrader Support Forum  

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

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-01-2009, 09:15 AM   #1
wcmaria
Junior Member
 
Join Date: Oct 2008
Posts: 23
Thanks: 0
Thanked 0 times in 0 posts
Default Using Multiple Timeframes with Add()

Hello all.

I am trying to code an indicator that work on say a 1 minute timeframe but looks at the value of a specific indicator on the 5 minute chart.

I have coded the following so far

protectedoverridevoid Initialize()
{
Add(PeriodType.Minute, 5);
CalculateOnBarClose = true;
Overlay = true;
PriceTypeSupported = false;
}
protectedoverridevoid OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CrossAbove(DM(5).DiPlus,DM(5).DiMinus,1)&& Stochastics(3,8,5).D[0] < Stochastics(3,8,5).K[0] && DM(BarsArray[1], 5)[0].DiPlus > DM(BarsArray[1], 5)[0].DiMinus )
DrawArrowUp(CurrentBar.ToString(), true, 0, Low[0] - 0.0005, Color.Green);
if (CrossBelow(DM(5).DiPlus,DM(5).DiMinus,1)&& Stochastics(3,8,5).D[0] > Stochastics(3,8,5).K[0] )
DrawArrowDown(CurrentBar.ToString(), true, 0, High[0] + 0.0005, Color.Red);
}

My problem is that when I call the Add() line uder Inialize, I get an error telling me that "No overload for method "Add" take 2 arguements. I'm not sure what it wants since the line is taken directly from sample code in the help file.

What am I doing wrong if I would like to look at the adx on the 5 minute chart before drawing my indicator?

Thanks in advance for any help.
wcmaria is offline  
Reply With Quote
Old 04-01-2009, 09:29 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

wcmaria,

Multi-series indicators will be available in NT7. You currently cannot do this.
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-13-2009, 05:49 PM   #3
wcmaria
Junior Member
 
Join Date: Oct 2008
Posts: 23
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Josh, is what I am trying to do not similar to what was discussed in the following thread you responded to a while back -

It is all possible. To work with multiple time frames first read http://www.ninjatrader-support.com/H...ameInstruments.

To make the time frames variable you would simply need to code user selectable parameters. Be careful when you code though. The first time frame will always be whatever time frame the chart which you loaded the strategy onto is set at. If you want your strategy to work regardless of what time frame the chart/strategy analyzer is on and just solely based on your user inputs you should probably add two more time periods to your strategy. You would negate the first time period (the chart's time period) from all calculations in this instance.

Does this still not work in version 6?
wcmaria is offline  
Reply With Quote
Old 05-14-2009, 05:41 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Josh's comment was about MultiInstrument / MultiTime strategies, those are possible with NinjaTrader 6.5

NinjaTrader 7 will offer this concept for indicators as well.
NinjaTrader_Bertrand 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
Multiple Timeframes Gumphrie NinjaScript File Sharing Discussion 41 04-12-2011 09:53 AM
Two timeframes jriverac Strategy Development 5 05-26-2008 07:23 PM
Two timeframes jriverac Strategy Development 6 04-08-2008 03:02 PM
# bars back with multiple timeframes palinuro Market Analyzer 1 04-03-2008 11:59 PM
Question about multiple timeframes nybangali Strategy Analyzer 1 08-13-2007 12:36 AM


All times are GMT -6. The time now is 01:23 PM.