Cum() function since the startDate of backtest window

Hi All,

I am currently working on regression between VIX and SPY .Try to work out the cumulative residual values over the theoretical values. It seems the Cum() function works from the first bar of all the database you downloaded. Any way to work around to get the Cum() since the startDate of the backtest window? Shall I use BarIndex()?

Beta = Correlation(SPYchg, IVchg, Periods) * StDev (IVchg,Periods)/StDev (SPYchg, Periods);

Alpha=(Sum(IVchg ,Periods) - ( Beta ) * Sum( SPYchg ,Periods ) )  / Periods;

Theo = Alpha + Beta * SPYchg;

Resid = IVchg - Theo;

SumofR = cum(Resid);

Any reply will be much appreicated.

You can use this:

inrange = Status("barinrange" );
Cum( array * inrange );

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.