找回密码
 注册
搜索
查看: 6015|回复: 71

[讨论] 关于优化目标 --- Sharpe ratio vs. Average daily return vs. Total return

[复制链接]
发表于 2010-7-9 03:24 PM | 显示全部楼层 |阅读模式


本帖最后由 Diffusion 于 2010-7-9 18:07 编辑

最近在develop一个momentum系统。发现优化目标的选择是个大问题。

最开始的优化目标是maximize Sharpe ratio,可是发现Sharpe ratio高并不表示收益高。我做了个测试,同样的参数,如果交易nasdaq 100股票,Sharpe ratio 1.98,average daily return 0.26%。如果交易s&p 100股票,Sharpe ratio 1.5,average daily return 0.14%。可是如果把nasdaq 100和s&p 100股票放在一起同时交易,那么Sharpe ratio会提高到2.05,但是average daily return却下降到0.21%。实际上整体收益反而下降了很多。我的看法是s&p 100股票加进来以后,虽然降低了每日收益,但是更降低了每天的波动幅度。所以会出现Sharpe ratio提高的情况。现在问题就来了,优化的时候是应该最大化Sharpe ratio,还是应该最大化average daily return?后者等同于最大化绝对收益。虽然我倾向于优化后者,可是看书上建议是优化前者。

希望经常潜水的各位quant老大们多多发言。
发表于 2010-7-9 03:48 PM | 显示全部楼层
优化sharpe ratio的目的是不是减小max. drawdown啊?如果这样的话,就可以使用更大的leverage了。也就是说,如果你交易一份SPY, 收益是0.21%, 但是由于你的max drawdown小,你可以用双倍的margin, 甚至5倍的margin (例如ES), 也不会爆仓。而如果max drawdown大,虽然计算出来的收益高,但是中间过程中有可能就爆仓了,等不到获得收益的时候。

我最近的交易就很说明问题啊。我从1120买了ES, 一直拿到1010, 在水下泡了110点呢。幸好第一次只买了一个ES, 后来加仓又买了一个ES, 总之就是仓位控制得比较小,所以就随着SPX作了趟过山车。如果我上了大仓位,在1010附近可能就爆仓了,那就等不到ES涨回来的这一天了。

如果我以后学会了止损,在分析出来卖信号的那天坚决割肉,就不会在水下泡这么深。比如讲,如果我在1120进了ES之后,第二天出了三卖信号,就坚决卖掉,顶多也就是损失20点。相比110点的水深,那理论上我在仓位控制方面,就可以上5倍的仓位,每次操作5个ES了。这样如果有盈利,也是5倍的盈利。
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-9 04:02 PM | 显示全部楼层
优化sharpe ratio的目的是不是减小max. drawdown啊?如果这样的话,就可以使用更大的leverage了。也就是说, ...
padme 发表于 2010-7-9 17:48



    是的。Sharpe ratio反映了系统的稳定性。Sharpe ratio越大,系统越稳定,maximum drawdown越小,越不容易被突发事件搞到爆仓。稳定的盈利才能长期积累,所以一般都会优先追求稳定的回报,也就是maximize Sharpe ratio。
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-9 04:07 PM | 显示全部楼层
刚才看padme的帖又想明白一点,maximize Average daily return 不等于 maximize 绝对收益。

因为average daily return = sum(daily return) / number of days

而total return = daily return [0] x daily return [1] x ....

所以有时候average daily return可以很高,但是其中如果有一个为零,那么绝对收益也就是0。

所以现在有个三个优化目标了,我觉得应该maximize total return。
Maximize Sharpe ratio
Maximize Average daily return
Maximize Total return
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-9 04:19 PM | 显示全部楼层
但是追求maximize sharpe ratio 也要适可而止。优化到一定程度之后,再继续优化就没有意义了。例如911这种事情,不管一个系统以前优化得sharpe ratio有多么好,但是这种事情突然发生,而且发生之后交易就停止了,想止损都不行。也就是说,仓位还是不能上得太大。所以设计仓位的时候,还是要预留足够的空间,不能按照计算出来的max. drawdown来计算仓位。


我觉得无论怎么设计仓位,预留SPX 100点的空间总是需要的,特别是我们前不久刚有过5月6号一天就跌了100点的例子。这样一旦仓位的上限确定了,那么优化sharpe ratio的目标也就确定了。超过这个目标的sharpe ratio优化,就没有意义了。
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-9 04:23 PM | 显示全部楼层
刚才看padme的帖又想明白一点,maximize Average daily return 不等于 maximize 绝对收益。

因为average ...
Diffusion 发表于 2010-7-9 18:07


