l*******r 发帖数: 3799 | 1 常用的TA指标一般只能反应一个方面,比如RSI适合超卖超买, ADX适合趋势强弱,AD/
DC line衡量money flow. 但很少有指标能够反应一个股票走势的多个方面。 比如
trend follower一般会说强势股的短期调整是买点(比如SNDK/ILMN/TIE之类的),但如
何设计一个指标来反应呢?
我们可以定义一个非常简单的指标:
A: today's close在过去p天close里的percentile
B: today's close在过去q天close里的percentile
indicator = (A + (1 - B)) / 2
在这里p = 252(相当于一个calendar year的交易日), q = 10, 这两个参数只是直观
选择的,没有经过任何优化。
进出点的选择是
Long if indicator > 0.5
Short if indicator < 0.5
基本的概念是,underlying equity有着很强的长期趋势 (large A),但短期有
pullback (small B).
经过测试,这个indicator在SP500 |
p********9 发帖数: 3732 | |
a****b 发帖数: 3588 | |
E*******r 发帖数: 2723 | |
g******4 发帖数: 1715 | 5 lyrist 大牛: It certainly is the greatest indicator in the world. But can
you tell us whether it will be up or down in next 2 days?
【在 l*******r 的大作中提到】 : 常用的TA指标一般只能反应一个方面,比如RSI适合超卖超买, ADX适合趋势强弱,AD/ : DC line衡量money flow. 但很少有指标能够反应一个股票走势的多个方面。 比如 : trend follower一般会说强势股的短期调整是买点(比如SNDK/ILMN/TIE之类的),但如 : 何设计一个指标来反应呢? : 我们可以定义一个非常简单的指标: : A: today's close在过去p天close里的percentile : B: today's close在过去q天close里的percentile : indicator = (A + (1 - B)) / 2 : 在这里p = 252(相当于一个calendar year的交易日), q = 10, 这两个参数只是直观 : 选择的,没有经过任何优化。
|
l*******r 发帖数: 3799 | 6 No. No one can do that :)
【在 g******4 的大作中提到】 : lyrist 大牛: It certainly is the greatest indicator in the world. But can : you tell us whether it will be up or down in next 2 days?
|
d*****n 发帖数: 450 | 7
这个啥意思,是指占q天close总和的percentile?
【在 l*******r 的大作中提到】 : 常用的TA指标一般只能反应一个方面,比如RSI适合超卖超买, ADX适合趋势强弱,AD/ : DC line衡量money flow. 但很少有指标能够反应一个股票走势的多个方面。 比如 : trend follower一般会说强势股的短期调整是买点(比如SNDK/ILMN/TIE之类的),但如 : 何设计一个指标来反应呢? : 我们可以定义一个非常简单的指标: : A: today's close在过去p天close里的percentile : B: today's close在过去q天close里的percentile : indicator = (A + (1 - B)) / 2 : 在这里p = 252(相当于一个calendar year的交易日), q = 10, 这两个参数只是直观 : 选择的,没有经过任何优化。
|
E*******r 发帖数: 2723 | 8 最近在摸索自己的indicator, 这个帖非常有启发性,再谢! |
l*******r 发帖数: 3799 | 9 比如 之前 5天的close是 1,2,3,4,5, 今天close是2.5, 那么这个值就是 2/ 5 = 0.4
【在 d*****n 的大作中提到】 : : 这个啥意思,是指占q天close总和的percentile?
|
d*****n 发帖数: 450 | 10 不好意思还是没看懂,为啥是2/5呢?
4
【在 l*******r 的大作中提到】 : 比如 之前 5天的close是 1,2,3,4,5, 今天close是2.5, 那么这个值就是 2/ 5 = 0.4
|
|
|
g*****u 发帖数: 14294 | |
d*****n 发帖数: 450 | 12 按百分位是不是应该把当天算进去啊?2,2.5,3,4,5?
【在 d*****n 的大作中提到】 : 不好意思还是没看懂,为啥是2/5呢? : : 4
|
l*******r 发帖数: 3799 | 13 就是rank吧,
因为前5天有两天close小于今天的close
【在 d*****n 的大作中提到】 : 不好意思还是没看懂,为啥是2/5呢? : : 4
|
c******n 发帖数: 4965 | 14 你这个就是MACD 一样的想法,
说白了就是二阶导数( stochastic 函数的"导数“ )
只不过你用percentile, MACD 是EMA
你取percentile 实际上是把EMA 去掉,换另一个能抛除太远outlier 的data,
如果改一下EMA 加强center 的权重,估计有类似的效果
【在 l*******r 的大作中提到】 : 常用的TA指标一般只能反应一个方面,比如RSI适合超卖超买, ADX适合趋势强弱,AD/ : DC line衡量money flow. 但很少有指标能够反应一个股票走势的多个方面。 比如 : trend follower一般会说强势股的短期调整是买点(比如SNDK/ILMN/TIE之类的),但如 : 何设计一个指标来反应呢? : 我们可以定义一个非常简单的指标: : A: today's close在过去p天close里的percentile : B: today's close在过去q天close里的percentile : indicator = (A + (1 - B)) / 2 : 在这里p = 252(相当于一个calendar year的交易日), q = 10, 这两个参数只是直观 : 选择的,没有经过任何优化。
|
d*****n 发帖数: 450 | 15 哦,懂了
【在 l*******r 的大作中提到】 : 就是rank吧, : 因为前5天有两天close小于今天的close
|
l*******r 发帖数: 3799 | 16 关键是要用rank, 这个比用SMA/EMA对噪音有更大的容忍程度。
【在 c******n 的大作中提到】 : 你这个就是MACD 一样的想法, : 说白了就是二阶导数( stochastic 函数的"导数“ ) : 只不过你用percentile, MACD 是EMA : 你取percentile 实际上是把EMA 去掉,换另一个能抛除太远outlier 的data, : 如果改一下EMA 加强center 的权重,估计有类似的效果
|
l*******r 发帖数: 3799 | 17 哎,具体怎么算,自己决定吧。。。
只是一个idea, 个人都可以发挥。。
【在 d*****n 的大作中提到】 : 按百分位是不是应该把当天算进去啊?2,2.5,3,4,5?
|
y***q 发帖数: 4147 | |
c******n 发帖数: 4965 | 19 你还是更写明白一点
indicator = percentile_long_term - percentile_short_term
这要是用到上升trend 结束开始下跌, 你这个东西害死人了,
percentile_long_term 一直100% 左右, short_term_percentile 很快降到0 , 然后
你indicator 长时间保持long , 直到回调
【在 l*******r 的大作中提到】 : 关键是要用rank, 这个比用SMA/EMA对噪音有更大的容忍程度。
|
l*******r 发帖数: 3799 | 20 I don't wanna argue with you. This is just an idea.
Did I say this indicator is a silver bullet?
【在 c******n 的大作中提到】 : 你还是更写明白一点 : indicator = percentile_long_term - percentile_short_term : 这要是用到上升trend 结束开始下跌, 你这个东西害死人了, : percentile_long_term 一直100% 左右, short_term_percentile 很快降到0 , 然后 : 你indicator 长时间保持long , 直到回调
|
|
|
m********0 发帖数: 2717 | 21 why rank is more noise-tolerable?
【在 l*******r 的大作中提到】 : 关键是要用rank, 这个比用SMA/EMA对噪音有更大的容忍程度。
|
m********0 发帖数: 2717 | 22 问两点:
测试的时候,
profit 有没有reinvestment?
loss以后有没有补齐本金?
【在 l*******r 的大作中提到】 : 常用的TA指标一般只能反应一个方面,比如RSI适合超卖超买, ADX适合趋势强弱,AD/ : DC line衡量money flow. 但很少有指标能够反应一个股票走势的多个方面。 比如 : trend follower一般会说强势股的短期调整是买点(比如SNDK/ILMN/TIE之类的),但如 : 何设计一个指标来反应呢? : 我们可以定义一个非常简单的指标: : A: today's close在过去p天close里的percentile : B: today's close在过去q天close里的percentile : indicator = (A + (1 - B)) / 2 : 在这里p = 252(相当于一个calendar year的交易日), q = 10, 这两个参数只是直观 : 选择的,没有经过任何优化。
|
l*******r 发帖数: 3799 | 23 reinvest all
没有补本金
Assume no friction.
【在 m********0 的大作中提到】 : 问两点: : 测试的时候, : profit 有没有reinvestment? : loss以后有没有补齐本金?
|
l*******r 发帖数: 3799 | 24 I did some test.
Just like median is better than mean ...
【在 m********0 的大作中提到】 : why rank is more noise-tolerable?
|
b********y 发帖数: 5829 | 25 of course, less distorted by outliers
【在 l*******r 的大作中提到】 : I did some test. : Just like median is better than mean ...
|
m********0 发帖数: 2717 | 26 reinvest all有点aggressive。
这样一来,back test 20年,出1000%+的return很容易。
一般backtest貌似是维持本金的,但不追加投资。
另外你怎么model transaction cost和commission的?
【在 l*******r 的大作中提到】 : reinvest all : 没有补本金 : Assume no friction.
|
l*******r 发帖数: 3799 | 27 Just some simple test. Based on my reading, most backtests are done in this
way. Sure, there would be better ways to manage risks. I am testing a few
ones :)
【在 m********0 的大作中提到】 : reinvest all有点aggressive。 : 这样一来,back test 20年,出1000%+的return很容易。 : 一般backtest貌似是维持本金的,但不追加投资。 : 另外你怎么model transaction cost和commission的?
|
b********y 发帖数: 5829 | 28 agree, 如果用sp500做benchmark,怎么可能不假设reinvest?都是compound return
this
few
【在 l*******r 的大作中提到】 : Just some simple test. Based on my reading, most backtests are done in this : way. Sure, there would be better ways to manage risks. I am testing a few : ones :)
|
m********0 发帖数: 2717 | 29 I don't think so.
most of the back testings I see do not reinvest in full.
【在 b********y 的大作中提到】 : agree, 如果用sp500做benchmark,怎么可能不假设reinvest?都是compound return : : this : few
|
b********y 发帖数: 5829 | 30 要看time horizon吧?短期的应该没问题,长期的话不reinvest难以理解。。。
【在 m********0 的大作中提到】 : I don't think so. : most of the back testings I see do not reinvest in full.
|
|
|
p***n 发帖数: 1987 | 31 LZ估计是要回测对p,g值优化。
【在 d*****n 的大作中提到】 : 哦,懂了
|
l*******r 发帖数: 3799 | 32 come on. no any optimization
just an idea.
is it necessary for me to cheat u guys here ?
【在 p***n 的大作中提到】 : LZ估计是要回测对p,g值优化。
|
b********y 发帖数: 5829 | 33 这个percentile是指rank?也就是说每天收盘后得把过去200多天的价格sort一遍?
【在 l*******r 的大作中提到】 : come on. no any optimization : just an idea. : is it necessary for me to cheat u guys here ?
|
g*********o 发帖数: 4653 | |
r*****t 发帖数: 7278 | |
l*******r 发帖数: 3799 | 36 Yes.
价格sort一遍?
【在 b********y 的大作中提到】 : 这个percentile是指rank?也就是说每天收盘后得把过去200多天的价格sort一遍?
|
e*******r 发帖数: 355 | 37 学习中,太感谢了。
【在 l*******r 的大作中提到】 : 常用的TA指标一般只能反应一个方面,比如RSI适合超卖超买, ADX适合趋势强弱,AD/ : DC line衡量money flow. 但很少有指标能够反应一个股票走势的多个方面。 比如 : trend follower一般会说强势股的短期调整是买点(比如SNDK/ILMN/TIE之类的),但如 : 何设计一个指标来反应呢? : 我们可以定义一个非常简单的指标: : A: today's close在过去p天close里的percentile : B: today's close在过去q天close里的percentile : indicator = (A + (1 - B)) / 2 : 在这里p = 252(相当于一个calendar year的交易日), q = 10, 这两个参数只是直观 : 选择的,没有经过任何优化。
|