因子表达式
(if(((sum(high, 20) / 20) < high), (-1 * delta(high, 2)), 0))
问题
Can only compare identically-labeled Series objects
原因分析
(sum(high, 20) / 20) < high 比较时
SUM函数实现:series.groupby(level=‘symbol’).rolling(window=window, min_periods=1).sum().droplevel(0)
导致high序列与SUM计算后的返回序列顺序不一致