Live data from Hacker News

Lessons learned building an ML trading system

tradientblog.com

121–130 of 160 posts

Re: Lessons learned building an ML trading system

#121

I enjoyed reading this but here is a cautionary review of a project in the same field: https://towardsdatascience.com/what-happened-when-i-tried-ma... Discussed here: https://news.ycombinator.com/item?id=21624907

The only caution I took away from that post is that it's very easy to make mistakes applying ML to financial markets if you don't know what you're doing.

There looks like a lot of overfitting the validation set going on in that post.

It's also a mistake to conclude that "there was no subtle underlying pattern" just because the author couldn't find one.

Throwing XGBoost at a bunch of technical indicators isn't gonna cut it but I have had some solid real-world success (as have several people I know) applying ensembles of deep learning models (with regime switching based on model residuals) to profit from "subtle underlying patterns".

Re: Lessons learned building an ML trading system

#122

This post is an exemplar of the crucial relationship between domain-specific knowledge and ML competency in the ML space. The bulk of the post is detailing the tricky ins and outs of trading, and overall the author gives the impression that they're broadly knowledgeable about stock markets. Contrast this post with those you see with ML hobbyists who delve into medicine or fake-news and produce useless results testame…

Totally agree. Funnily enough I think the ML hobbyist problem is most pervasive in the "predict the stock market" domain. There was a post on HN a few days ago [1] that was overfitting the validation set and hand-waving away fees and spreads. The author concluded that "there was no subtle underlying pattern" because they failed to find one. [1] https://news.ycombinator.com/item?id=21624907

I agree. It mixes the hype of ML with the evergreen appeal of the 'Get Rich Quick' scheme.

Re: Lessons learned building an ML trading system

#123
post #71

Earlier quoted context omitted.

How do you maintain a market neutral portfolio without the ability to go short? Also I would be interested in hearing about your Sharpe ratio. Thanks! Great article!

You can't go short but you can still hedge your exposure by going on short on something very correlated - like Bitcoin futures. I do this manually depending on how much capital I'm trading. I actually have no idea what my Sharpe ratio is, sorry. With the system constantly changing, data formats changing, exchange balance apis changing, and accurate monitoring already being a challenge in itself, it's very difficult t…

Are you not calculating your risk-adjusted return at all?

Re: Lessons learned building an ML trading system

#124
post #39

Earlier quoted context omitted.

This doesn’t guarantee much in itself. A journalist was murdered there for investigating corruption not that long ago.

And the prime minister’s chief of staff was just arrested over that. Just because illegal stuff happens doesn’t mean there aren’t laws against it.

Sure. That's not the point. The point is corruption increases risk of doing business regardless of whether somebody gets caught. People dying because of investigating corruption only makes the point stronger.

Re: Lessons learned building an ML trading system

#125
It is a big loss of your time and nobody will give you back that one. I suggest you to use your time in non zero-sum games, something that can create value for you and society. Now that you have some saving you can definitely afford it. The next best thing of not doing it is to quit doing it now.

Disclaimer: I built a similar system in the past, took some gains and then realised the above. I then quitted to build a company.

Re: Lessons learned building an ML trading system

#126

Earlier quoted context omitted.

Many HFT systems provide liquidity. If there is no liquidity, retail investors like you or me cannot buy or sell. Just imagine you want to exchange a currency because you go traveling and the exchange tells you "Sorry, nothing available right now, gotta come back in a few weeks". That's what would happen if there is no liquidity.

We obviously can have liquidity on in-between timescales, because we had it before modern HFT trading, right? The average person may be overly paranoid about HFT, but it doesn't make sense to say they benefit from it, because they are not going to be in a position where they benefit from an execution in a fraction of a second. Price improvement of fractions of a penny has gotten silly too. It's easy to think of it as…

Before HFT, we had enormous spreads and expensive trades on many instruments in many markets.

Smaller spreads lower costs for everyone: institutional, retail etc.

Re: Lessons learned building an ML trading system

#127

It is a big loss of your time and nobody will give you back that one. I suggest you to use your time in non zero-sum games, something that can create value for you and society. Now that you have some saving you can definitely afford it. The next best thing of not doing it is to quit doing it now. Disclaimer: I built a similar system in the past, took some gains and then realised the above. I then quitted to build a c…

I have been working on such a system and it is NOT a huge loss of your time. I've learned so much things in the past year, in market microstructure, in networking (infrastructure, protocols), cloud computing, cloud management (docker swarm, kubernetes), linux kernel bypass, distributed systems, data base, and I've read hundreds of papers on neural networks, gaussian processes, etc... If you are wondering if you should get into this, it is one of the best learning experience you will ever have.

Re: Lessons learned building an ML trading system

#128
post #78

Can someone comment on how taxes are handled when automated trades are made like this? It's something that seems wholly absent from the cost calculations.

Author here. Personally, I just don't. I tried doing it but it was too complicated. So I end up just hiring a tax accountant specializing in crypto, send them all the data I have, and pay a few $k. In case something goes wrong, it's their fault and they take the risk.

Why not establish a trading firm in an offshore country with no capital gain tax ? The bookkeeping of crypto txs is hell

Re: Lessons learned building an ML trading system

#129
post #100

Earlier quoted context omitted.

Ran an ML model years ago had a number of great months then out of no where no trade I or the ML would make, would work. Looked like someone was front running my orders and messing with my trades. Weird delays, trades would take to long to go through all, and all sorts of odd events on Level 2. Ended up shutting it down took a good 2 months before my manual trades started going through at a normal rate again. This is…

I think, though I'm not sure, that RH makes their money by investing in treasury bills with the cash balances of people's portfolios. You're (most likely) not getting secretly screwed.

A great article on the subject: https://www.kalzumeus.com/2019/6/26/how-brokerages-make-mone...

Re: Lessons learned building an ML trading system

#130
post #38

Earlier quoted context omitted.

> Best we could tell someone was front running us due to an artificial delay for our account (delay between trades went to ~20ms up from our prior steady speed of 3-7ms) and/or a bunch of the trades in the orderbook were bogus. I wouldn't be surprised, given that traditional HFT companies are building cryptotrading desks and they have a lot more capital to play with too.

You can't simply front-run someone else by having deep pockets. The only way that is possible is if you gain privileged information about that person's orders before they actually hit the book. The most practical way to do this is to be the exchange.

> You can't simply front-run someone else by having deep pockets.

Well you can, as was discovered in the Haim Bodek HFT shit storm.

Post reply on HN