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

Hello, I'm trying to set up a shorting strategy where:

  1. Sell (short) a stock at the end of the day if it has increased more than X% in the same day.
  2. Take profit (buy) at Y%.
  3. If Y is not met, sell in Z days.

I'm just starting out with coding and have found it confusing to set up these parameters. Thank you for your help!

Ben.

2 responses

Ben, You may want to look over the attached algorithm. I THINK it's what you may be trying to do but I didn't do a lot of troubleshooting.

Good luck.

Thanks so much Dan! That gives me a great starting point, also thank you for all the comments so I understand what is happening along the way. I'm now trying to filter out to select only stocks that are in the NYSE or NASDAQ, and small cap (I'll try this on micro cap as well eventually). Also I want to spend no more than $900 on any position. Any help would be much appreciated. Thanks again for your help!
-Ben