Live data from Hacker News

Lessons learned building an ML trading system

tradientblog.com

131–140 of 160 posts

Re: Lessons learned building an ML trading system

#131
Is anyone else suspicious about the results?

Claiming a 4000% return while staying market neutral seems a little too good to be true.

First: those levels are insanely high, so the algo must be taking some absurd risks and have the worst sharpe ratio, or getting pretty close to being 100% accurate.

Second: if you can scale this across markets, and assuming the same return, that investment will turn into 12 billions in 4 years. I doubt that you'd write a blog post about it if you had found such a gold mine.

Re: Lessons learned building an ML trading system

#132
post #131

Is anyone else suspicious about the results? Claiming a 4000% return while staying market neutral seems a little too good to be true. First: those levels are insanely high, so the algo must be taking some absurd risks and have the worst sharpe ratio, or getting pretty close to being 100% accurate. Second: if you can scale this across markets, and assuming the same return, that investment will turn into 12 billions in…

Is't it so that many of these strategies don't scale well? When you are in low volume trading you are collecting all the best trades but as soon as you go 10x you are affecting way too much

Re: Lessons learned building an ML trading system

#133
post #82
post #79

Earlier quoted context omitted.

That's not how things work. You would see much less demand/supply for a particular stock at every price level, which means you'd pay much more to buy less and would have to pay much more to sell less also. There are no upsides to having fewer market makers.

> you would see much less demand/supply Why? If the HFT firm was willing to offer me $X 2 milliseconds ago they are probably still willing to offer $X now. It isn't like there has been time for anything to change; there are going to be short periods of time where there is literally no new information. And they are just as likely to be offering me more now than less as conditions change.

if they weren't able to move their price 2 milliseconds later, they wouldn't offer $X in the first place.

Re: Lessons learned building an ML trading system

#134
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.

Pretty much everyone sells part or all of their flow to Citadel or Citi.

Re: Lessons learned building an ML trading system

#135
post #50
post #37

Earlier quoted context omitted.

Even in regulated markets there are problems. I have a friend who built an HFT algorithm that he was using for trading stocks. He had some really good results with early testing. But at some point he was confused why many of his buy/sell orders weren't being executed despite being open for several minutes (hours?) his algo would make bids far away from the current spread, anticipating movement. He finally concluded t…

> But at some point he was confused why many of his buy/sell orders weren't being executed despite being open for several minutes (hours?) his algo would make bids far away from the current spread, anticipating movement * Did his levels actually get crossed? It could be that he never had the opportunity to get filled at the price he hoped for. * What was his queue position? Stock exchanges tend to be price time order…

you can do sub-penny price improvement but you cannot quote at a sub-penny.

Re: Lessons learned building an ML trading system

#136
post #135
post #50

Earlier quoted context omitted.

> But at some point he was confused why many of his buy/sell orders weren't being executed despite being open for several minutes (hours?) his algo would make bids far away from the current spread, anticipating movement * Did his levels actually get crossed? It could be that he never had the opportunity to get filled at the price he hoped for. * What was his queue position? Stock exchanges tend to be price time order…

you can do sub-penny price improvement but you cannot quote at a sub-penny.

Technically this is incorrect. Stocks trading below $1.00 may be quoted in sub-penny increments.

Re: Lessons learned building an ML trading system

#138

I spent the last year working fulltime on a system similar to the one described here. I trade the top ~20 cryptos on binance. I use deep learning models (combination of temporal, causal convnets and RNNs) with heavy data augmentation. I built my own tooling for data collection, training, backtesting and live deployment. Having a data engineer background coming into this was hugely helpful: most of my time was spent m…

Are you concerned by other commenters who mention that once they were successful the exchange moved in to either stop them or extract a fee?

Re: Lessons learned building an ML trading system

#139

After having spent an insane amount of time in late 2017/2018 building an HFT bot for Binance I can say this is a pretty solid article. In our case we were doing triangle trading between BTC/ETH/USDT pairs and had our buys/sell delay down to 3-7ms. At one point moving 0.3-0.7% of Binance’s daily volume. Few notes: * Finding an objective point of truth for value when all of the currencies are floating is hard but vita…

> the orderbooks were slightly different between bots That sounds like a big deal. If this is repeatable, you should document it better. Unregulated doesn't mean a license to do blatantly illegal things. Crypto exchanges certainly get taken to court. Sure it wasnt your book building algo and a snapshot retrieval race?

There's a much less nefarious explanation. I'm not saying they didn't manipulate the order book feeds. I work in the regulated trading space. I've written market data decoders. One is in production inside of a bigger trading system I wrote at a customer as I type this.

The less nefarious explanation is simple. You decide how likely it is: there is no mechanism making sure that IP packets sent to all data feed subscribers arrive at the same time. Exchanges of consequence distribute market data via UDP multicast, over physical links that are as identical as possible (think identical lengths of fibre).

Now if you're receiving JSON via Websocket and parsing it using an allocating parser and your NIC driver is in kernel space and you use a GC'd language and if the exchange loops through a list of TCP connections to send a message to them one at a time and there is jitter in packet delivery time in upstream hosts (and other internet weather) and and and ... you simply cannot expect identical order books at the submillisecond timescale.

A fortiori, throw half of that crap away and suppose they were using userspace NICs and no-alloc single threaded C++ that chills entirely in L1 cache. Still consuming TCP over the public internet.

Re: Lessons learned building an ML trading system

#140
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.

Why invest in treasury bills at 1.8% yield when you can invest in margin lending at 5%?
Post reply on HN