LR=LinRegSlope(e,LRPeriods);
SEPeriods=Param("SEPeriods",10,1,500,1);
SE=StdErr(e,SEPeriods);
SDPeriods=Param("SDPeriods",10,1,500,1);
SD=StDev(e,SDPeriods);
NewKRatio= LR / ((SE/SD)* sqrt(SDPeriods));
SetCustomBacktestProc("");
if
(Status("Action") ==
actionPortfolio)
{
bo = GetBacktesterObject();
bo.backtest();
st = bo.getperformancestats(0);
NewKRatio = st.getvalue("NewKRatio");
bo.addcustommetric("NewKRatio",
NewKRatio);
}
Thanks
Dave