数据抽取(DAI) (v17)start_date和end_date无效
由wuyunjiejie创建,最终由wuyunjiejie 被浏览 19 用户
使用V29模块SQL提取特征如下
SELECT
instrument,
m_avg(close, 20) as _ma,
m_lag(_ma, 3) as _ma_lag3,
m_regr_slope(high, low, 16) as _rsrs_slope,
m_stddev(_rsrs_slope, 300) as _rsrs_slope_std,
m_avg(_rsrs_slope, 300) as _rsrs_slope_mean,
(_rsrs_slope - _rsrs_slope_mean) / _rsrs_slope_std as _rsrs_z,
-- IF(_rsrs_z > 0.7, 1, 0) AS buy_sig,
-- IF(_rsrs_z < -0.7, 1, 0) AS sell_sig,
-- 标准分rsrs分
m_regr_r2(high, low, 16) as _rsrs_r2,
_rsrs_z \* _rsrs_r2 as _rsrs_revise,
-- R方修正标准分rsrs,大于0.7时买入,小于0.7时卖出
-- IF(_rsrs_revise > 0.7, 1, 0) AS buy_sig,
-- IF(_rsrs_revise < -0.7, 1, 0) AS sell_sig,
-- IF(_rsrs_revise > 0.7 and _ma > _ma_lag3 , 1, 0) AS buy_sig,
-- IF(_rsrs_revise < -0.7, 1, 0) AS sell_sig,
-- 右侧修正标准分 = 修正标准分 \* 斜率
_rsrs_revise \* _rsrs_slope AS _rsrs_negative_r,
IF(_rsrs_negative_r > 0.7 and _ma > _ma_lag3 , 1, 0) AS buy_sig,
IF(_rsrs_negative_r < -0.7, 1, 0) AS sell_sig,
-- 日期代码
date
FROM
-- 预计算因子 cn_stock_bar1d https://bigquant.com/data/datasources/cn_stock_bar1d
cn_stock_index_bar1d
-- SQL 模式不会自动join输入数据源, 可以根据需要自由灵活的使用
-- JOIN input_1 USING(date, instrument)
WHERE
-- WHERE 过滤, 在窗口等计算算子之前执行
-- 剔除ST股票
instrument = '000300.SH'
-- 按日期和股票代码排序, 从小到大
ORDER BY date;
如图数据抽取为06-22年数据,但是m3.data.read()输出结果依旧为2020年默认值,请问哪里有问题或者怎么修改?谢谢