Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
average time interval of price increase

This idea originates from the observation that stock prices generally possess some periodicity. To better use this phenomenon, especially when the stock prices are rising in general, I decided to use the average time interval of price increase. When currently the prices have been increasing for longer than the average time, we should sell it. Otherwise, if we observe a price drop sooner than the average price increase time, we would expect the price to continue to increase but would have to set a condition: in this case, I assume the price has dropped for three times before it reaches the average time interval, we would sell the stock anyway. (This is where the variable "counter" comes into play).
Note this strategy is not suitable for 2013 because Apple's stock price has been dropping consistently. This limit certainly means that the algo is not perfect so I'm open to any suggestions. Thanks.