What is the point of view of the quantopian community regarding technical indicator ?

Is someone successfully using technical indicators in their trading algorithms ? I'm trying to use them in combination with simple fundamental information about the company (eps, p/e, etc ..), and by using specific strategies (simple ones combining RSI, MACD, etc ..) to different sectors. But nothing seems to have a consistent performance. Any inputs from your experience ? Thanks,

24 responses

Since you asked for opinions, my opinion is that they are largely worthless; either you have a real, verifiable edge, you know what it is and why it works, and when it might not work, and you exploit it to the hilt, or you are just throwing spaghetti against the wall and seeing what sticks. When I start to feel myself throwing spaghetti, I usually just stop, and switch to research or more basic thinking.

That said, some people swear by them, so hopefully they'll speak up too!

I have been on both sides of the fence. Ultimately I think they are self fulfilling. The behavioral argument is that since enough people use them, then price will respond to certain indicators. For example: resistance lines, you will often see a stock bounce off a near time high and having trouble breaking the level. Resistance lines shouldn't actually matter, but a price near all time highs will have a different effect psychologically than one trading in normal ranges. Because of that, we see price bounce of resistance lines until 'breaking' through or reversing. The issue is that while technicals can help one read the market, there is not a single one out there that can reliably pick directionality (if there is such an indicator please let me know because I too would like to be rich).

That said, my take is that technicals can augment a fundamentally sound strategy by helping choose entry/exit points but as standalone trading rules they can't provide much edge.

Depends which indicators you are using . I stick to two indicators only : Moving average and Rate of change , that's it. using 20 indicators just to determine entries and exit points is ridiculous (IMO). Here 's a simple ( boring) strategy I've been using for years. I use the U.S sector ETF offered by SPDR, and buy whatever ETFs trading above their 10 month MA at the end of the month, repeat at the end of each month. It's simple ,boring, but never failed me in the past 17 years. When in cash , i buy SHY ( still trying to figure how to replace cash with SHY here). Anyway, what i'm trying to say is keep it simple.

Cheers

P.S. @Market Tech helped me with this algo. :)

154
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
 Returns 1 Month 3 Month 6 Month 12 Month
 Alpha 1 Month 3 Month 6 Month 12 Month
 Beta 1 Month 3 Month 6 Month 12 Month
 Sharpe 1 Month 3 Month 6 Month 12 Month
 Sortino 1 Month 3 Month 6 Month 12 Month
 Volatility 1 Month 3 Month 6 Month 12 Month
 Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 55412734724d610d26068e58
There was a runtime error.

Single security trading using technical indicators will probably never earn you the alpha you may tease out of backtesting. TA for single securities is just too easy to curve fit. This in addition to the fact that you're competing with every other trader out there (often much smarter traders); competing with such traders would tend to mean that you think you're smarter than they are. Which might be the case. But probability would infer that you are not.

Where TA can introduce information that only your algo might possess is where you combine multiple securities into a gestalt like profile that you then use as one of your driving forces to govern your individual trades. For instance, I've been playing with simple oscillator type indicators where I blend all the metrics from each security into a single dominating filter value. I can then use this value as a gross risk on / risk off style switch. And/or, in a more elaborate technique, determine when the long term trend (for the group) is in one direction, then identifying, on a smaller time scale, when jigs or jags pressure this gross filter out of its boundaries. At this time I can then examine the outliers, those securities which zigged when the balance of the group zagged, and then decide if it's time to trade those outliers.

What's unique about the Q's platform is that it seems to have been built exquisitely for this purpose. Add to this the ability to perform fundamental filters that can build groups of similar behaving stocks and you've got the potential for a fairly unique trading treatment few others are probably leveraging. So yes, TA used as a grand zeitgeist sieve can possibly be used to build edge holding strategies here.

I dont believe it can predict the market or produce by itself the retrurns everyone is after. But I do believe and look for wasy to use TA to indicate you to that something changed in the market which means you must change your strategy , for example I want to find out when big downturns starts so I can move to cash or protect myself. I believe that TA can give this kind of picture to take decisions. I have to admit I didnt find the right mixture yet, so if anyone have a good algo code of TA that can really indicate of signifcant changes in market or downturns, please share

