五日收益率算不出来
由yjz_quanter创建,最终由small_q 被浏览 22 用户
%%sql SELECT date, instrument, close, open, close/m_lag(close,1) as cr, (close / LAG(close, 5) OVER (PARTITION BY instrument ORDER BY date))-1 AS change_ratio_5d, PERCENT_RANK() OVER (PARTITION BY date ORDER BY change_ratio_5d ASC) AS percentile_rank_cr5d
FROM cn_stock_bar1d WHERE date = '2023-12-20'