I've tried to create a basic algorithm using roa, roe and pe ratio as filters. I used the structure of an algorithm from one of the pipeline tutorials but I think I messed the algo a bit. I believe that I have some logic errors as thee algorithm doesn't pace trades... Also, I receive an error regarding dividing float by 0 in this: picks_weight = context.long_leverage/ len(context.picks) --> so I think context.picks is by mistake 0 even though it should contain the number of stocks that respect the criteria.
Please help!