Hacker News new | ask | show | jobs
by henning 2182 days ago
I tried doing some forecasting with various neural network models after assembling what I thought was a good amount of forex data. The neural net (I tried various architectures) couldn't do any better than chance. After playing around with it and trying to double-check everything, that was as far as I could get. This puts me ahead of most traders, since most of them lose money, then quit.

This makes me wonder what kind of trading systems can actually have any kind of edge, since some kind of autoregressive time series forecasting system seems pretty unreliable.

On a more general note, how do you move beyond it being gambling? Just because a system backtests well doesn't mean a phenomenon will continue to happen, especially if your system will significantly impact the market you're in. If you make a trend-following system, every time you trade, you're gambling that the trend is more likely to continue than not. If you're right, you'll come out ahead over many trades. If you don't have enough capital to withstand drawdown the way most beginners don't, you won't be able to last long enough for whatever phenomenon you've found to average out.

It takes a lot of time, effort and risk to do all this, so, this is a long-winded way of saying I don't think it's for me. If you build a SaaS product and it fails, at least you can talk about what you learned from building it and use that in future endeavors. If you lose money trading because your algorithm doesn't work, what do you learn from that besides that your algorithm doesn't work?

9 comments

The most popular kind of quant trading is using a factor model. The first step is developing some alpha factor, a number that is predictive of how much money you'll make from each stock. So let's say my alpha factor is "companies with good earnings per share will go up." So I first take the EPS for all the stocks in my universe and maybe rank, then zscore. Now I have some positive numbers and some negative numbers. These represent the weights of my portfolio. The positive weighted companies I go long, the negative ones I go short. The bigger the number, the larger my allocations.

Now that I have my alpha factor I backtest it and whatever. Since the mean of a zscore is zero, I know I'm market neutral, so (ignoring some stuff) my factor should have little exposure to the market.

If I think it's good, I add it to my other alpha factors and combine them somehow. Could be as simple as adding them all up, or maybe something like using random forests to figure out the best way to combine them, or whatever. Now that I have a bunch of alpha factors all combined, I can run them through the optimization engine.

The optimization engine will adjust the weights of my "ideal" portfolio in order to reduce exposure to various risk factors (thus lowering volatility). My optimizer will also figure out how often I need to rebalance. There's generally a bunch of terms in there that try to reduce trading costs and zero out exposure while not diluting the "ideal" portfolio too much (or else the alpha could be wiped out).

Now, after all of this, I'm ready to trade.

In short, what we're trying to do is reduce our exposure to as many factors as possible and just get exposure to our alpha factor. We don't want the market, price of oil, sex scandal of a CEO, or anything else affecting our portfolio. We are trying to dig up this latent, unearthed, alpha that exists in the market, but doesn't belong to one company or asset.

Taking EPS as proxy for alpha is like trying to recognise banana pictures by looking at average yellow content: it is plausible, but roughly 100 years behind the other market participants. Don't do this kind of stuff with your hard earned money...
He was using that as a simple example.
Yes, I just wanted to make a point: things that have names, that have a paper written about them, that have Wikipedia pages or even Nobel prices attached to them are in the same category. The market has priced them in decades ago.

Thinking you can read Fama papers to take on quant funds, like smabie is claiming at several places in this thread, is like reading Commodore manuals to take on AlphaGo.

I feel like I've read something recently about how there's evidence people don't actually read SEC filings.

It's kind of like the theory that open source doesn't have serious bugs because so many people read it.

You know the saying that the market can remain irrational longer than you can remain solvent? If some people don't care about doing simple analysis, and others assume that someone else is doing it, and still others accept that it's useless to do it if other people aren't, it seems like a none-too-efficient market can be a stable equilibrium.

Similarly, the book The Big Short (Michael Lewis) notes that hedge fund manager Michael Burry read hundreds of prospectuses for mortgage bonds in the years leading up to 2008 and was "certain even then [in 2005] (and dead certain later) that he was the only human being on earth who read them, apart from the lawyers who drafted them." He ended up shorting these and profiting hundreds of millions of dollars.
From my analysis, there's around a 3.9% abnormal return associated with a L/S beta neutral low beta strategy (long low beta, short high beta). It's Sharpe ratio is ~1, though. 3.9% is pretty significant, especially since the beta correlation is less than 2%.

There's a reason why these factors are called "persistent." For systemic reasons, it is hard to arbitrage them away, mostly due to laws, and sometimes tax implications.

