4 ms·
Go itself, or any other language won't give you too much of an advantage. What gives you advantage is trading algo, which is always hard to find. I've spent mon
by RomanPushkin 3y ago
Go itself, or any other language won't give you too much of an advantage. What gives you advantage is trading algo, which is always hard to find. I've spent months on figuring out the best parameters for trading. Ended up this working only on historical data, while in reality it was totally different.
I could use Visual Basic, and it would be better than Go, Rust, or whatever it is out there, given the algo and strategy are flawless. Language is just a tool. It's great you used Go, but I think the title is a bit misleading - people think of it as some kind of advantage. It isn't.
And for HFT trading a language with Garbage Collector is not a great choice IMO.
- _zkyx 3y agoHey, I write this. I did program this in Go. The reason is that it's my go to programming language. Using it is actually a disadvantage in that the industry uses C++ and Python but that's just what I know how to program in. I wasn't trying to be misleading. Go does work really well for taking in data, doing something with it, and then calling a remote API. So, it actually works really well but if you wanted to get a job based off this it probably wouldn't help you.
- hu3 3y agoGo is great for network heavy apps like algo trading! I used Go to write trading algos that would find small windows of triangle arbitrages in crypto exchanges. Made me some money but the risk of a big loss made me stop pursing crypto trade and it required too much time and attention. It's a full time job from my experience. Reasons I could lose big at any given time if I scaled up the stakes: - Exchanges temporarily pausing some specific crypto trading for N reasons (happened very often) while I'm in the middle of the arbitrage. - Getting caught in the middle of a pump and dump event (also frequent) - Any algo mistake that would perform excessives trades in succession would incur huge losses because crypto exchanges charge %. Also, most cryptos have too low volatility. Every time I tried to scale my bot would start interferring oo much with the market. And it wasn't even much money.
- tomcam 3y agoIt was my (admittedly ignorant) impression that C++ was preferred over garbage-collected languages because you'd be more likely to avoid GC pauses. Yes, of course I know that Go's is super efficient, but if you're doing a million trades a day even a tiny percentage of slowdowns that would be otherwise preventable could be a career-limiting move. Am I just behind the times?
- hu3 3y agoI think you're right! Go will never beat C++ in this aspect. I used Go because that's what I knew and for the non-professional trading I was aiming, C++ wouldn't have made much difference. My bottlenecks were network (1s+ per trade roundtrip) and chaotic unreliable crypto markets. Just note that Java is used in HTF, but it's a different beast than our average CRUD Java. For example this article states: "Essentially, we use a contrived form of Java that avoids all the Java constructs that make things go slow. We only use the constructs that are fast and efficient, and we avoid all the garbage." https://www.efinancialcareers.co.uk/news/2020/11/low-latency-java-trading-systems https://www.efinancialcareers.co.uk/news/2020/11/low-latency...
- gkedzierski 3y agoI think there’s a way to disable GC in Go too, no?
- hu3 3y agoYep, you can with GOGC=off but then I would have to learn about how to generate less garbage in Go for long running processes. Which is good knowledge even for non-trading applications. I just didn't have the energy and time to try it.
- tomcam 3y agoAh, relief. Thanks for answering. At your volume Go makes perfect sense. Love your project!
- 3y ago
- cachvico 3y agoA language should be considered with its ecosystem, which is why the author started delegating parts to Python by the end. Therefore the title was actually on point.
- IshKebab 3y agoYou overfitted. That can happen due to human optimisation as well as computer optimisation. After you have experimented on some historical data for a while it becomes less useful.
- mhh__ 3y agoOr the model was crap.
- asavinov 3y ago> What gives you advantage is trading algo, which is always hard to find. At the end it is necessary to make a decision whether to buy or sell (and how much), which will compete with other decisions made based on some logic. Developing such a logic (strategy) manually is of course quite difficult. I developed an intelligent trading bot which derives its trading strategy from historic data: https://github.com/asavinov/intelligent-trading-bot https://github.com/asavinov/intelligent-trading-bot Currently it works for cryptocurrencies but can be applied to other markets: https://t.me/intelligent_trading_signals https://t.me/intelligent_trading_signals > I've spent months on figuring out the best parameters for trading. Ended up this working only on historical data, while in reality it was totally different. It is a typical situation. The whole problem is to develop a strategy which works for future (unseen) data. Even backtesting algorithms should be designed in such a way that future experience (data) does not leak to the past.
- c7DJTLrn 3y ago>And for HFT trading a language with Garbage Collector is not a great choice IMO. Depends. I've heard of places that use Java by creating a huge heap, minimising allocations to almost zero, and just restarting the app periodically before it can fill up. You can achieve very good performance doing this and you don't have to worry about memory bugs.
- maest 3y agoYou can make GC languages work for HFT if you do zero allocation code. There are places that use Java and just preallocate all the memory they need at startup. Jane Street famously uses OCAML