If Technical Analysis is working, why is not possible to program a bot to do it automatically?

The bot will be much faster than any human, will not make any numeric error, will not fail due emotions, will work 24/7 and also could analyse thousands of markets at the same time.
And will be easy to develop! the rules for Technical Analysis are very simple.

EDIT: I am a developer, I know there are bots out there of course, I coded one myself too, and I did a lot of backtesting. And none of these bots works, that's my question, why the bots are not working if they use technical analysis. Why a human can make profit using technical analysis and a bot can not? If they are much more accurate than us making technical analysis...

LAST EDIT: I asked this in the wrong way, my question was about the public and well known strategies used in TA, like RSI overbought/sell, MACD, BB, etc.
Because I'm new in trading and I can see a lot of people drawing this Fibonacci retracements, weird things like harmonic patterns, and I can't understand why people waste time drawing those things, if they work they could just create a software to detect them and buy/sell automatically. And if they don't work why those things are so famous, are all them scam? are these techniques just a tramp for beginners like me?

I think the best takeaway I got here was from @Brythan. Do not use TA to tell you which stocks to choose, but which to eliminate as options. TA could say a company looks perfect, and tomorrow their board could announce they are closing shop. You can't analyze things like that. Investing is a risk, TA seems better suited at identifying higher risk than it does at taking responsibility for choosing to buy.
– cornbreadFeb 5 '18 at 23:03

Enrique, as a matter of course there are any number of firms that do exactly that! it's a whole industry! "And none of these bots works" many incredibly rich people who have made a billion in a quant, would (if they bothered to talk to people like you or me :) ) point out that you're wrong. Opinions simply differ on whether charting works (whether in person or via a quant).
– FattieFeb 6 '18 at 13:19

"Do not use TA to tell you which stocks to choose, but which to eliminate as options." That's completely wrong. (What I mean is, all charting is just BS and opinion, but: the majority of actual day traders very much go the other way around. You use charting to find possibles, then, sure, maybe you eliminate some by glancing at fundamentals.)
– FattieFeb 6 '18 at 13:45

4

I read that around 99% of all day traders don't beat the market in the long run. Don't have a source nor know if its true, but I dispute the premise that humans make money by TA without prove.
– DonQuiKongFeb 6 '18 at 13:55

11 Answers
11

No, your anecdotal experience is not proof that a concept is flawed. There are many many many many many flaws with TA, but proving something takes a lot more than one person's casual attempts.

If I had a profitable strategy, I would not sell it, I wouldn't explain it to anyone, and I probably wouldn't even tell anyone I had it. So no, very unsurprisingly, profitable robots are not for sale. Information is far and away the most valuable part of investing. Just because you haven't figured something out, doesn't mean no one has. When people figure something out, and it's vital to their own profitability, they don't run around sharing it.

To address your comments below. I think you need to define what you're referring to as "technical analysis." Generally speaking there are two avenues for which a person can analyze a security, Fundamental Analysis and Technical Analysis. Fundamental analysis involves looking at the financial state of the company over time generally focusing on the company's financial reporting. Technical analysis involves tracking the pricing of the security over time.

There is no blanket strategy of "Technical Analysis." There's no TA gospel that says definitively buy/sell when the price crosses the 200 day moving average. You're simply looking for some pricing pattern that appears in the chart to influence your decision to buy or sell, but there are literally an infinite number of pricing patterns. Maybe it's not a 200 day moving average but a ratio of 200 days times 1 minus the increase in an index over those 200 days. People come up with all sorts of weird algorithms; some people even find one that will work for a bit. Ultimately, it could be anything: as long as it involves the quoted price relative to some historical metric for the price it qualifies as technical analysis.

Is TA infallible? Obviously not. But have there been spans of time for particular securities where a TA strategy produced profitable results? Absolutely yes.
– quidFeb 5 '18 at 20:38

6

@Enrique, so again, just because YOU haven't found one that you think works well enough to rely on it, does not mean NO ONE has. And when people do, they don't divulge it. If someone had a strategy that worked, it would not be on sale.
– quidFeb 6 '18 at 1:22

