Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Using poisson distribution to predict price change

I thought it would be interesting to see how well the Poisson distribution would do when used to determine changes in stock prices. I count the number of times the price goes up, down, or remains stagnant, than use the results to calculate lambda. I than calculate the probability the price of the stock will go up or down. After checking whether the the change is enough to bet on I calculate the number of share by taking my available cash relative to the price and multiply that by .1 times the difference between the up and down probability. I also used a set universe to try and avoid any bias. I would appreciate any input, critiques, suggestions or just comments.

3 responses

When using a different starting point the algo goes haywire

Algo looks very interesting. Any chance you can add comments to your code so I can easily see the step by step logic?

@Daniel: Thanks for bringing this to my attention. After looking over what the algo I realized I had a few mistakes in my logic. I haven't had much time to play around with it but I've made some changes and it seems like it has worked for the better. Its very volatile however it might lead to something interesting. Feel free to play around with it and give any suggestions, comments or critiques you see fit.

@Joe: Thanks for the kind words man. As I mentioned to Daniel, modified the algo slightly and I tried to add a few comments to make the code easier to decipher. Hope it helps

I'm still thinking of a good way to enter and exit from future/existing trades. As soon as i find some more time on my hands and code up a draft I'll be sure to post it for those interested. Again, don't hesitate to leave comments with suggestions or what have you.