计算每只股票的日收益率:ret = close / 前一交易日的 close - 1。
- “前一交易日”指同一
ticker按date排序后的上一行。 - 每只股票的第一行
ret为 null。 - 不能跳过 null:某一天
close为 null 时,这一天的ret为 null,下一天的ret也为 null(它的前一交易日收盘价是 null);不要用更早的收盘价代替,也不要把 null 当作 0。 - 表里的行不保证有序。
输入
prices(ticker, date, open, high, low, close, volume)
输出
列为 ticker, date, ret,每行输入对应一行输出,行顺序不限。