So this is the first algorithm i have scratch coded (loosely based on this algorithm - emphasis on loosely) on quantopian and I wanted to post it here for comments as it is clearly less than successful. basically the algorithm works as follows (or was intended to anyway)
- take the ratio of two stocks
- compute the mean and stdev of the ratio over a 30 day look back period
- if the current ratio exceeds some number of standard deviations from the mean go long on the under performer and short on the overachiever.
- position are exited when the ratio return close to the mean again.
so my questions regarding this are two fold.
being new to python is and the platform is that actually what I'm doing?
secondly does the strategy make any sense at all? i.e. are the poor results because of a completely incorrect strategy or because of implementation details?