@ Joe , check out the MAC - US ( Moving Average Cross over ) system developed by Georg Vbra ( iMarketsignals.com) . Very simple lagging system , that should keep long term investor on the right side of the market . Here are the rules, from his blog:

Buy signal for the S&P 500
A buy signal occurs when the 34-day exponential moving average (EMA) of the S&P 500 becomes greater than 1.001 times the 200-day EMA.

Sell signal for the S&P 500
A sell signal occurs when the 40-day simple moving average (MA) of the S&P 500 crosses below the 200-day MA.*

Someone on TradingView , actually coded as an indicator . Georg actually did a back test not long ago on this , you can read more here

He uses the SP 500 index only , not sure if this is applicable on other stocks

The overwhelming body of academic studies that have looked at technical analysis show it doesn't provide abnormal returns. You will always find a number of people who anecdotally swear by it given their own experience, discount academics as living in ivory towers, and it rapidly devolves into something similar to an argument about religion. I believe in the scientific method and replicable results and have read through a good number of those studies, so that's my basis for not engaging in technical analysis. For those who take a more skeptical view of the scientific method I'd present two more "common sense" arguments:
1. Markets are made up of participants. If a widely held "edge" of any kind is well known and effective, then a large part of the market will use those strategies, thus arbitraging away said edge.
2. How many technical analysis hedge funds exist that use the typical chartist methods, and what is their AUM? If you're sitting around the poker table and you don't know who the chump is its probably you. If no significant AUM bases their investments on technical analysis, then you're implicitly assuming the majority of the hedge fund world and those who invest their money with them are the chumps at this table, not using a widely known and successful investment method. That may be true, but just be aware that you're going with that idea.

In essence, if you believe you are applying technical analysis in a way that is absolutely unique, profitable, and for some reason very difficult or impossible for any other reasonably smart person to come up with, then it may be a good idea. If you're just applying something you've read about elsewhere, it can't rationally provide you an edge going forward and you're most probably just curve fitting. If there is an edge to technical analysis the current acceptable term to use in polite company is "behavioral finance", which attempts to bring some rigor to the ideas that Ethan posted and is probably worth a google.

@Kevin Q., Nice wrap up. Posts like yours should make it into the "algo writers handbook" that the Q should compile from all the shiny knowledge nuggets it has gathered here.

Technical indicators get a bad rap because they're intertwined with TA. They are visually pleasing and thus commonly found in the toolbox of retail traders. I think it's reasonable to doubt rigor of someone daytrading 3 stocks off of charts decked with indicators. But that is a problem of process and not the indicators themselves. Manually adjusting parameters and hitting the backtest button over and over isn't anymore rigorous a process just because you're not looking at charts. Replacing a moving average with a Kalman Filter doesn't give you +10 Alpha points.

A moving average is just a moving average. I'd be more worried about trusting things like crowd-sourced sentiment data and complicated machine learning algos.

95% from 100 best algos by statistical metrics I found on this forum use technical indicators.

Some of them:

https://www.quantopian.com/posts/spy-and-sh-minute-data by Grant Kiehne

If I missed something good with fundamental approach then publish it here to compare.

452
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
 Returns 1 Month 3 Month 6 Month 12 Month
 Alpha 1 Month 3 Month 6 Month 12 Month
 Beta 1 Month 3 Month 6 Month 12 Month
 Sharpe 1 Month 3 Month 6 Month 12 Month
 Sortino 1 Month 3 Month 6 Month 12 Month
 Volatility 1 Month 3 Month 6 Month 12 Month
 Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 54e2540b503d010efbb25cf5
There was a runtime error.
85
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
 Returns 1 Month 3 Month 6 Month 12 Month
 Alpha 1 Month 3 Month 6 Month 12 Month
 Beta 1 Month 3 Month 6 Month 12 Month
 Sharpe 1 Month 3 Month 6 Month 12 Month
 Sortino 1 Month 3 Month 6 Month 12 Month
 Volatility 1 Month 3 Month 6 Month 12 Month
 Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5542a6b4a0be870d194e34a0
There was a runtime error.
29
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
 Returns 1 Month 3 Month 6 Month 12 Month
 Alpha 1 Month 3 Month 6 Month 12 Month
 Beta 1 Month 3 Month 6 Month 12 Month
 Sharpe 1 Month 3 Month 6 Month 12 Month
 Sortino 1 Month 3 Month 6 Month 12 Month
 Volatility 1 Month 3 Month 6 Month 12 Month
 Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 55429af5de504b0d22ec76c4
