Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Please help with Long/short re-balancing

Please help a long/short re balancing algo
Short AAPL
Long AMZN

re-balance each month to have both stocks equally weighted at 50% each

Thanks
Brandon

2 responses

Here you go. Not the most elegant code maybe but it does the trick. Cloned and modified from one of the tutorial algos.

Personally I doubt if this will do as well going forward.

Thanks Joakim. I have trouble re-balancing with a longer time frame such as every year or 5 year instead of monthly . Can you please help?

Thanks