I don't understand why the algorithm isn't going long at any point, please help.
I don't understand why the algorithm isn't going long at any point, please help.
Try changing lines 40 and 41 to:
longs = filter_.percentile_between(70, 99.99, mask = filter_1)
shorts = filter_.percentile_between(0.01, 30, mask = filter_1)
For some reason, when you use 100 as an upper bound for the percentile_between
's upper parameter, it is causes a problem (note it also causes a problem if you use 0 as the lower bound). It may be due to null values in the filter_
column