NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 05-24-2007, 04:04 PM   #1
kgillis23
Member
 
Join Date: May 2007
Location: West Jordan, Utah
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
Default Backtest screen blank when referencing BarsArray

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.
kgillis23 is offline  
Reply With Quote
Old 05-24-2007, 04:12 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

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.
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-24-2007, 04:16 PM   #3
kgillis23
Member
 
Join Date: May 2007
Location: West Jordan, Utah
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
Default

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?
kgillis23 is offline  
Reply With Quote
Old 05-24-2007, 04:47 PM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

See below.

Quote:
Originally Posted by kgillis23 View Post
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).

>>> You can not plot indicators using the 30 minute time frame if you backtesting primary series is done on a 5 minute bar.

So, how can I plot on 30m when my enter/exit or on 5m?
>>> You can't at this time, this is a limitation.

Or do I need to write my own WMA for the 30m?
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-25-2007, 06:44 AM   #5
kgillis23
Member
 
Join Date: May 2007
Location: West Jordan, Utah
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
Default

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?
kgillis23 is offline  
Reply With Quote
Old 05-25-2007, 07:12 AM   #6
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

Your understanding is dead on.
NinjaTrader_Ray 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
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


All times are GMT -6. The time now is 10:19 PM.