2

No you're not missing anything, if it worked it wouldn't be on sale like that. But that's not a wholesale indictment of technical analysis.
– quidFeb 6 '18 at 1:44

4

When people figure something out, and it's vital to their own profitability, they don't run around sharing it. Why don't people understand this? It would save a lot of heartaches; I guess the old maxim: "a fool and his money are soon parted" is especially true in trading.
– Homunculus ReticulliFeb 6 '18 at 10:41

2

"There are a lot of people selling courses about how to make profit trading using these well known strategies." you must be joking man, there are a lot of people selling books on how to lose weight! Good grief!
– FattieFeb 6 '18 at 13:24

Part of my masters thesis was using candle stick analysis and genetic algorithms, but my conclusion is that it is not really possible. The reason was that you needed an exhaustive amount of sell algorithms and one can never be sure that they discovered a sufficient set.

Others disagree.

There are plenty of scholarly articles on the subject and is an "easy" area of research due to the data and the ease of testing. If you make a profit you win.

@Enrique individuals do make bots to trade technical analysis. There are PLENTY of open source ones of github. You made this question on a flawed assumption without even looking it up.
– CQMFeb 5 '18 at 17:43

2

@Enrique did I not answer your question? I don't think it is possible, others disagree. Presumably some have had (at least) limited success.
– Pete B.Feb 5 '18 at 18:18

2

@Pete B. You researched one niche in the technical trading world and I agree, also on my experience it doesn't work. Indicators and patterns can work when applied correctly. There are major funds only trading based on technicals with bots and they make money, others use similar techniques and they do not. Just about the same as anywhere else in life.
– misantroopFeb 6 '18 at 0:28

3

@Enrique, if someone created a bot that is profitable with good metrics, they would never sell it. Ask yourself this, if you have an ATM that magically refills itself every night, would you sell it for petty cash? The ones selling bots are the ones not producing a profit trading.
– misantroopFeb 6 '18 at 0:30

4

@Enrique look, it is right to be skeptical of TA, and this is a broad subject. Regardless, people do use bots to scan for market inefficiencies that happen to fit their particular style of TA and do profit from it. Thats the answer.
– CQMFeb 6 '18 at 5:34

Technical analysis is, by its nature, something that evaluates the past. Making money in stocks requires evaluating the future. If there was a foolproof way to evaluate the future by measuring things in the present and past, everyone would use it and it would stop working (because prices would adjust to reflect it).

I think that the story of Peter Lynch is relevant here. Lynch ran Fidelity's Magellan fund. His investment strategy was pretty simple. He went around doing things in his life and observing what companies' products he liked. So he might eat at an Applebee's restaurant and decide that they did a good job. He would then go out and do technical analysis on the stock to evaluate its fundamentals. If the stock was fundamentally sound and offered a good product, he invested.

Robots don't eat out. As a result, perhaps they will never give the evaluation that a human being will.

Note that the key here is to use the technical analysis not to pick stocks but to reject them. Some companies are on a sound financial basis and some are not. Technical analysis can, with some false positives, find companies that are not. What it can't do is see into the future and tell which companies are going to expand successfully and which are going to fail anyway.

Having a great technical analysis is no guarantee of success. Some of the best stocks had a good enough technical analysis and a bit of luck in their choice of products. That bit of luck is difficult to measure before the fact. In some cases (e.g. pharmaceuticals or oil exploration), it may be impossible.

Beyond all that, most human beings do not beat the market. While Magellan beat the market during Lynch's tenure and his replacement's, it did less well for the next guy and tanked for the guy after that. Was Lynch actually better than others? Or was he just lucky? We can't really say. It's not like we can rerun him on other time ranges and see how he does. However, with a bot, you can do exactly that. It may not be that humans are better than bots. Perhaps it's just that we are better at testing bots than we are at evaluating human performance.

An infinite number of monkeys banging on typewriters may eventually produce Shakespeare. But who wants to read through all the lines that just say faldfjoiwejifajslkf jdlaj? It's possible that humans who pick stocks successfully just happened to fit the market. With random choice, not everyone can be beat by the market.

