y*****l 发帖数: 5997 | 1 【 以下文字转载自 Stock 讨论区 】
发信人: yaokarl (大象), 信区: Stock
标 题: [合集] back testing result of my swing trading system
发信站: BBS 未名空间站 (Wed Jul 13 08:06:21 2011, 美东)
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Sun May 22 16:35:36 2011, 美东) 提到:
stock list: over 4000 symbols from Yahoo finance,
during testing, delisted symbols are not considered.
Volume: 30 day average vol >500000 during the trading
Price: stock price>6 during trading
long only system, holding period from 2 to 7 trading
days.
I tested from 2000 to 2011, only part of data in 2000
is used.
Results:
total number of trades: 8806
successful trades: 8144 0.924824
unsuccessful trades: 662 0.075176
trades stat by year:
total number of trades in 2000 : 129
successful trades in 2000 : 123 0.953488
unsuccessful trades in 2000 : 6 0.0465116
total number of trades in 2001 : 775
successful trades in 2001 : 714 0.92129
unsuccessful trades in 2001 : 61 0.0787097
total number of trades in 2002 : 502
successful trades in 2002 : 466 0.928287
unsuccessful trades in 2002 : 36 0.0717131
total number of trades in 2003 : 696
successful trades in 2003 : 659 0.946839
unsuccessful trades in 2003 : 37 0.0531609
total number of trades in 2004 : 497
successful trades in 2004 : 441 0.887324
unsuccessful trades in 2004 : 56 0.112676
total number of trades in 2005 : 449
successful trades in 2005 : 408 0.908686
unsuccessful trades in 2005 : 41 0.091314
total number of trades in 2006 : 582
successful trades in 2006 : 520 0.893471
unsuccessful trades in 2006 : 62 0.106529
total number of trades in 2007 : 760
successful trades in 2007 : 688 0.905263
unsuccessful trades in 2007 : 72 0.0947368
total number of trades in 2008 : 1011
successful trades in 2008 : 938 0.927794
unsuccessful trades in 2008 : 73 0.0722057
total number of trades in 2009 : 2196
successful trades in 2009 : 2065 0.940346
unsuccessful trades in 2009 : 131 0.0596539
total number of trades in 2010 : 919
successful trades in 2010 : 857 0.932535
unsuccessful trades in 2010 : 62 0.0674646
total number of trades in 2011 : 290
successful trades in 2011 : 265 0.913793
unsuccessful trades in 2011 : 25 0.0862069
☆─────────────────────────────────────☆
Tianken (怀才就象怀孕) 于 (Sun May 22 16:39:52 2011, 美东) 提到:
牛,能分享吗?
☆─────────────────────────────────────☆
iTrade (铅笔) 于 (Sun May 22 16:41:41 2011, 美东) 提到:
The winning rate sounds too good. Are you sure you didn't use future data?
☆─────────────────────────────────────☆
wavelets (生活在别处) 于 (Sun May 22 16:42:49 2011, 美东) 提到:
考虑进交易费用和spread了么?
☆─────────────────────────────────────☆
boylover (虎子) 于 (Sun May 22 16:44:31 2011, 美东) 提到:
止盈止损如何处理?年回报率能有多少?
☆─────────────────────────────────────☆
jingoshine (jingo) 于 (Sun May 22 16:46:52 2011, 美东) 提到:
成功率真高呀!
通常缓涨快跌,最后盈利率多少?
☆─────────────────────────────────────☆
guanjiu (酒倌副所) 于 (Sun May 22 16:47:59 2011, 美东) 提到:
What's your mean return % and max drawdown?
Seems promsing. Consider posting live picks on the board. Paper trading is
OK.
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Sun May 22 16:49:41 2011, 美东) 提到:
只是统计了可能的交易成功率,还没算回报率
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Sun May 22 16:50:31 2011, 美东) 提到:
没呢,只是做了个成功率的统计,获胜平均gain: 2%,亏损的还没统计
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Sun May 22 16:51:12 2011, 美东) 提到:
I am a machine learning guy, no future data is used
☆─────────────────────────────────────☆
updownlife (渔夫) 于 (Sun May 22 18:11:23 2011, 美东) 提到:
你这成功率太牛了
赶快去筹钱吧, 你这成功率应该可以把股市当提款机的, 呵呵。
☆─────────────────────────────────────☆
iTrade (铅笔) 于 (Sun May 22 18:16:45 2011, 美东) 提到:
It does not matter whether you are a machine learning guy or statistician or
information theorist. I am just saying that your winning rate sounds too
good to be true, nothing personal.
If you are a learning guy and have some real experience in this field, then
you will also agree with what I said. Is this the first time you try
learning method on stock prediction? What is the annualized sharpe ratio,
max drawdown? Do you understand if you have such a winning rate after
considering fees/slippage, what does it imply for your PnL?
☆─────────────────────────────────────☆
qisini100 (牛气冲天) 于 (Sun May 22 18:45:58 2011, 美东) 提到:
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Sun May 22 22:08:53 2011, 美东) 提到:
I didn't use machine learning algorithms, which train
a model based on training data, and test the model on
future test data. My system just simply look for
tradable patterns based on domain
knowledge(resistance, breakout, etc).
I don't think there is overfitting of parameters,
because it's not easy to find a parameter working for
such a long time with various market conditions.
The winning rate seems too good to be true, maybe
there are some errors of the system.
☆─────────────────────────────────────☆
SuperString (小芝麻和小包包他爹) 于 (Sun May 22 22:28:00 2011, 美东) 提到:
这个delisted symbols不考虑本身就是个大漏洞
☆─────────────────────────────────────☆
scalper (scalper) 于 (Sun May 22 22:54:23 2011, 美东) 提到:
Oh, Mama Mia!!!
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Sun May 22 23:03:17 2011, 美东) 提到:
you are right, however, my system is based on short-
term momentum, there is a high probability those
delisted symbols will not be picked by my system.
☆─────────────────────────────────────☆
caoy (caoy) 于 (Mon May 23 00:34:39 2011, 美东) 提到:
你选股的时期是怎么选的?
比如你的系统今天选出一篮子股, 你都买入, 明天系统又选出一篮子不一样的, 你是买
还是不买, 昨天已经买的怎么办? 持有还是抛?
☆─────────────────────────────────────☆
BangQiuGun (棒球棍) 于 (Mon May 23 01:02:44 2011, 美东) 提到:
根据你每年产生的交易数,95%的确太高了。
☆─────────────────────────────────────☆
qisini100 (牛气冲天) 于 (Mon May 23 04:12:23 2011, 美东) 提到:
It does not need to be machine learning algorithm. If you are using rule
based trading system, the rules must have be chosen based on historic data.
There can be a big overlap between data used in developing the rules and
testing the system.
It can also be a simple error as you said.
☆─────────────────────────────────────☆
rootkit (rootkit) 于 (Mon May 23 05:23:30 2011, 美东) 提到:
胜率不能说明任何问题。赢的时候赢1%,输的时候输20%等于没用。
关键是risk:reward ratio和drawdown。
☆─────────────────────────────────────☆
stockGame (knight_123) 于 (Mon May 23 11:09:18 2011, 美东) 提到:
Lot of time what happen is when you win you win too less, when you lose you
lose lot. So you really have to check what is the compound return rate
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Mon May 23 11:17:55 2011, 美东) 提到:
thanks guys, that's what I will do next
☆─────────────────────────────────────☆
stockGame (knight_123) 于 (Mon May 23 13:52:22 2011, 美东) 提到:
let us know the result. By the way, what is a book on neural network
☆─────────────────────────────────────☆
ShortCut (总想偷懒) 于 (Mon May 23 13:54:30 2011, 美东) 提到:
就看前几行,就服倒了.
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Tue Jul 12 22:35:00 2011, 美东) 提到:
贴一个我的模拟,2001年初20000,到2011年5月份差不多1个亿,
当然没有考虑交易费,税,能否成交等问题,每天持有0到6个股票不等
☆─────────────────────────────────────☆
Visitation (一切都好,只欠烦恼) 于 (Tue Jul 12 23:08:52 2011, 美东) 提到:
too good to be true!我觉得楼主的model里十有八九有个很低级错误在里头。是不是
有类似:“如果如何如何,就buy open/low,或者sell@high”的逻辑在里面啊?这都属于隐蔽的
peek the future的错误
另外,加上(或者扣除)足够严厉的手续费/spread/slipage,是必须的,有时候就光
光省略掉这些条件,就可以赚出一条美妙的PL曲线出来,建议楼主对自己的model狠一
点!该加的不利条件统统加上。
☆─────────────────────────────────────☆
caoy (caoy) 于 (Tue Jul 12 23:13:16 2011, 美东) 提到:
我估计就是个buy dip策略
collective2上有类似的一个, 叫nazdq100什么的,曲线也很美 呵呵
☆─────────────────────────────────────☆
wltsn (waterfall) 于 (Tue Jul 12 23:19:18 2011, 美东) 提到:
The winning rate is spectacular, but what's more important is how much do
you lose on your losing trades. There will be losing streaks no matter what.
You may want to look at Sharpe ratio and max drawdown, etc.
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Wed Jul 13 00:02:59 2011, 美东) 提到:
也许吧,但其实gain也不太高,平均一年翻倍多一点,
基本上没有buy open/low, sell close/high之类的,这个基本上是骗自己的,不过确
实没有考虑spread/slipage
☆─────────────────────────────────────☆
iTrade (铅笔) 于 (Wed Jul 13 00:03:06 2011, 美东) 提到:
RIM呢,呵呵
☆─────────────────────────────────────☆
iTrade (铅笔) 于 (Wed Jul 13 00:04:38 2011, 美东) 提到:
Yes, could have severe survival bias problem here
☆─────────────────────────────────────☆
cocojumbo (Nick) 于 (Wed Jul 13 00:17:42 2011, 美东) 提到:
you might also consider liquidity premium.
there are lots of small names that you can have
great backtest results but almost not tradable in
real time because they are not liquid enough.
even with that, 95% hit ratio sounds too good.
☆─────────────────────────────────────☆
JeffVanGundy (专业NBA解说员) 于 (Wed Jul 13 00:18:11 2011, 美东) 提到:
这个太牛了,一般模型翻倍就不错了
☆─────────────────────────────────────☆
SuperString (小芝麻和小包包他爹) 于 (Wed Jul 13 00:20:04 2011, 美东) 提到:
95% 确实太高了点。
楼主上次发布到现在也有阵子了
forward testing怎么样?
☆─────────────────────────────────────☆
cocojumbo (Nick) 于 (Wed Jul 13 00:23:07 2011, 美东) 提到:
real model with 58% hit ratio would be good enough.
95% is like .....
☆─────────────────────────────────────☆
bobcat2010 (bobcat2010) 于 (Wed Jul 13 00:40:20 2011, 美东) 提到:
胜率是高了些,你若能列出逐年回报率,我也许能粗略判断你的系统有无严重问题。
最好给出平均持有时间,只说2-7天信息太少了。这样可以估计买卖损耗。
另外你是多空两面做吗?
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Wed Jul 13 01:06:56 2011, 美东) 提到:
5月份贴的胜率是可能交易的胜率,不是实际交易的胜率,我最近测试胜率在87%左右。
系统是short term momentum play, 只做多。 做空还没加进去。每年的回报率如下,
帮看看有没有什么问题
year_end/year_begin-1
2001 204%
2002 76.58%
2003 126%
2004 84.8%
2005 134.7%
2006 162.6%
2007 126%
2008 84.5%
2009 296%
2010 55.9%
2011till may 35%
☆─────────────────────────────────────☆
iTrade (铅笔) 于 (Wed Jul 13 01:16:42 2011, 美东) 提到:
如果你只做多的话要仔细考虑下SURVIVAL BIAS的影响,可能很大
另外把pnl按照盘子大小分类统计下,看看到底多少来自小盘子股票。
你的胜率太高,高的不想真的
☆─────────────────────────────────────☆
Fine (蛋定) 于 (Wed Jul 13 01:17:33 2011, 美东) 提到:
太牛了。你的position sizing是怎么做的。能否贴一两个trade出来看看?
☆─────────────────────────────────────☆
bobcat2010 (bobcat2010) 于 (Wed Jul 13 02:21:17 2011, 美东) 提到:
从回报分布来看,你的程序应该没有什么问题,动量系统达到这样的回报是完全可能的
。87%的胜率说明你很可能止赢很快,亏了的话就在第7天时止时。此外由于spread的原
因那87%的胜率要打折扣。但感觉上还是高了点,再仔细检查检查吧。消除几天数据看
看以前的信号变了没有?
假设你的平均持有天数为4,每个双向交易的成本为0.4%,大致每天0.1%。
年回报100%相当于日回报0.2776%,(近似)减去0.1%,还剩0.1776%,折回年回报为55.8%。
股票摘牌也是个问题,但这方面动量操作较均归操作风险小些。
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Wed Jul 13 02:42:16 2011, 美东) 提到:
请教下pnl是什么?
胜率不是最重要的,像版上很多高手说的,主要是获胜交易盈利和亏损交易的亏损比例
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Wed Jul 13 02:43:28 2011, 美东) 提到:
一直在忙毕业,还没时间弄这个
☆─────────────────────────────────────☆
SwingMan (I Love Swing) 于 (Wed Jul 13 02:48:49 2011, 美东) 提到:
从你的分析看你应该是个做系统的高手,实时交易应该会打一些折扣。
请问一下你说“每个双向交易的成本为0.4%”, 这个成本是怎么算的,是算的交易费
之类的吗?
☆─────────────────────────────────────☆
bobcat2010 (bobcat2010) 于 (Wed Jul 13 03:03:21 2011, 美东) 提到:
这只是估计。做动量的一般不能做市,所以要付进出差价。这些还与你的单的大小有关
,大单往往会推动股价。然后就是手续费,这个因人而异,交易越频繁越有资格要求低
佣金。
你的做多系统01年的回报为204%,也许有人不信。替你说一句:
虽是熊市,01年动量做多操作非常有利。
☆─────────────────────────────────────☆
xiangfin (justfin) 于 (Wed Jul 13 04:12:42 2011, 美东) 提到:
You may filter out stocks with price under 5$ and/or daily volume below 300k
. This filtering will make your trade executions closer to realistic.
☆─────────────────────────────────────☆
caoy (caoy) 于 (Wed Jul 13 04:18:34 2011, 美东) 提到:
空说没用,发2011年的交易记录就行了,模拟的也行
按照这个基本格式:
股票代码 买入时间 买入价格 买入数量 卖出时间 卖出价格 |
|