Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Observations

First, my background is in modeling electronic circuits (differential equation solvers) so I was excited on finding Quantopian, since it looks like what I do for a living. We can model circuits very accurately, so I figured this stuff should work.
Note at this point I am interesting in trading my own money as opposed to the Quantopian contest.
I have not tried minute buy minute stuff since I can't trade at that rate.

I developed some algorithms, mostly by improving algorithms from this forum which gave good back test results.
I was surprised how quickly they failed with real money. Failed means giving a drawdown larger than
the backtest over a period of several years.

First I tried the "Gold King algs". I really did't expect this to work (due to liquidity issues and incorrect accounting of delisted stocks) but figured it would be a good test for Robinhood. It didn't work and robin hood had problems I was not expecting,
orders being canceled etc.

Next I tried a real simple trend line basically the 80day one from Anthony. Simplicity is very important to avoid overfitting. There are papers proving that overfitting is real and issues with it are encountered in other areas of modeling. This one failed due to the drop in bond prices. My code assumed TLT was safe.

From my backtesting the only thing I have observed to work reliability is momentum, and only when there is a strong upward or downward trend. In flat markets it whip-saws and underperforms. In strong markets many stocks work, but momentum does let you pick better ones (although I don't know they are better than a 3X bull ETF)

Grant gives a good explanation. The noise to signal ratio ratio is large, and becomes larger in a flat market. It is impossible to predict noise so the algorithm underperforms in flat markets like we have had recently. In backtesting we try and run through as long a time range as possible which includes the strong markets so we conclude the alg is better than it is. On the other hand the backtests don't go back far enough to test things like rising interest rates.

I doubt shorter term algs will work better, noise is larger over shorter time periods. Machine learning is likely to take overfitting to the extreme, although it may uncover bizarre hidden trends like stocks that go up on the third Thursday when there is a full moon.

Fundamental data seems to lag too much, and I have been burned during hand trading by companies that lied about their numbers.

Finally the efficient market theory is working against us.

I hope someone can explain why the above is incorrect...

8 responses

Diversification is the only free lunch. Everything else is a waste of time. Don't feel too bad as most of us cant beat the "market" on a risk adjusted basis.

There's probably a reason why Quantopian has a focus on highly diverse, large-scale long-short strategies, and are building a workflow to support their creation. I think the formula for success is less about stellar returns, and more about high Sharpe ratio and leverage (which, I gather, could be as high as 6X). I read Robert Carver's Systematic Trading which also emphasizes combining various trading strategies into one, in a systematic way. He gives some sobering guidance on expected long-term Sharpe ratios, and as I recall, basically sets an upper limit of ~ 1.0.

I have to think that it is a Wall Street secret that retail traders, as a whole, are just gambling, and they want them to keep gambling, since it is profitable. It is not clear to what extent this is part of the Quantopian business model, although the R&D tools available are quite different from your traditional retail trading venue, and allow users to apply caveat emptor. If someone using Quantopian ends up dissatisfied, it shouldn't be for lack of data and analysis tools.

All highly relevant and appropriate observations. Institutions are by no means immune from f**k ups either, witness this year's terrible performance from Crispin Odey.

There are however structural aspects to the market which are reasonably reliable and some can profit on, mostly. Key examples being the bid offered spread (only for HFT these days) and for instance writing calls on the Vix if you can devise the appropriate hedge.

I don't like 6x gearing but obviously the logic is impeccable if you can hedge beta appropriately and still make a small turn.

In the long run most strategies die or otherwise f**k up. Or perhaps it's just most traders who do that.

The whole retail trading industry is a disgraceful con rather like the casinos and bookies.

The only people who really benefit are those selling them the tools to dig their own graves.

None of what I have said is aimed against Quantopian. This is an excellent forum and excellent software. Those with skill and market nous will be able to use these facilities to devise something with a chance of success.

It is a hive of good ideas from many different parties - I was unaware of the persistence of contango on the Vix for 80% of the time and have used the information to devise a system which is one of the best I have ever seen. In back testing at least.

The reality may well be different but here's hoping.....

Yeah, lots of data, tools, training, ideas here. I might add that depending on the strategy, one can do months to years of free paper trading on Quantopian, before deploying (followed by paper trading on IB if one wants; not sure about Robinhood). Of course, if there's the rush to get real money behind the strategy, for whatever reason, then the risk goes up, it would seem. No free lunch.

Greg, price series are non-stationary and change from momentum to mean-reversion, a process I call Momersion. For a few years mean-reversion dominated and reached high recently. Only in past few weeks momentum has started to kick in again.

It is important to know the state of the market. While CTAs, trend-followers and momentum traders have been struggling in recent years due to mean-reverting markets, statistical arbitrageurs and mean-reversion algos have been profiting.

A way out of the dilemma of knowing, or developing ways of knowing, the state of market conditions is what Quantopian is trying to do: discovery of market anomalies with a market neutral strategy. This is what some successful funds are doing.

I take a hybrid approach: I have developed a ML program that identifies factors for both short-term momentum and mean-reversion. Here is an example of out-of-sample and forward performance in Quantopian platform.

Others have different, equally or even better performing methods. There is alpha in the noise, identifying it is hard.

Michael,

Sure momentum and mean reversion exist. However they operate in the opposite direction and due to the noise it is difficult to tell when to switch form one to the other. Stock experts can never agree on where the market is going.

Rather than using ML I did some experiments using

P(i+1) = K1*P(0) + K2*P(i-1) + K3*P(i-2)

Which can model alpha, momentum (K>0) and mean reversion (K<0) , and since it is linear in K, can be fitted using least squares.
It didn't work very well. You can add all the Ks you want, which improves the fit, but most likely harms the predictive power.

The Vix stuff is interesting, but what worries me its that it is very sensitive to the contango ratio threshold.
Also the quandyl data is too old. (I wrote code to download from the CBOE site to get around that)

With Long/Short it seem like you are likely to just throw away a lot of alpha and multiply the noise by sqrt(2). I didn't try
real hard with this but had no good results in backtesting. I don't recall seeing a good backtest of it here on the forum.

Diversification does work, and as Anthony pointed out a 50/50 SPY/TLT benchmark would be better, and beats many
strategies. However if interest rates rise TLT and SPY decline. I can't think of and asset that rises in value long term and
is positively correlated to interest rate.

Hi Greg,

"P(i+1) = K1*P(0) + K2*P(i-1) + K3*P(i-2)

Which can model alpha, momentum (K>0) and mean reversion (K<0) ,"

If P is price, isn't P(0) supposed to be P(i) in your equations?

This is an AR(3) model.

Regardless, the above describes neither momentum, nor mean-reversion. If it uses prices it is subject to non-stationarity. Typical models use returns.