There was a runtime error.

The frontier between technical analysis (TA) and quantitative analysis (QA) is rather thin, though QA has better press these days. For example, moving averages are found in both TA and engineering like signal processing. Why would one be more noble than the other? I don't make any distinction between QA and TA methods as long as they remain testable.

Now, as systematic traders, we can draw an interesting parallel with cooking: the strategy being the recipe and its indicators the ingredients.

In cooking, nobody would expect to make a great meal out of combining random ingredients in an even more random way. In trading, however, it is not that uncommon. I call this thought-less backtesting.

The often missing question is a simple why? Why is this indicator part of the strategy? What are you trying to capture with it? What is its added-value? How can you tell whether it is working or not? Simple yet tough questions to answer.

I developed a short-only strategy that captures an intraday mean-reverting pattern that I found was repeating across a basket of similar securities. It did well historically and continued working decently after I started trading it. The strategy had a weakness however: the pattern wouldn't be strong enough to fight a solid bull market. In this adverse environment, short signals would keep being fired and with my short bias I'd get punched in the face.

So I added a technical indicator that would prevent me from trading in this environment. Which indicator? A simple 10-day moving average: if close(t-1) > sma(10, t-1), ignore signals on day t. Was it the best indicator for the job? Probably not. I tested a bunch of different indicators and ended up with this one because it correlates with rising prices, has a relatively short lookback period and is very simple. In other words, it does the job well enough for me.

Retrospectively (in backtests), filtering out signals was a losing proposition though: it hurt performance and had minimal impact on risk. From a pure quant guy's perspective, this was probably a suboptimal choice and chances are that he'd come up with an optimal (or rather optimized) solution much better than mine. This is where I believe qualitative thinking is required. I did not expect this filter to improve my edge - just to protect it. Insurance is not free, even if it's only for your peace of mind as I prepared for this 'worst case' scenario.

Is my approach better? I don't know. What matters to me is that it made (and still makes) sense and increased my confidence in this trading system.

So, do technical indicators add value? I would say that they can, but they are not the 'edge'. They are just tools that are useful for capturing this so called edge by enabling us, the traders, to quantify and identify trading setups that we've observed seem to work. I doubt that blindly applying technical indicators leads to success. Academic studies seem to confirm that naïvely applying technical trading rules doesn't work (yet still seem to think or hope that naïvely applying more sophisticated methods works :) .

Ingredients are not sacred. The art of cuisine is sacred. – Tanith Tyrr

PS: I'm a very bad cook. :)

The good thing of TA is that it is easy to test and validate, compared to other models still in use like CAPM, Efficient-Market.
TA has been tested and it shows no predictive power. Some say that before the 2000 markets it had some predictive power but
no predictive power anymore. But they still have some value when trying to get a market overview.

The good thing of TA is that it is easy to test and validate, compared to other models still in use like CAPM, Efficient-Market.
TA has been tested and it shows no predictive power. Some say that before the 2000 markets it had some predictive power but
no predictive power anymore. But they still have some value when trying to get a market overview.

If somebody knows links to good pure fundamental Quantopian algos without any technical analysis calculation
like:
ROC- Momentum
Moving Averages - Mean
Volatility - Standard Deviation
Commodity Channel Index - Standardize
Bollinger Bands - Z Score
Median - Minimum Euclidean distances
etc
and their combinations.
Please publish it here to compare.

@Alexis P,
I agree

Ingredients are not sacred. The art of cuisine is sacred.


@Alexis P., Good points and nicely said. Thanks for your input.

@Lionel do you have an algo for the MAC - US system mentioned above?

As Vladimir mentioned, a lot of the ingredients are the same. The trouble with technical analysis is the haphazard way in which people usually use the technologies, which result in statistically dubious overfit algorithms.

That said, I bet there are a lot of great "technical analysis" indicators which have some real insight, if analyzed. I remember screenshots from Linda Raschke's screen, and Teresa Lo's too. I haven't really followed any of those folks since I stopped day trading in the 90s.

