Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Attempt 1 for Tuesday

This one should work, probably needs a fair bit of fine tuning though