I looked at just having this trade...
- not trading... likely some code contradiction
- went to before trading (to see full data set that you then cut and slice as you want)...added a breakpoint on line 84/log.info to see results of long and short list
- both lists are running empty
- looked at code line 80 and 82 and they each create a mutually exclusive sample of stocks (one cannot be in the other...simplistic assumption stemming from 50th percentile usage of daily volume should provide hundreds of stocks)
- looked at 'output' and dataframe shows that each row will have a np.nan in either one or both of the high/low alpha 41 column
- long and short list both created using output.dropna(axis=0). ---the dropna ends up removing entire row if has one nan value, and since 'output' rows have nan in either one or both columns,output.dropna(axis=0) ends up removing every stock from 'output'
- removed dropna and now trading
high_returns = recent_returns.percentile_between(70,100)
low_returns = recent_returns.percentile_between(0,30)
note the low and high returns code of including the extremities of 0 and 100 ends up including the 'one-offs' of 5000% returns or -99.5% losses if you dont either zscore fix it or more simply use like 1.25 / 98.75
please excuse the brevity