Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
To sell or not to sell in moving averages-pe ratio algorithm

I am a newbie and implemented 2 algorithms combining moving averages and PE-Raatio . The first case I sell the shares if don't satisfy a PE ratio limit and in the second case, I do not sell them. Accordingly, the returns should be higher if I am selling the stocks not performing and should get a higher return but the reverse is happening. Is it purely luck or I am missing some important point? Attached here is backtest for algorithm in which I do not sell the stock. The algorithm in which I sell the stocks give me return of -0.3%.