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

I am trying to make an algorithm where if the price of a security drops a certain amount, say 20%, then buy, and once it has increased a certain amount, say 30%, from the price I bought it at, then sell it. I am new to this so if someone could show me how to do this it would be very appreciated!