Hi everyone,
I've written my first algo and I'd love some feedback on how to make it more robust. This is really only proof-of-concept. This algo is interesting because it has so little to do with previous data, which makes it difficult to backtest.
Here's a little bit about what I did:
This algorithm is grounded in the idea that news drives markets. So what I did is used news to predict the immediate future market movements. To do this, I used an API that queries a string and returns a probability vector of sentiments (Check it out: http://text-processing.com/docs/sentiment.html). Very often, these sentiments would line up close to each other and that simply means we don't act on the data-- why act if you're not sure?
So how are we sure? We find a significant difference between the positive and negative sentiment components. I arbitrarily chose 0.2 as the difference cap, meaning we need the absolute difference between the positive and negative values to be at least 0.2. There's a caveat brought up by the other factor, neutrality. If the neutral component is very high, I consider that "too noisy" and chose not to act on the data in a similar fashion. The cap for neutral is at most 0.75.
Once we've found what we want to trade on, we trade on it at the rate of cash we have multiplied by the difference. This lets more significant differences have a bigger representations, and since negative differences are also possible, we short those.
After a few hacky techniques, violia: it's runnable.
So what's next?
I have a ticker parser ready to accept an article. It would be wonderful to get data from the web, but it's a steep challenge. Also, selling after a week would be prudent to implement, along with limiting the frequency of the algorithm.
Let me know what you think, and of course, happy hacking!