![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Oct 2008
Posts: 23
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
wcmaria,
Multi-series indicators will be available in NT7. You currently cannot do this.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2008
Posts: 23
Thanks: 0
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |