Live data from Hacker News

Case study: Algorithmic trading with Go

polygon.io

221–230 of 311 posts

Re: Case study: Algorithmic trading with Go

#221

Earlier quoted context omitted.

Seems more pointless than crypto to be honest.

It may seem so at the first glance, but such trading if carried out by many independent providers actually increases the liquidity if the market for everyone else. Likewise with crypto. Personally I don't think that if you're calling an API over an Internet it matters if your trading bot is written in go or python (mine was in python). Use the language you're most comfortable in. The network and trade submission/exec…

"increases the liquidity if the market for everyone else"

That's just it. The whole premise is pretty absurd. The market, the actors, everything. It's so far removed from literally anything remotely human. It's the financial equivalent of an infinite sea of AI bots producing CVs and research papers which are only being evaluated and read by other bots.

If you step away from it all for a second, what the hell is the endgame of this whole hustle.

Re: Case study: Algorithmic trading with Go

#222
post #161

Earlier quoted context omitted.

It's quite a statement. You're almost saying capitalism and efficient markets are pointless. Maybe they are, but I think it's nothing like crypto. In the old days before HFT, you weren't sure you'd get the best price. You'd have to rely on a broker to make sure that happens, but as a retail trader you generally got a worse price/out of date price. Nowadays with HFT you can get pretty much the best price anywhere. Tho…

>You're almost saying capitalism and efficient markets are pointless. Maybe they are, but I think it's nothing like crypto. People are saying this because, HFT sounds similar to 'crypto mining'. That's people with best infrastructure, the 'big-guys' -- win. While leaving out the retail investors as broiler chicken, pumped with 'drugs' (by influencers) to spend more on imaginary assets, so that they can be used for 'f…

So are retail investors truly no different from the people gambling their money on the lottery at the 7/11 every night?

Do any regular pedestrian middle class retail investors EVER actually earn enough to retire on? Or do anything meaningful with? If so.. what is THEIR secret sauce, since it's not HFT...

Re: Case study: Algorithmic trading with Go

#223

Nicely done. A couple of pointers. One on data, one on that RAM usage. First I’ll go with the RAM usage because this is hackernews and everyone loves algorithms. —- There are a lot of libraries out there that do technical analysis, and most of them are designed for batch processing. TALib is an example - it works on large data sets but is not appropriate for live trading because it repeats calculations over and over…

Oh, one more thing. Your bar method. Are you using number of trades or sum of trade sizes? Because if the former, there is little distinction between me firing off two market buys of 100 shares each in quick succession vs me firing off one market buy of 200 shares, so your sampling shouldn’t be impacted by the difference. I’m not altogether convinced by volume sampling. It’s an idea popularised by De Prado, but I’ve…

Do you mind sending me an email and maybe we could chat?

Thank you for your amazing comments. I really like your idea about indicators and saving state. I'll give that a try! Yeah, Marcos López de Prado is actually where I read about the tick bars and sampling at higher rates. You need like 2 phd's to read his books though. haha. I am doing this based on X number of ticks and not even looking at volume. I was using tick count as an indicator in that you can really see patterns when activity picks up. This sync issue is really really interesting and I'll explore this.

"The thing you’re actually doing is predicting what other people are going to predict." I think I've actually seen this in the data. In that you can see this mini-cycles almost when you really zoom into a fast moving stock. I'll check out. Both your comments are amazing and it 100% shows you know what you're talking about.

Re: Case study: Algorithmic trading with Go

#224
post #59

Earlier quoted context omitted.

Fascinating. Have you considered open sourcing this without your algorithms ( empty buy/ sell loops)? I’d like to play with something like this but I couldn’t be bothered to build it all from scratch.

Yeah, I can do that. Ping me at [redacted] and I'll send you a note when I've done it.

Do count me in as well! Literally in the middle of building something like this myself.

I've also got a few questions regarding the way you manage memory, so I might ask you a couple !

Re: Case study: Algorithmic trading with Go

#225
post #126