That's the ideal described in quantopian tutorials, but I doubt it often works out that way.
From personal experience, it really does actually work that way. Not all quant firms are running traditional market neutral factor portfolios though.
How much money have you personally made with this approach?
Market neutral strategies really only work with significant access to leverage and favorable financing. Retail investors such as myself are unable to get the kind of juice necessary to run a L/S market neutral strat.

Of course, I suppose it would be possible if you discovered some amazing alpha factor. But if you did, you probably would be better just trying to get investors.

So in short, the answer is $0. For my personal portfolio, I run (only started recently) a variable leveraged beta strategy that can be described in my three part series:

https://cryptm.org/posts/2019/10/04/vol.html

https://cryptm.org/posts/2020/05/28/vol2.html

https://cryptm.org/posts/2020/06/09/vol3.html

Thanks, looks interesting.
Really? So you're saying, not all $10tn of quant funds in the US market are managed in the way you just described?
Most people seem to think indexing is a boring cop-out, but imo it’s the place of humility you get to after you’ve dashed yourself against the rocks of trying to outperform for a few years - or decades - and then realising the whole endeavour is insanity.

It’s accepting that you’ll receive what the market gives you and not a dollar more, and that that’s the best you’re ever going to get.

+1 for indexes. This is the route most successful traders seem to take - alternating between indexes and bonds. You won't see Warren Buffet buying stocks on Robinhood.
You don't see Warren Buffet buying indices either..

If you aren't willing to put in the work, sure just hold an all weather portfolio or whatever. But I don't think it's super hard to beat the market on a risk-adjusted basis, especially as a retail investor. Most of all, it takes a passion for it (trading is a hobby) and also a reasonable amount of time dedication.

For example, there are a number of persistent factors that don't go away. Things like value, low-beta, size factors, etc. It's not super hard to leverage the tons and tons of papers that have been published to construct a portfolio that does really well. And, due to structural reasons, will do well until the laws change (almost all persistent factors exist due to some law).

Especially in the current market environment, it's really easy to make a killing. The market is moving purely on sentiment and day traders have had some really great opportunities to make stacks in the past couple of months.

Friend, if you are up on Hackernews making comments like this, I can guarantee with near 100% certainty that you are not capable of sustained outperformance in the markets. Whether you realise it now, later or never is no skin off my nose, but sooner would be cheaper.

Comments like this are why these "beat-the-market" threads are evergreen on HN. They do a disservice to the community.

I'm really glad these sort of comments were made around 2013 on this community and I started trading cryptocurrency. His comments make sense to me, and I can guarantee you with near 100% certainty there is another millionaire trader reading this thread.
You didn't need to trade to make millions in cryptocurrency if you started in 2013. Just buy and hold.
You are as dumb as you are lucky and this comment is just the definition of survivorship bias. There are always some people who make money off of pyramid schemes (not necessarily saying that bitcoin is one) but that doesn't mean it was at any time at all a good idea to invest in one.

Real estate is another area that is very typical for bubbles and when the bubble bursts the large majority of people who are overleveraged will be eaten alive by the big investers (much bigger than you) who make money off the poor in times of crisis like they always do.

The low beta anomaly has persisted for since we have data. If you consider the S&P 500 the market, then yes, it's not difficult to beat it by investing in low beta stocks and leveraging up so your beta is 1. This is a classic and time-tested strategy that will probably always outperform, on a risk-adjusted basis.
You're arguing on HN that you have a long-term strategy that can reliably beat the market. Such a strategy would be worth billions of dollars. You probably don't have such a strategy.

Good luck with that though.

That kind of sounds to good to be true... This [0] seems to suggest that the low-beta anomaly is essentially an artifact of how risk is measured. Toughts?

[0] https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2503174

Pics or it didn't happen! We should not fall below wallstreetbets standards on HN.
Warren buys presidents.
Warren Buffett doesn't buy stocks on Robinhood because they couldn't handle his volume. I saw him quoted somewhere not long ago saying that if he was working with a "small portfolio", a few hundred thousand dollars or maybe it was even a few million, that he was quite certain he could return in excess of 100% annually.

But yes, picking stocks is probably not as effective for most people as buying an index fund.

He said the bit about returning 100% in a very old Berkshire meeting (90s). He's recently commented that the market has become either too volatile or crowded to allow the same type of value investing that got him to where he is
He could probably use BH to manipulate the market so his mini-portfolio would have crazy returns. This is one of the theories behind the infamous Medallion fund.

