![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Member
Join Date: May 2007
Location: West Jordan, Utah
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
|
The following code snipit complies in a strategy with out errors but then causes the Backtest pop-up dialog to come up empty - actually blank. Can you help me out here? Thanks.
Add(PeriodType.Minute, 30); myWMA5 = WMA(BarsArray[1],5); myWMA5.Plots[0].Pen = new Pen(Color.DarkBlue,2); Add(myWMA5); Without the reference to BarsArray in the WMA declaration it works fine.
Last edited by kgillis23; 05-24-2007 at 04:08 PM.
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
Yes, you have hit a limitation by where you can not assign a secondary series to an indicator method in the Initialize() method. If you check your log, I suspect you will see an error message regarding this.
We do not support plotting indciators of a different series on the primary chart series that the strategy is running on.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: May 2007
Location: West Jordan, Utah
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks,
Ok, so while backtesting I want to plot multiple WMA on 30 minute bars while running a strategy based on 5 minute bars (i.e. I need to enter/exit on 5 minute intervals and not wait for the 30 minute bar to update). So, how can I plot on 30m when my enter/exit or on 5m? Or do I need to write my own WMA for the 30m? |
|
|
|
|
|
#4 | |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
See below.
Quote:
Ray
NinjaTrader Customer Service |
|
|
|
|
|
|
#5 |
|
Member
Join Date: May 2007
Location: West Jordan, Utah
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
|
So, just so I understand, I can still use the value of a 30 minute WMA(5) in a strategy charting and running on 5 minutes, I just can't chart the 30 minute indiators. Is that right?
|
|
|
|
|
|
#6 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
Your understanding is dead on.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Backtest not available | BradB | Strategy Analyzer | 9 | 11-10-2007 09:41 PM |
| Referencing Previous Instance(s) Of Condition | roxana | Automated Trading | 11 | 08-01-2007 05:13 PM |
| Backtest > Time frame | sdooley | Strategy Analyzer | 3 | 03-22-2007 07:52 AM |
| Accessing BarsArray[0].Period.Value inside Initialize() | jbeninga | Strategy Development | 10 | 03-22-2007 01:49 AM |
| Referencing data values | NinjaTrader_Ray | Indicator Development | 1 | 04-07-2006 01:48 PM |