I agree with your first paragraph but you seem to conflate "technical analysis" and "fundamental analysis".
– 0xFEE1DEADFeb 5 '18 at 22:18

2

There are definitely managers who screen companies that look attractive for their products with both fundamental and technical analysis. They latter can help see if a stock is already fully valued.
– Andrew LazarusFeb 5 '18 at 23:51

1

It sounds like you are saying technical analysis is better for determining when not to buy a stock. But if that were true, wouldn't that bias it as being better for determining when the sell (short) stocks?
– MichaelFeb 6 '18 at 19:04

Your idea is flawed in the first place. You assume that your hypothetical bot competes against mathematical laws. It doesn't - it competes against other bots (and humans).

You may be able to code a bot which masters the market and produces large profits.

Until a better bot comes up, exploits the weaknesses of your design and ruins you.

You don't need a bot which can work Technical Analysis, you need to have the best bot of all times (including future times). Or be at least ahead of the competition - which you cannot be certain of in advance, only at the end of the day.

No, it isn't. Most of the stuff I have seen used to test, and I would presume implement, is deeply mathematically flawed. I don't use technical analysis, but I can think of the state of affairs in which it should work. It is, in its essence, surfing. You cannot surf in most of the ocean, but there are places you can surf. I haven't been willing to rule it out mathematically, but I think most of the content out there is garbage.

Your methodology was most likely at fault. Just because you backtest (build a model based on historical performance) and see that something worked does not mean it necessarily will in the future, you need robustness. A key part is knowing why something works, it's not good enough that it just does. It's possibly the most competitive industry on earth, so expect it to be extremely difficult to turn a profit.

Trading is "art masquerading as science". This is something that any successful professional trader knows, and something that every academic sets out to disprove.

Like all things, its always best to evaluate from first principles. What actually causes markets (i.e. prices) to move?. The fundamental reason (pun intended), prices move is because of the twin reasons of greed and fear. When all is said and done, these are the primal emotions at work here.

As a mathematician and coder (with almost two decades of experience as a trader and trading system developer), I have come to realize that "mechanical systems" (especially crude* methodologies such as Technical Analysis), can at best, merely approximate (with large margins of error), complex human behaviour such as emotions.

So, to answer your question, it is not so much that Technical Analysis doesn't work, its that its the wrong tool for the job - I say this as a previously ardent believer in Technical Analysis.

However, from a technical point of view (pun unintended), unless you have exhausted the entire set of all possible combinations of technical analysis methods and their terms etc, you cannot conclude that your lack of success is conclusive proof that TA doesn't work. However, if you start from first principles, you will soon find that it is the wrong tool to use if you want consistent success in trading, as it fails to capture the nuances and interconnectedness of market movements caused by human emotion.

[[Note]]
I use the word crude when discussing methodologies such as TA, because some of the central notions (e.g. taking an average over a fixed time interval) - are patently absurd, and have no bearing on reality. For those who don't get the absurdity of such an operation - I'll explain further: by averaging over a fixed time interval, there will be several times when you will be averaging prices that are being driven by entirely different processes.

Yes, it is. Any publicly known "technical analysis" is a joke for the exact reasons you pointed out. Do patterns occur? Sure, they do. Is "head and shoulders" a joke? Yes, it is - it works a couple of times, then you buy and the market crashes.

"Secret workable patterns" are NOT technical analysis - they are just trends that people noticed. Maybe some MAJOR firm buyswhen there is a pattern. This, in itself drives the stock price up. And you can ride that wave. This has NOTHING to do with traditional technical analysis.

The thing about technical analysis is, if it analyzes anything at all, the thing it analyzes least noisily is, sentiment.

This is why human interpreters will do better than unconscious bots at using this type of pattern-"recognizing" (not to say "imagining") analysis to make trading decisions.

It's exactly like fortune telling: No bot can know enough about the facts being divined to provide worthwhile advice. But humans can, with results which might even occasionally satisfy the trader (not to say "the mark").

