[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Custom Metric for Walk Forward Optimization



PureBytes Links

Trading Reference Links

I am trying to make a custom metric for walk forward optimization testing. This custom metric includes parameters that need input from the walk forward periods. For example, if I were making a custom metric K Ratio, I would need the number of bars in the IS and OOS periods to figure Standard Error, Standard Deviation, and Linear Regression slope. How do I do this? And is there a better way?
 
Here's a custom metric AFL with parameter boxes that would be replaced with whatever is needed to make this work when running walk forward optimization.
 
LRPeriods=Param("LinRegPeriods",10,1,500,1);

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

 

 

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___