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.