max. sharpe ratio是不是就是确定你的收益不会为0(爆仓)啊?如果爆仓了,sharpe ratio肯定很差啊。
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-9 05:01 PM | 显示全部楼层
但是追求maximize sharpe ratio 也要适可而止。优化到一定程度之后,再继续优化就没有意义了。例如911这种事 ...
padme 发表于 2010-7-9 18:19



    如果只炒一只股票或者只交易index而且还用margin,那么止损和留一定的cash buffer是必须的。如果不用margin,那么可以全仓进入,用同时 hold 若干只股票的方法来增加系统稳定性。当然遇到9/11还是没办法。
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-9 05:03 PM | 显示全部楼层
本帖最后由 Diffusion 于 2010-7-9 19:10 编辑
max. sharpe ratio是不是就是确定你的收益不会为0(爆仓)啊?如果爆仓了,sharpe ratio肯定很差啊。
padme 发表于 2010-7-9 18:23



Daily Sharpe ratio = average daily return / standard deviation of daily return.
Annualized Sharpe ratio = sqrt(252) * Daily Sharpe ratio

如果有个0(其实应该是-1, (today value - yesterday value) / yesterday value = -100%)的话,可以肯定standard deviation of daily return非常大,也就是说Sharpe ratio会非常小。
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-9 09:07 PM | 显示全部楼层
本帖最后由 abaqus 于 2010-7-9 23:10 编辑

Two comments,

1. I guess this is a ST system. Of course, we can have super slow ST to super fast ST. For a ST system with average holding period 2 weeks, the market crash should help you make big gain rather than loss. For example, the last 3 biggest crash (Oct 19, 1987; 911; & May 6, 2010), since they are way below EMA10, EMA 20 at least 2 to 3 days before it happen,  we should have short position already.  Therefore, a good system should not have concern about this kind event.  There is always some bearish sign show up before price big drop. It can apply to index chart very well, but not necessary on single stock.  This is reason I give up to trade single stock.

2. The purpose of any trading is to make money, the more the better. If the test results are based on long term comparison, I will take the total return as my target.

I could be wrong. Just for idea exchange.

评分

1

查看全部评分

回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-9 10:04 PM | 显示全部楼层
Two comments,

1. I guess this is a ST system. Of course, we can have super slow ST to super fast  ...
abaqus 发表于 2010-7-9 23:07



    Thx for the comments.

Well said on (1). Agree on (2)
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-9 10:44 PM | 显示全部楼层
步入歧途咯。。。
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-9 11:15 PM | 显示全部楼层
步入歧途咯。。。
balto 发表于 2010-7-10 00:44



    为什么这么说?
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-10 01:10 AM | 显示全部楼层
最近在develop一个momentum系统。发现优化目标的选择是个大问题。

最开始的优化目标是maximize Sharpe r ...
Diffusion 发表于 2010-7-9 17:24



    i am not quant...but sharpe ratio does not really have applicability all the time. think about what defines the sharpe ratio - expected return of benchmark asset. i guess in your model, the expected return of this benchmark asset is either taken as a constant, or based on t-billed yield or the sort. however, the problem with this measures is that this benchmark return usually lags behind market risk appetite a lot. for example, you see P/E ratio of stocks climbing much faster than interest rate during 09 march bull run. therefore the sharpe ratio is not the "true" value.

   second, there are questions about volatility. in a sudden event like 911, in principle the market volatility is infinity or closed to infinitely at that particular moment. in that case your model is gonna fail.

   i guess your model is best for long term position trading.

   just my humble opinion.
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-10 02:18 AM | 显示全部楼层
本帖最后由 padme 于 2010-7-10 04:32 编辑
如果只炒一只股票或者只交易index而且还用margin,那么止损和留一定的cash buffer是必须的。如果 ...
Diffusion 发表于 2010-7-9 19:01



    如果你已经确定了不用margin, 只做股票而且是多只股票同时做,只hold多仓而且不short,那么你就不用考虑因为一次突发事件而爆仓的危险,就算是911,之后也全部涨回来了。这种情况下,优化sharpe ratio没有意义,除了安抚自己和投资人的心理之外。

这样你的优化目标就应该是total return.
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-10 02:27 AM | 显示全部楼层
本帖最后由 padme 于 2010-7-10 04:30 编辑
Two comments,