Earlier quoted context omitted.

Seems like every person I've ever met in M&A has ended up hating life because of their career choice. They seem to burn out in 5 years or so after salting away a million bucks or 3. Was that your feeling doing the HFT thing?

I work at an HFT firm. Most fun I've ever had.

Great to know. Offhand it seems it could be quite interesting to me as well.

Re: Case study: Algorithmic trading with Go

#226
post #125

Earlier quoted context omitted.

Well, your first problem was investing in VW (KIDDING!). But seriously, I usually stick to self-serve stock purchases. Was this a situation where you had to contact a human to make the buy in the first place, or was it that you bought it yourself, then VW changed up their infrastructure and inadvertently locked you out? Shitty situation either way.

Self serve, one one of those trading sites. No human contact, until the site wouldn’t let me trade the shares. I think the exchange changed up things and I am buying from another country so communication issues etc.

That feels like a gross violation of their fiduciary responsibility. Major bummer.

Re: Case study: Algorithmic trading with Go

#227
post #126

Earlier quoted context omitted.

Seems like every person I've ever met in M&A has ended up hating life because of their career choice. They seem to burn out in 5 years or so after salting away a million bucks or 3. Was that your feeling doing the HFT thing?

I work at an HFT firm. Most fun I've ever had.

Agreed. Concerns about more nebulous effects on society didn't change the fact that it was great fun. I miss it.

Re: Case study: Algorithmic trading with Go

#228

Earlier quoted context omitted.

It’s true I’m US centric. What I do know about European equities market structure actually points to one specific problem that actually we also have some of in the US. I’d suggest you look at clearing house collateral regulations, especially around ETF transactions, creation and redemption, and posting of OTC positions. That part of the system, which btw isn’t HFT, is very very shady. I agree it’s all quite understan…

Yes, toxic flows and adverse selection are the magical buzzwords that get thrown around a lot. I’m familiar with glosten-milgrom model and private information and all related paradoxes. What you’re failing to disclose is that there is an easy way out of solving the adverse selection problem. For example you could buy “uninformed flow”. I think that you could agree that for the touted sophistication of the field you w…

While I fully believe you are an experienced practitioner however I feel your thought experiment actually shows you don’t understand the underlying nature of capital markets in capitalism, the relationship between risk and liquidity, and the fractal nature of timescales of participants. I’m fortunate enough to have both a background in HFT but prior to that a background in many other aspects of capital markets and the broader financial system, which gives be a better perspective than the typical HFT strategist or engineer.

It’s too late in the day for me today to attempt to write a coherent and accurate explanation of exactly why I say that. However I will say you don’t understand this isn’t a zero sum game and it’s an incorrect argument to claim HFT is an arms race in a game like a war, which is a negative sum game.

Re: Case study: Algorithmic trading with Go

#229

I worked in HFT for a while. I find the whole space fascinating. I'm glad OP found similar thrills. "This aspect, the platform itself, seems to be often overlooked in most discussions. Many conversations revolve around strategies (mean reversion, trend following, linear regression, etc.), and backtesting, without fully addressing the practical mechanics or logistics of strategy implementation, particularly in the con…

Is there a market for s much “slower HFT”. There’s a very wide gap between day traders and ns traders after all.

Re: Case study: Algorithmic trading with Go

#230

I've been building a bot with Typescript because it is what I know and Python because of the tools available. It is an overwhelming lonely endeavor. With all my other projects, I've always worked on teams, although they have always been very small teams and most of my work was autonomous -- still there was the occasional meeting and stand-ups. I've been working on this for six months and thought about bringing a frie…

How can you hope to compete with the pros? You're not going to be faster than them and unless you have several PhDs in maths it's unlikely you'll come up with a better algorithm. The only way I can think of is to get data that they can't.

There are plenty of strategies that can be profitable on a small scale but which just don't work as you scale up the capital or leverage. Such strategies can be simultaneously profitable for a small operation and not worth the bother for most larger trading shops.
Post reply on HN