I appreciate all the discussion on this topic. As a beginner in algorithmic trading, I am tempted to try various combinations of indicators and metrics to find something that has worked in the past, and then test it forward. But based on what many of you are saying, my efforts are probably futile unless I add something unique to the equation. Now the question is, what can I add that is unique?

BTW, I wanted to share that TradingView has a very simple indicator programming language called "Pine Script" that makes it very simple to create custom indicators. I am going to create a few indicators just for fun, and perhaps eventually come up with something useful.

Taking a step back, I have to admit that I am having a lot of fun with Quantopian. I used to play video games in the evenings, but now I hack on algos for hours, trying to get a higher "score". I know there is only a very small chance I will be good enough to make money, but I was never really that good of a gamer and I still had fun. :) There is also the side benefit that my newly acquired skills in Python will be useful in many professions.

@Tristan R., You have a healthy refreshing perspective. Thanks for that.

Regarding TradingView and PineScript, TV is a super resource. A stunning resource even. Along the lines of Quandl. In fact blending them is a given and encouraged. Pinescript on the other hand needs some serious reformulation. Control structures, conditionals, logicals, are all weird or missing. Here's an indicator I wrote; examine the conditional statements therein, ugly!

study(title = "TrailingRangeOffset", shorttitle = "TRO", overlay=true)

periods = 10
atr = atr(periods)
rangeOffsetMultiplier = input(title="RangeOffsetMultiplier", type=float, defval=3.0)
mtrOffset = atr * rangeOffsetMultiplier

priorTrail = na(priorTrail[1]) ?
low - mtrOffset :
priorTrail[1] > low ?
priorTrail[1] < high ?
low - mtrOffset > priorTrail[1] ?
low - mtrOffset :
priorTrail[1] :
high + mtrOffset < priorTrail[1] ?
high + mtrOffset :
priorTrail[1] :
low - mtrOffset > priorTrail[1] ?
low - mtrOffset :
priorTrail[1]
isUp = na(isUp[1]) ?
close > low  :
priorTrail[1] > low ?
priorTrail[1] < high ?
low - mtrOffset > priorTrail[1] ?
true :
isUp[1] :
high + mtrOffset < priorTrail[1] ?
false :
isUp[1] :
low - mtrOffset > priorTrail[1] ?
true :
isUp[1]
plot(priorTrail, color = isUp ? green : red, linewidth=2)


Incidently I've coded this for Quantopian too...

What special ingredients can you add to a vanilla strategy that uses vanilla indicators to spice it up? I suggest creating composites from baskets of securities and then use common indicators against those composites. Imagine taking the RSI for 100 securities and constructing a single RSI from them? What does that master-RSI tell you? Can you use it to gauge general market trend or behavior? What if you took a 21 period RSI and a 3 period RSI and performed the same treatment? One for Bias and one for Trade. When the Bias is > 50, and the Trade is < 50, take individual Trades that are extreme. Something like that. The simple story is, because Quantopian gives you easy access to baskets. Use them.

In my opinion TA is not totally useless, it really depends on how indicators are used. Rules and accounting is basically what trading algos boil down to, TA can supply rules but I'd argue accounting/risk management is more important. A problem with most indicators is signal lag, you can only buy/sell at spot prices, not their averages or some other derived value.

I find the intuition behind some indicators silly really. Moving average crosses / momentum algos are good examples of statistically absurd ideas, an average is the most probable value, but the strategy bets on deviations from this value; reversion back to a mean would make more sense. That being said, one of my most consistent algos uses short term momentum signals and I've found they work well. Since a price series isn't stationary none of the signals make much sense anyway. Bets on stationaryish spreads are more likely to work over the long term IMO. TA on derived values like a pair spread is probably more meaningful than on its components.

TA is quantifiable, so it conveys information and shouldn't be useless, what really matters is what's done with the information.

@Market Tech - I see nothing "weird" in your code example. This syntax of a conditional expression, condition ? thenExpression : elseExpression, has been around in C since 1970, and continues to be alive and well in C++ and Java. Things become more complicated and harder to read and debug when you nest and chain a lot of them - but that is true of every type of expression.

Python has a different conditional expression syntax: thenExpression if condition else elseExpression. I find it counterintuitive, because it reverses the C order of its components, as well as Python's own if condition : thenStatement newline else: elseStatement. But it's probably only a matter of individual preference which form you like better.