1. I guess this is a ST system. Of course, we can have super slow ST to super fast  ...
abaqus 发表于 2010-7-9 23:07



    我以前也认为好多在股票上发生的事情不会在指数上发生,但是现在不这么认为了。 之所以指数上发生的事情少,是因为指数的数量少,股票的数量多。当我们看图的时候,就可能会误认为,哦,某些事情只在股票上发生过,从来没有在指数上发生过。 但是其实,按照概率来说,在股票上发生的事情和在指数上发生的概率是一样的。我们本来就在不断创造历史。最近两年发生的“史无前例”的事情,可不少呢。
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-10 03:22 AM | 显示全部楼层
那么为什么quant的书上会讲优化sharpe ratio非常重要呢,其实就是因为quant一般都是服务于基金的,而基金的投资人,通常来讲对于drawdown的忍受,并不大。一旦某个基金跌了20%,就会面临非常大的撤资潮。这个时候虽然不是我们前面说的跌100%的那种爆仓,但是撤资潮一旦开始,对于基金来说基本上也就等于爆仓了。

同样前面的例子,我这次的操作,在水下泡了110点,由于是自己的资金,可以拿住不动等待涨回来。但是如果是别人的资金,看见我跑到水深110米的地方了,还能不撤资吗?这个时候,是根本没有机会等待涨回来的。

所以在替别人操作的时候,优化sharpe ratio就非常重要。

另外,就算是自己的资金,在承担损失的能力不足的时候,也是要优化sharpe ratio的。我第一个系统,就是只优化了total return, 我还计算过max drawdown, 发现是将近25%。 结果我还上了双倍仓位,当时的想法是,就算是跌去50%也没关系,反正会涨回来的。可是当这个drawdown真正发生的时候,刚刚跌到20%,我就接受不了了,急忙斩仓割肉,根本没给跌去50%再涨回来的机会。

评分

1

查看全部评分

回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-10 03:34 AM | 显示全部楼层
i am not quant...but sharpe ratio does not really have applicability all the time. think a ...
氢氧化钠 发表于 2010-7-10 03:10



I think the "expected return of benchmark asset" is not that important. That's why I assumed it to be zero and ignored it in the discussion.

To my limited understanding, Sharpe ratio measures the volatility of the strategy, which is different from the volatility of the market. If we think about buy and hold, then the two might be very close, if not equal to each other. Diversification usually means to buy and hold a basket of stocks and risk will be distributed among the stocks. But then the volatility of the holding is floored by that of the market. However, a strategy can fight market volatility by holding the right stock at the right time, i.e. to diversify along the time axis. By swithing among stocks, switching to cash, or holding short positions at different time, the volatility (measured by the Sharpe ratio) of the strategy can be lower than that of the market. For example, the strategy may choose to hold cash at 9/11 and give you 0 volatility when the market crashed.

Further more, if we decouple Sharpe ratio from the market by assuming a constant or even zero "benchmark return", then the Sharpe ratio is the absolute volatility of the strategy that is independent from that of the market. That's why people are chasing higher Sharpe ratio. It also explained why I assumed a zero "benchmark return".
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-10 03:44 AM | 显示全部楼层
本帖最后由 Diffusion 于 2010-7-10 05:46 编辑
我以前也认为好多在股票上发生的事情不会在指数上发生,但是现在不这么认为了。 之所以指数上发生 ...
padme 发表于 2010-7-10 04:27



    因为diversify的缘故,index的volatility要比个股低。但是index也是有volatility的。好的交易策略应该能提供比index更低的volatility,祥见楼上。而Sharpe ratio就是measure strategy volatility的。
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2010-7-10 03:57 AM | 显示全部楼层
本帖最后由 Diffusion 于 2010-7-10 06:09 编辑
那么为什么quant的书上会讲优化sharpe ratio非常重要呢,其实就是因为quant一般都是服务于基金的,而基金的 ...
padme 发表于 2010-7-10 05:22



是的,因为最终还是人在控制策略的实施。提高Sharpe ratio就是为了避免给人为失误提供机会。如果两个策略total return相近,那么一定应该选择Sharpe ratio高的那个。这样就会降低人的主观因素错误终止策略的可能性。

我想从逻辑上讲,Total return和Sharpe ratio应该都很重要。但是程序只能选择一个目标来优化。所以想听听做过这方面的老大的经验,如何在两者间balance。比如有没有一个magic number for Sharpe ratio,那么优化的时候就可以在Sharpe ratio大于这个magic number的条件下,最大化total return。
回复 鲜花 鸡蛋

使用道具 举报

发表于 2010-7-10 04:20 AM | 显示全部楼层
为什么这么说?
Diffusion 发表于 2010-7-9 11:15 PM


以己之短攻MM之长,碰到了G点MM也不会让你爽,碰不到G点MM会一脚把你蹬下来,哈哈,优化这样的系统是事倍功半。。。
回复 鲜花 鸡蛋

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|www.hutong9.net

GMT-5, 2025-6-26 12:40 PM , Processed in 0.082059 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表