I doubt he could without using or BH insider info.

You need more data to input besides just the price time-series. Successful human traders balance and synthesize a myriad of data sources to make decisions.

I depend on an in-depth understanding of human psychology as one of my data sources. You can't turn something like that into data and input to a model. It is something learned through life experience and study.

+1 Any trading strategy based only on price is fool’s errand. The information that impacts price need to be included in the trading strategy. A lot of short term price movement is news driven, thus unstructured text processing of news, social media, relevant documents will be a key component of such trading strategies.

I am not that familiar with forex market compared to equity market. But I expect forex to be impacted by changes in political and economic situational news of host countries of relevant currency pairs. All these need to be coded into forex trading strategies.

If trading based on just price was so simple , everybody would be doing it successfully.

Price based arbitrage was very successful for Edward Thorpe http://www.edwardothorp.com/books/a-man-for-all-markets/
No successful strategy ever has been based on price. Price isn't stationary so you can't do anything with it. You need to be looking at the log returns. Price is completely irrelevant, at least for equities.
Do you know how return is calculated?
Sorry, but that is wrong. All I use is price and time. See Elliot Wave Theory. Most indicators are perfectly correlated with price meaning unless you are a HFT you can't trade fast enough to act on them.
Elliot wave theory is quackery. Price is not suitable for any statistical analysis.
It has changed and it is just observations of competing waves of pessimism and optimism and the patterns they demonstrate. I'll put a model trained on TQQQ and SQQQ price and time data only. I will bet you 5k mine will beat yours using whatever inputs you choose over any reasonable time you specify.
trading forex swaps as an individual is a disservice. its not centralized at all, as a retail you get spreaded quotes from some banks that want to make markets and that is it really. many of the biggest fx brokers have been banned in the us over the years too for all sorts of awful things [1]. there are cross bank quoting and such but the whole thing is extremely unsuitable for retails, making it prime for low barrier to entry decimation of retails which is exactly what you'll see time and again.

if you really care to trade currency rates in a sane way, there are CME futures

1 http://www.forexscamalerts.com/fxcm-permanently-banned-usa-f...

This is another unhelpful thing about trading: when you seek out information, everyone pipes in telling you that what you're doing is wrong, what they do is right, what you want to do can't be done without giving any explanation or elaboration, etc.
If your algorithm stops working or doesn't work... do you have the experience to know why? wavepruner is saying that models can't capture everything like intuition and experience which comes with time.
Personally over the past few decades investing in US equities, I have found arbitraging information found in Asian-language tech sites and real-world locations such as Shenzhen surprisingly profitable. My best example was a tip I garnered in 2011 from a Beijing KO employee brandishing her new iPhone 4. When I idly asked her if other employees in the huge KO (hundreds of staff) had iPhones, she offhandedly exclaimed 我们都有! ("we all have them"). That moment set me up for a very comfortable retirement.
> since some kind of autoregressive time series forecasting system seems pretty unreliable.

A few months ago I tried to evaluate autoregressive behavior in stock returns. To my surprise it seemed strong on some periods, but then weak on others [1], and as you said not reliable enough to rely on.

My impression is that a lot more information aggregation and processing is required to obtain a sustainable edge worth tranding on than what a single developer can achieve in his/her spare time.

Top investment shops have dedicated teams of sw engineers just to deal with the infrastructure that support their data pipelines, financial model backtesting and deployment.

[1] https://thomasvilhena.com/2020/01/likelihood-of-autoregressi...

There must be some information content left in stock price time series data, as evidenced e.g. by the price Momentum factor [1], which was been replicated in a number of studies (e.g. [2]), observable over the last couple of decades.

[1] https://en.wikipedia.org/wiki/Momentum_investing

[2] https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2961979

You don't have to outperform to have a viable strategy. Harnessing small returns from multiple un correlated sources is a perfectly viable plan.
In a literal market, you can find alpha in tomato trading by:

(1) monitoring other people’s tomato transactions in as much detail as possible;

(2) spying on people who are about to buy tomatoes and rapidly make changes behind the scenes just before they make a purchase; or

(3) pointing voice analysis at The Food Network looking out for recipes that call for fresh tomatoes, tracking tomato tankers in major sea lanes, monitoring storm tracks in the top tomato growing zones, etc, and adjusting your position appropriately.