can you describe better what is the "sentimental" analysis a human can do using TA and a bot cannot? I mean, in TA I guess you are just searching the patterns and looking the indicators, this is something that a bot can easily do, what else is in the equation for a trader using TA?
– EnriqueFeb 5 '18 at 22:00

A bot doesn't understand what sentiment even is, but a human can. Therefore humans can and do use their feelings to make decisions which are often different from the decisions bots would make, given the exact same pattern-bearing data. If you think that the patterns don't indicate sentiment, and if you don't think that humans respond to other humans' sentiment in sentimental ways themselves, then I suppose that your thesis would be correct: Humans and bots should make the same decisions.
– BeanlucFeb 5 '18 at 22:09

But one of the principles in TA (and I guess in any market strategy) is "be emotionless". And what is the point of using the TA if you will finally decide based on your "sentiment" about the market? is not the idea of a TA strategy to follow what the patterns and indicators say? to react like a "robot" to those signals and trust in them?
– EnriqueFeb 5 '18 at 22:54

Sure, it's a principle. Do you think that that's how it actually happens?
– BeanlucFeb 5 '18 at 23:01

Sentiment is entirely subjective and decisions based on it no better than luck. Profitability comes from thinking differently, going against the sentiment, not with it. There are people capable of this but the vast majority are not.Take today, how many people would be comfortable buying stocks?
– misantroopFeb 6 '18 at 0:22

Technical analysis will never be simple. Its not about mathematics but the accuracy. Uncertainties exist in any form of technical analysis. No computer is going to predict the future price movements with hundred percent accuracy. There are innumerable ways one can do technical analysis. Every method will have its own merits and demerits. Two analysts rarely arrive at the same expected price.

In short, technical analysis is not just science but an art of human judgement with the help of science. Science can be programmed but not the "art". A real human application of logic throughout an analysis workflow is more important than automating the math part of the workflow.

So you think the trick in Techinal Analysis is the human intuition? why is useful the Techinal Analysis then? I mean you are seeing multiple patterns and indicators pointing to a "sell" operation, but you "buy" because your human intuition? if you sell in that case, then a computer can sell too, because you are just following the technical analysis, if you make the opposite to the indicators because your "human art analysis", then why are you using your techincal analysis after all?
– EnriqueFeb 5 '18 at 18:27

1

You are missing my point. Technical analysis is just a tool to help you in your analysis. The most important question is "why" something works as misantroop pointed out. Answer to "why" is not as simple as mathematical projection of future movements based on past alone.
– KannanFeb 6 '18 at 3:32

@Enrique, you are over thinking this way too much. Say we sat down to guess if a Hollywood movie will be a hit. Of course you could use indicators like - does it contain stars? is it part of a franchize? have similar movies been successful recently? - and so on. Say we were predicting the outcome of a football game (as Vegas does every day). Of course you could use indicators like - the stats so far of the quarterback - previous matchups - home field advantage history - and so on. What is your point? Of course, obviously, it's a guess in the end.
– FattieFeb 6 '18 at 13:40

2

i think a huge point of confusion is that "technical analysis" sounds really important. (It has the word "technical" in it.) Most people just call it "charting" which sounds more mystical, or like a guideline. Another good term would simply be "statistical analysis". I think the word "technical" in the term is very confusing - it makes people think it is "scientific" or "theoretical" or something. All it means is "statistics" (for example, "is the average going up" etc.)
– FattieFeb 6 '18 at 13:42

Absolutely, "technical" sounds like a simple math problem with "certain" results. "statistical" analysis is a better term. Two cousins of "statistics" are "uncertainity" and "probability". Both these cousins inevitably need a "human" to make a final call.
– KannanFeb 6 '18 at 13:50

TAs can work when the market is behaving normally and the underlying mathematical assumptions behind the TA are satisfied.
For example, there are a lot of assumptions that depend upon approximately Gaussian distributions in some way. These tend to hold true during normal situations.

Unfortunately economic stressors, government intervention, unexpected company decisions, and even individual actions can highly skew human reaction in the markets which can violate the underlying mathematical principles the TA relied upon. This will make the TA unreliable in reacting to these outside forces, which could result in significant losses.

Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).