Alpha158因子构建公式
由bigquantfactorbuilder1创建,最终由bigquantfactorbuilder1 被浏览 1 用户
Alpha158 因子总览(共158个)
来源:微软 Qlib 官方 Alpha158,日频 OHLCV 价量因子。文档链接:https://bigquant.com/wiki/doc/nODcNAKYPJ
一、K线基础因子(9个)
- KMID = (close-open)/open —— 实体涨跌幅
- KLEN = (high-low)/open —— 日内振幅
- KMID2 = (close-open)/(high-low+1e-12) —— 实体占比
- KUP = (high-max(open,close))/open —— 上影线比例
- KUP2 = (high-max(open,close))/(high-low+1e-12) —— 上影线占振幅比
- KLOW = (min(open,close)-low)/open —— 下影线比例
- KLOW2 = (min(open,close)-low)/(high-low+1e-12) —— 下影线占振幅比
- KSFT = (2*close-high-low)/open —— 日内重心偏移
- KSFT2 = (2*close-high-low)/(high-low+1e-12) —— 重心偏移占振幅比
二、价格比因子(4个)
- OPEN0 = open/close —— 开盘相对收盘
- HIGH0 = high/close —— 最高相对收盘
- LOW0 = low/close —— 最低相对收盘
- VWAP0 = vwap/close —— 均价相对收盘
三、成交量比因子(4个)
- VOLUME0 = volume/(volume+1e-12) —— 成交量归一
- VOLUME1 = volume/mean(volume,5) —— 成交量相对5日均量
- VOLUME2 = volume/mean(volume,10) —— 成交量相对10日均量
- VOLUME3 = volume/mean(volume,20) —— 成交量相对20日均量
四、价格滚动因子(5日/10日/20日/30日/60日,共5×15=75个)
(1)均值类(MA)
- MA5 = mean(close,5)/close —— 5日均价相对收盘
- MA10 = mean(close,10)/close —— 10日均价相对收盘
- MA20 = mean(close,20)/close —— 20日均价相对收盘
- MA30 = mean(close,30)/close —— 30日均价相对收盘
- MA60 = mean(close,60)/close —— 60日均价相对收盘
(2)标准差类(STD)
- STD5 = std(close,5)/mean(close,5) —— 5日波动率
- STD10 = std(close,10)/mean(close,10) —— 10日波动率
- STD20 = std(close,20)/mean(close,20) —— 20日波动率
- STD30 = std(close,30)/mean(close,30) —— 30日波动率
- STD60 = std(close,60)/mean(close,60) —— 60日波动率
(3)涨幅类(ROC)
- ROC5 = (close-delay(close,5))/delay(close,5) —— 5日收益率
- ROC10 = (close-delay(close,10))/delay(close,10) —— 10日收益率
- ROC20 = (close-delay(close,20))/delay(close,20) —— 20日收益率
- ROC30 = (close-delay(close,30))/delay(close,30) —— 30日收益率
- ROC60 = (close-delay(close,60))/delay(close,60) —— 60日收益率
(4)最高相对类(HIGH_RET)
- HIGH5 = (high-delay(close,5))/delay(close,5) —— 5日最高相对期初
- HIGH10 = (high-delay(close,10))/delay(close,10) —— 10日最高相对期初
- HIGH20 = (high-delay(close,20))/delay(close,20) —— 20日最高相对期初
- HIGH30 = (high-delay(close,30))/delay(close,30) —— 30日最高相对期初
- HIGH60 = (high-delay(close,60))/delay(close,60) —— 60日最高相对期初
(5)最低相对类(LOW_RET)
- LOW5 = (low-delay(close,5))/delay(close,5) —— 5日最低相对期初
- LOW10 = (low-delay(close,10))/delay(close,10) —— 10日最低相对期初
- LOW20 = (low-delay(close,20))/delay(close,20) —— 20日最低相对期初
- LOW30 = (low-delay(close,30))/delay(close,30) —— 30日最低相对期初
- LOW60 = (low-delay(close,60))/delay(close,60) —— 60日最低相对期初
(6)偏度类(SKEW)
- SKEW5 = skew(close,5) —— 5日价格偏度
- SKEW10 = skew(close,10) —— 10日价格偏度
- SKEW20 = skew(close,20) —— 20日价格偏度
- SKEW30 = skew(close,30) —— 30日价格偏度
- SKEW60 = skew(close,60) —— 60日价格偏度
(7)峰度类(KURT)
- KURT5 = kurt(close,5) —— 5日价格峰度
- KURT10 = kurt(close,10) —— 10日价格峰度
- KURT20 = kurt(close,20) —— 20日价格峰度
- KURT30 = kurt(close,30) —— 30日价格峰度
- KURT60 = kurt(close,60) —— 60日价格峰度
(8)成交量均值类(VMA)
- VMA5 = mean(volume,5)/volume —— 5日量均相对当前
- VMA10 = mean(volume,10)/volume —— 10日量均相对当前
- VMA20 = mean(volume,20)/volume —— 20日量均相对当前
- VMA30 = mean(volume,30)/volume —— 30日量均相对当前
- VMA60 = mean(volume,60)/volume —— 60日量均相对当前
(9)成交量标准差类(VSTD)
- VSTD5 = std(volume,5)/mean(volume,5) —— 5日量波动率
- VSTD10 = std(volume,10)/mean(volume,10) —— 10日量波动率
- VSTD20 = std(volume,20)/mean(volume,20) —— 20日量波动率
- VSTD30 = std(volume,30)/mean(volume,30) —— 30日量波动率
- VSTD60 = std(volume,60)/mean(volume,60) —— 60日量波动率
(10)量价相关类(CORR)
- CORR5 = corr(close,volume,5) —— 5日量价相关系数
- CORR10 = corr(close,volume,10) —— 10日量价相关系数
- CORR20 = corr(close,volume,20) —— 20日量价相关系数
- CORR30 = corr(close,volume,30) —— 30日量价相关系数
- CORR60 = corr(close,volume,60) —— 60日量价相关系数
(11)相对强弱(RSV)
- RSV5 = (close-min(low,5))/(max(high,5)-min(low,5)+1e-12) —— 5日RSV
- RSV10 = (close-min(low,10))/(max(high,10)-min(low,10)+1e-12) —— 10日RSV
- RSV20 = (close-min(low,20))/(max(high,20)-min(low,20)+1e-12) —— 20日RSV
- RSV30 = (close-min(low,30))/(max(high,30)-min(low,30)+1e-12) —— 30日RSV
- RSV60 = (close-min(low,60))/(max(high,60)-min(low,60)+1e-12) —— 60日RSV
(12)布林中轨(BOLL)
- BOLL5 = (close-mean(close,5))/std(close,5) —— 5日布林位置
- BOLL10 = (close-mean(close,10))/std(close,10) —— 10日布林位置
- BOLL20 = (close-mean(close,20))/std(close,20) —— 20日布林位置
- BOLL30 = (close-mean(close,30))/std(close,30) —— 30日布林位置
- BOLL60 = (close-mean(close,60))/std(close,60) —— 60日布林位置
(13)乖离率(BIAS)
- BIAS5 = (close-mean(close,5))/mean(close,5) —— 5日乖离率
- BIAS10 = (close-mean(close,10))/mean(close,10) —— 10日乖离率
- BIAS20 = (close-mean(close,20))/mean(close,20) —— 20日乖离率
- BIAS30 = (close-mean(close,30))/mean(close,30) —— 30日乖离率
- BIAS60 = (close-mean(close,60))/mean(close,60) —— 60日乖离率
(14)价格分位数(QTL)
- QTL5 = quantile(close,5,0.5) —— 5日价格中位数
- QTL10 = quantile(close,10,0.5) —— 10日价格中位数
- QTL20 = quantile(close,20,0.5) —— 20日价格中位数
- QTL30 = quantile(close,30,0.5) —— 30日价格中位数
- QTL60 = quantile(close,60,0.5) —— 60日价格中位数
(15)成交量分位数(VQTL)
- VQTL5 = quantile(volume,5,0.5) —— 5日量中位数
- VQTL10 = quantile(volume,10,0.5) —— 10日量中位数
- VQTL20 = quantile(volume,20,0.5) —— 20日量中位数
- VQTL30 = quantile(volume,30,0.5) —— 30日量中位数
- VQTL60 = quantile(volume,60,0.5) —— 60日量中位数
五、量价衍生因子(26个)
- TVMA5 = mean(volume*close,5)/mean(volume,5) —— 5日成交均价
- TVMA10 = mean(volume*close,10)/mean(volume,10) —— 10日成交均价
- TVMA20 = mean(volume*close,20)/mean(volume,20) —— 20日成交均价
- TVMA30 = mean(volume*close,30)/mean(volume,30) —— 30日成交均价
- TVMA60 = mean(volume*close,60)/mean(volume,60) —— 60日成交均价
- PCT_CHG5 = (close-delay(close,5))/delay(close,5) —— 5日涨跌幅(同ROC5)
- PCT_CHG10 = (close-delay(close,10))/delay(close,10) —— 10日涨跌幅(同ROC10)
- PCT_CHG20 = (close-delay(close,20))/delay(close,20) —— 20日涨跌幅(同ROC20)
- PCT_CHG30 = (close-delay(close,30))/delay(close,30) —— 30日涨跌幅(同ROC30)
- PCT_CHG60 = (close-delay(close,60))/delay(close,60) —— 60日涨跌幅(同ROC60)
- MAX_HIGH5 = max(high,5)/close —— 5日最高相对当前收盘
- MAX_HIGH10 = max(high,10)/close —— 10日最高相对当前收盘
- MAX_HIGH20 = max(high,20)/close —— 20日最高相对当前收盘
- MAX_HIGH30 = max(high,30)/close —— 30日最高相对当前收盘
- MAX_HIGH60 = max(high,60)/close —— 60日最高相对当前收盘
- MIN_LOW5 = min(low,5)/close —— 5日最低相对当前收盘
- MIN_LOW10 = min(low,10)/close —— 10日最低相对当前收盘
- MIN_LOW20 = min(low,20)/close —— 20日最低相对当前收盘
- MIN_LOW30 = min(low,30)/close —— 30日最低相对当前收盘
- MIN_LOW60 = min(low,60)/close —— 60日最低相对当前收盘
- RANGE5 = (max(high,5)-min(low,5))/mean(close,5) —— 5日价格区间
- RANGE10 = (max(high,10)-min(low,10))/mean(close,10) —— 10日价格区间
- RANGE20 = (max(high,20)-min(low,20))/mean(close,20) —— 20日价格区间
- RANGE30 = (max(high,30)-min(low,30))/mean(close,30) —— 30日价格区间
- RANGE60 = (max(high,60)-min(low,60))/mean(close,60) —— 60日价格区间
六、回归与残差因子(15个)
- BETA5 = regbeta(close,sequence(5)) —— 5日价格趋势斜率
- BETA10 = regbeta(close,sequence(10)) —— 10日价格趋势斜率
- BETA20 = regbeta(close,sequence(20)) —— 20日价格趋势斜率
- BETA30 = regbeta(close,sequence(30)) —— 30日价格趋势斜率
- BETA60 = regbeta(close,sequence(60)) —— 60日价格趋势斜率
- RSQR5 = regrsqr(close,sequence(5)) —— 5日回归R²
- RSQR10 = regrsqr(close,sequence(10)) —— 10日回归R²
- RSQR20 = regrsqr(close,sequence(20)) —— 20日回归R²
- RSQR30 = regrsqr(close,sequence(30)) —— 30日回归R²
- RSQR60 = regrsqr(close,sequence(60)) —— 60日回归R²
- RESID5 = regresid(close,sequence(5)) —— 5日回归残差
- RESID10 = regresid(close,sequence(10)) —— 10日回归残差
- RESID20 = regresid(close,sequence(20)) —— 20日回归残差
- RESID30 = regresid(close,sequence(30)) —— 30日回归残差
- RESID60 = regresid(close,sequence(60)) —— 60日回归残差
七、动量与反转因子(11个)
- MOM5 = close-delay(close,5) —— 5日价格动量
- MOM10 = close-delay(close,10) —— 10日价格动量
- MOM20 = close-delay(close,20) —— 20日价格动量
- MOM30 = close-delay(close,30) —— 30日价格动量
- MOM60 = close-delay(close,60) —— 60日价格动量
- REV5 = -1 * (close-delay(close,5)) —— 5日价格反转
- REV10 = -1 * (close-delay(close,10)) —— 10日价格反转
- REV20 = -1 * (close-delay(close,20)) —— 20日价格反转
- REV30 = -1 * (close-delay(close,30)) —— 30日价格反转
- REV60 = -1 * (close-delay(close,60)) —— 60日价格反转
- VOL_MOM5 = volume-delay(volume,5) —— 5日成交量动量
八、波动率与流动性因子(15个)
- VOLATILITY5 = std(close,5) —— 5日价格波动率
- VOLATILITY10 = std(close,10) —— 10日价格波动率
- VOLATILITY20 = std(close,20) —— 20日价格波动率
- VOLATILITY30 = std(close,30) —— 30日价格波动率
- VOLATILITY60 = std(close,60) —— 60日价格波动率
- LIQUIDITY5 = mean(volume,5)/std(volume,5) —— 5日流动性
- LIQUIDITY10 = mean(volume,10)/std(volume,10) —— 10日流动性
- LIQUIDITY20 = mean(volume,20)/std(volume,20) —— 20日流动性
- LIQUIDITY30 = mean(volume,30)/std(volume,30) —— 30日流动性
- LIQUIDITY60 = mean(volume,60)/std(volume,60) —— 60日流动性
- AMOUNT5 = mean(volume*close,5) —— 5日成交金额均值
- AMOUNT10 = mean(volume*close,10) —— 10日成交金额均值
- AMOUNT20 = mean(volume*close,20) —— 20日成交金额均值
- AMOUNT30 = mean(volume*close,30) —— 30日成交金额均值
- AMOUNT60 = mean(volume*close,60) —— 60日成交金额均值
说明
$open/$high/$low/$close/$volume为当日价量;delay(x,n)为滞后n日;mean/std/corr/skew/kurt/quantile/regbeta/regrsqr/regresid为滚动窗口统计;1e-12防止除零。- 所有因子均为纯时间序列、无截面依赖,适配机器学习模型输入。
\