It sounds like you are trying (1) when (3) might be better, or even (2) if you are not jail-averse (or your local jurisdiction has institutionalized high speed market fiddling to the point of being legal.)

Mind providing a source for what a 'literal market' means? Thanks.
As in a town square market, as seen in human culture for the last few thousand years.

For non-native speakers, market has a specific meaning in US English. In the US a “market” typically means a small shop selling the most common fruits, vegetables, snacks, and household items.

In Europe a market is a larger and more general area for autonomous small traders, usually also trading food and household goods.

The autonomy and low barrier to entry make them a good analogy to a stock market.

(They also suffer from availability and quality issues. A large business can arrange to purchase and retail all of these goods on behalf of consumers under one roof — a supermarket.)

Let's say I want to predict the crop yield of a field. Sure, looking at the yield in previous years would help. But the yield is just a nonlinear projection of a point in high-dimensional space that has dimensions like weather, water availability, pest infestations, farmer skill, etc. All of these dimensions are incredibly relevant to forecasting, but once we've projected our points onto the yield axis, most of this information is gone. So if you want to take advantage of this information, you need to do your fitting in the original high-dimensional space.
>>> This makes me wonder what kind of trading systems can actually have any kind of edge.

The secret is simply to have an edge.

If you're trading on behalf of clients. You don't care what happens to the market because you don't depend on the high or low to make money.

If you're buying or selling for yourself, same thing. Guess who's buying coal and oil, power plants and refineries and assimilated. They sell what they have and buy what they need.

If you're making money on arbitrage, making sure the New York and the London stock exchange have the same USD to GBP to EUR price and vice versa. You could make money but you better be faster than other corporations and more careful at the same time because you're not the only one doing that. Anytime you buy one side, the other side might have changed because you can balance out.

There are clear factors that drive many markets. When the weather is cold people consume more energy for heating. When it's hot, they go out to make barbecues and buy more sausages. When there is a drought or crop sickness, wiping agriculture exploitation, prices of food and meat go up. That's some examples that are easy to understand.

The stock market is not about speculation. It's about buying real items in the real world and providing services.

There are lots of ways to produce an edge. Forex is slightly different because you are trading a currency (this actually makes things easier in some ways) but, a few years ago, a lot of the cutting edge was news releases.

So inflation comes out at X% and then you try to jump ahead of other people reacting to the news.

Speaking very generally, you are looking for data that has information about future returns. So this may include past values of the time series (this is kind of complex though because a stock price does trend, that company is investing capital to earn a return which compounds in the price so stationarity is...complex) but may include other time series/their past values i.e. price of other stocks, economic data, etc.

So this could be responding to changes in liquidity, it could be seeing some repeatable behaviour by investors and jumping ahead of it, etc.

Quant is not about adding to the efficiency of markets though. They aren't using these models to determine the value of something, they are more about looking at the value of other things to determine the value of a given asset. So these strategies end up being correlated to liquidity in a lot of instances (but not all). This is a generalisation but...it is a very odd thing to have occurring in society...would this exist if investors didn't have an irrational demand for microsecond liquidity? Probably not.

Also, determining whether something is a real signal is just part of statistics, isn't it? This has definitely been an area where there has been quite a lot of innovation as increases in computational power has made non-parametric stuff more feasible (I am not an expert on this, it is just my understanding).

Btw, I should add I used to work in finance and I have some experience with this kind of thing as I do quite a bit of "quant investing" but in gambling (it is far easier to just copy what people do in finance and apply it to gambling then come up with it yourself). And just based on my experience, it makes most sense to employ a mixed approach. So learn about the business valuation, and then build a five-factor model...watch what it does, and then filter its picks with your knowledge. A lot of quant strategies are vaguely ludicrous if you have an understanding of the fundamentals of investing, like you are trying to use a computer to replicate a human...and people wonder why it doesn't work? It is an overcomplicated shortcut (to give you a concrete example, the blowup of value and funds like AQR was very obvious...you just had to look at the utter garbage stocks they owned). So I think a combination of human and computer beats either separately (one fund that does is Marshall Wace).

You dont learn. There are two rules, you dont talk about what works and you dont talk about what doesnt work. I worked professionally in the quant space up to 2008, and i still get calls for interviews, with people wanting to dig out what i am doing nowadays. What is popular or known loses alpha pretty quickly due to overcrowding.