Monday, January 14, 2008

Robot Evolution

I wish my ATS could learn and evolve based on experience like these bots. The concept of an artificially intelligent auto trading system that could learn from mistakes and increase yield over time is very appealing. Of course I wouldn't complain if it did other things. Maybe a beer every once and a while? A snow shoveling, dish washing, laundry folding, floor cleaning, fish feeding, bill paying, back massaging, auto trading robot would be a friend of mine.

5 comments:

Miguel said...

Hello!

I'm a grad student in Machine Learning and I've found your blog while searching for some directions in trading.

Just the opposite to what you comment happens to me: I'm knowledgable about learning algorithms, but don't have a clue about trading. I have tried to make my machines blindly learn to predict the close of the next day based on volume, open, close, high and low of the last n days on the E-Mini SP with no success. And it's not a failure of the machine, but of my selection of the input data and/or the meaning I assign to them.

Maybe you can answer some of my questions:

- Do you think one can equally trade options, futures or stocks? Or I should avoid some of these as mostly random?

- Are the price bars and volume of a future enough to make trading decisions or are other external indicators needed? (I'm not referring to price-derived indicators, of course, but new information).

- There are many well-known patterns in TA. I've backtested a few and found them useless. Is there any idea, no matter how simple, that works better than random guessing? Or any school of thought that you've found to work?

I don't mind taking my time to learn, but most things I've read were either vague assertions that could not be proved nor disproved or completely false under rigorous testing.

If you want any tip on ML, just ask.

Good luck on the Olympiad!

pythagoruz said...

Hey Miguel,

I am also a grad student although not in a field related to finance. I study nano materials at the University of IL in Champaign. One of these days I'll do a post about my research but I haven't gotten around to it. So do you do robotic machine learning or just computer science? The field is really interesting to me.

I will try and answer your questions as best I can:

"Do you think one can equally trade options, futures or stocks? Or I should avoid some of these as mostly random?"

I have known traders who were very successful with options, futures and stocks. But options and futures are much more highly leveraged and can be very risky if you don't know what you are doing. The learning curve for trading options is steep and painful, but I like options because the market is the youngest and has the most inefficiencies. In general, you have to be good at trading stocks to do well with options because options are derivatives (of stock price action) as I'm sure you are aware. I would recommend you stick with stocks until things become "easy" and you want more leverage. Most conservative option strategies require large amounts of capital to be effective.

"Are the price bars and volume of a future enough to make trading decisions or are other external indicators needed? (I'm not referring to price-derived indicators, of course, but new information)."

There are many strategies, my personal feeling is that traders can do well with only a few indicators. Recognizing patterns is very important and I rely heavily upon the 50 and 200 day simple moving averages (their slope and relative price). I also use CCI, RSI and stochastics frequently but these are derived from price action alone.

I have another blog you might find helpful:
http://stockgeometry.blogspot.com/

My post last weekend involved a number of external indicators that might or might not be helpful:
http://stockgeometry.blogspot.com/2008/01/mixed-indicators.html

"There are many well-known patterns in TA. I've backtested a few and found them useless. Is there any idea, no matter how simple, that works better than random guessing? Or any school of thought that you've found to work?"

I think technical analysis is 100% the way to go in trading, but its always fun to have a story to go along with. And in some cases I find myself compelled by fundamentals, which is good, but the chart has to back me up or I'm not in the trade. Its hard for me to generally say I do this or I do that, if you look at my other blog you will notice that most of my TA is based on support and resistance levels which I get from obvious highs/lows, moving averages and trendlines.

"I don't mind taking my time to learn, but most things I've read were either vague assertions that could not be proved nor disproved or completely false under rigorous testing."

Check out some of the "useful links " over at stock geometry. There is alot of helpful information there. Certain patterns are more powerful than others for sure. Some tend to fail. This site gives some simple stats on the relative performance of various patterns, def worth a look:
http://thepatternsite.com/

I'd love to learn about a simple way for my program to learn to trade better. To be honest it sounds like a tough project to code an adaptive program. I may email you sometime about it.

Thanks for the comment and good luck, hope I answered your questions.

Cheers!

Miguel said...

Thank you for your detailed answer! I'll also be checking the links.

I do machine learning, not just computer science. It's not specifically applied to robots, but to any regression, classification, clustering, etc, problems. Neural networks and the like. There are several methods to predict time series, and some of them are adaptive, meaning that they give more importance to recently seen patterns, slowly "forgetting" what happened long ago. However, naïve application of this idea fails, since, for instance, the last 5 days closing prices don't seem to really have enough information to decide which is going to be the closing price tomorrow. The same TA pattern can last more days, for instance, leading to a different last-5-days pattern. The same happens with the vertical range, but this can more or less be solved with volatility normalization. (And volatility can be predicted to some degree).

"I'd love to learn about a simple way for my program to learn to trade better. To be honest it sounds like a tough project to code an adaptive program. I may email you sometime about it."

Probably ML can help, but can't assure that without testing. Sometimes a really simple solution is difficult to beat. And the simpler your method is, the most likely it will remain working over time, because it will have a strong basis. But may be for auxiliary values (things like the volatility or parameter settings) it can be useful. Also, putting a system inside a probabilistic framework that gives you confidence measures can be helpful (to avoid trading on uncertain situations). If you do better manually than automatically, either you've been lucky or there are more things that need to be captured in you code.

It is probably tough to code the final trading system, but the backtesting can be done easily in most cases, and if the results are compelling... anyone would take the time do it.

Thank you for your directions!

Miguel.

pythagoruz said...

I can imagine some good uses for AI but there are some scary ones too:
http://blog.wired.com/defense/2008/01/israel-thinking.html

Miguel said...

Technology can always be put to good or bad use...

By the way, congratulations for being in the green now!

(Have you seen the 8th place? One of my mates here! We're enjoying it while it lasts!)