Back to Community
Alphalens to Algo

Hey everyone, this is my first shot at this. I have created a full Alphalens tearsheet for a basic Long/Short strategy of buying the top performers of the past week and selling the worst performers. I'm fully aware this doesn't perform too well but just trying to get some experience. I have two questions to start with:

1) How would I change the code so that I would sell the top performers and buy the worst performers (the reverse)?
2) How would I go about converting this strategy into an algorithm?

Thanks!

Loading notebook preview...
2 responses

1) May be you can change your factor to '(-)weekly_return' (negative values). That way you don't need to worry about selling top performers.

Thank you!