请问我想用周频的收益率作为标签,shift(close,n)/shift(close, -1)中的n应该怎么选呢?
请问我想用周频的收益率作为标签,shift(close,n)/shift(close, -1)中的n应该怎么选呢?
adhaha111
(adhaha111)
#3
您好,如果按照您表达式的意思:shift(close_0, -5) / close_0 - 1 可以实现 5 天的收益率,但如果您想要周频的,就得对日线数据进行重采样,得到周线数据再拿到其收益率