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

RE: [amibroker] Invitation -- suggest your favorite objective function



PureBytes Links

Trading Reference Links

I've been fiddling with the scoring function used to select the best
parameters in my auto-optimization stuff. I wondered whether performance
metrics other than pure return might be better predictors of future returns.
so far, I'd say yes.

my original metric was percentage growth per 100 bars. by discounting that
score for max drawdown, *future* return increased. in other words, this
scoring method was a better predictor, not just of drawdown, but of return
also.

I'd figure that this is because higher MDD indicates an un-smooth equity
curve, and a system with more even growth is more likely to be profitable in
the future. what other ways could we measure smoothness of growth that might
also work well?

one lower-level question: in this environment, I need to be able to
calculate this metric on the fly in AFL for the current set of buy/sell
signals, as opposed to in excel later, for instance. another metric I'd be
interested in is win/loss ratio, but calculating it in AFL from an equity
curve and buy/sell signals seems tricky. has anyone done this?

anyway, here's the latest idea, comments appreciated:

------------------
function PerformanceScore() {	// returns score for current trade signals;
highest score is used
	e = Equity(0, 0);
	if(equity_lookback_bars == 0) { // test all performance to date
		e_ref = e[0];
	} else { // test performance back spec'd number of bars
		e_ref = Ref(e, -equity_lookback_bars);
	}
	perf_score = (e - e_ref) / e_ref; // growth over lookback period
	perf_score = MA(perf_score, equity_lookback_smoothing) * 100; // smoothed
pct
	perf_score = perf_score * 100 / IIf(equity_lookback_bars == 0, Cum(1),
equity_lookback_bars); // per 100 bars
	e_max = Highest(e); // peak equity so far
	mdd = Highest(e_max - e); // max drawdown so far
	mdd_fraction = Highest(mdd / e_max); // fraction max drawdown is of peak
equity
	perf_score = perf_score - (perf_score * mdd_fraction *
(equity_drawdown_discount_pct/100)); // reduce score by mdd fraction scaled
by drawdown discount
	return perf_score;
}
------------------

dave


===============================

After reading and writing several postings about objective functions, I
invite AmiBroker users to post their favorite objective functions.  Either a
text description or an afl code segment.  I'll summarize the responses and
post the results.  Remember -- choice of an objective function is personal;
there is no right or wrong.  So no flaming, please.  When responding, please
try to stay on topic.

Howard


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/mk9osC/hP.FAA/3jkFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/