ayush refferef revenue - kitzz03/WorldQuant-Alphas GitHub Wiki
slope = ts_regression(fnd6_newqv1300_drcq,step(1),252,rettype=2);
slope_std = ts_regression(fnd6_newqv1300_drcq,step(1),252,rettype=8);
event=rank(slope/slope_std)>0.51 || rank(slope/slope_std)<0.49;
close_at_event = trade_when(event, close, -1);
alpha = trade_when(event, zscore(slope/slope_std), abs(close - close_at_event) / close_at_event > .1);
alpha