views:

207

answers:

3

Who has created a bot to play the stock market and what kind of return did you see? I'm currently still in very alpha stages but I can play the stock market with play money and get some very nice results using historical real time data. Currently I have around 8 parameters that go into configuring the buy and sell function. When I varied these and did a random search, I found one result that got 130% return over 18 trading days. Which is ~7% day. I'm not sure I believe these numbers myself but I would like to know what others have seen in their own bots. I think any inefficiency I find in the stock market could not be exploited for long so I think I would always have to continuously vary the parameters over time with the best results over some past time frame. My strategy is essentially by low over a period of time and sell high. The stocks being processed are pre-selected by me. I select a mix volatile and blue chip stocks. My buy sell function seems to like the volatile stocks though.

Currently I've written it in python and have had crazy ideas of making spin offs such as web services or a phone application. I have a bunch of crazy ideas including open sourcing it and even making something like a folding at home to harness all of our cpu power for our collective trading benefit. None of this will probably happen, I just have wild ideas. Kind of hard to follow through your ideas when working 40+ hours a week.

Anyway if anyone has had success with this I would like to hear what you're willing to share. Such as architecture, programming language used, stock market return, strategies, etc. Also if you don't think it is possible to make a bot that consistently wins I would like to hear your reasons. I have put about 8 months into this project and sometimes I feel like I'm chasing after something that doesn't exist.

+2  A: 

Making a consistently successful bot is extremely difficult (close to impossible) due to the fact that picking stocks based on statistical or technical analysis doesn't always lead to successful results. There is enough human influence so that more is needed. There were people that realized this and began work on a bot that analyzes news articles as well with fairly good results.

Keep in mind, also that many financial institutions use algorithmic trading to pick stocks and make buy/sell orders in very large quantities which affect the market in different ways.

You have to look at many more than 8 parameters for something to be successful enough times to be profitable. Comparison with other companies in the industry is very useful but it's difficult to analyze events in the industry automatically.

But beside that, I like your idea to only stick to a few predefined stocks. It's an interesting concept and probably eases up on the computing resources in analysis but the downside is that you don't get too much information about the future without having industry data.
I'd suggest not releasing your code to the public. At least not your main algorithm. The more people that use it, the less successful it becomes. (Although I'd doubt too many transactions will me made with your code. Financial institutions use advanced mathematical theories for predictions and have lots of people working on it.)

Anyways, I'm interested: How did you get your Python script to get the live data? What place provides an API to do that? Is it free/for pay?

vlad003
Yahoo, Google, and MSN all provide live data streams through their finance web pages. That data isn't encrypted so I was able to use wireshark to monitor traffic and get the data from my program. I realize what I'm doing is frowned upon by those sites. Anyway I also found this after the fact which works relatively well if you poll the data. http://groups.google.com/group/google-finance-apis/browse_thread/thread/d5862f2d06551c23
Xavier
A: 

A single series of historical data is insufficient to demonstrate performance of a trading algorithm (especially one out of many checked against that single series). You might as well ask 256 people to flip a coin 8 times, and predict a random result (e.g. HTTHHTHH) -- one of those people is likely to match your random result.

If your algorithm works well on large numbers of time periods, randomly selected, maybe you have something, but I'd doubt it.

Jason S
+3  A: 

With enough knobs/parameters you can fit an algorithm to any data, including random noise.

Time for you to pick up a good book on statistics, and maybe one on common human errors.

hotpaw2
Why did this get downvoted? with enough paramaters, you __can__ fit an algorthim to any dataset. For the trivial example, paramaterize by input and set each paramater to expected output ;) Also, statistics would be a good thing to study here.
aaronasterling