PDA

View Full Version : Backtest screen blank when referencing BarsArray


kgillis23
05-24-2007, 04:04 PM
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.

NinjaTrader_Ray
05-24-2007, 04:12 PM
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.

kgillis23
05-24-2007, 04:16 PM
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?

NinjaTrader_Ray
05-24-2007, 04:47 PM
See below.

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?

kgillis23
05-25-2007, 06:44 AM
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?

NinjaTrader_Ray
05-25-2007, 07:12 AM
Your understanding is dead on.