This is basics for those who start creating anything HFT.
Your project is a nice start. It has a lot of things waiting to be added and improved. I’d also add it looks like a 1-2 week project (excluding benchmarks) in my company for people who just started doing trading systems, and it reminds me of the project that is given to people that have finished C++ training and need something to exercise on.
While it is a good start, I’d add you may find a lot of interesting ideas in QuantLib (https://www.quantlib.org/).
Please also be careful with double for price and quantity especially in HFT and especially with asset types like BTC. The precision issues may lead to some confusion and eventual losses here and there. I noticed that you use fuzzy floating point comparisons, even in tests. That may not be suitable for important use cases.
Please also add some examples for specific trading strategies. Let’s say if you have back testing and some simple historic data in JSON a good example could be a comparison of two trading strategies and the difference compared to most optimal trading strategy possible.
Yea, there is lot to be added, that's by design. I'm not aiming for one-pass toy, this is foundational infra, not a weekend simulator.
FP numbers wrapper are planned. Sharing strategies is not a priority, maybe I will add some just for demo. And for sure I'm not sharing backtesting engine.
Combined with HFT CppCon talk that emphasizes the impact of node-based STL containers you may benefit from using some optimized hash maps on top of vectors, if you aim at top-performance in runtime. Also, abseil has some flat sets/maps implementation. All of this could be a nice addition if you experiment with performance (I figured that from std::pmr use in your project).
100% agreed, stl containers should be replaced. The problem here is that I'd like to keep the core dependency-free... However, functionality first, squeeze maximum later. I'll definitely give a try for non-stl containers and if measurements beat - make the usage of container implementation controllable by compilation options, keeping things configurable as much as possible.
Thank you for your ideas and advice! Great and valuable feedback
Sooner or later there will inevitably appear a new language, or an evolution of the current Rust, which will be significantly better than Rust and not just a minor tweak to the language we know today . Let’s say it is named Rust++ (any resemblance to existing languages is a pure coincidence). And the whole hype and rewrite starts over again… it is just a matter of time.
It looks like you professionally sold 30 years of your life for money with no fun. You could have done something for fun all this time, and got payed for it, too. Much better that way.
I did no such thing, I spent the first 15 years as a part time fitness instructor mostly for the social aspect, hanging out with friends and training for and doing group runs and a little travel.
I spent the next 8 years married (still married) and raising two step sons and spent the last two and half years traveling extensively including over a year doing the “digital nomad thing”.
We have been averaging getting on a plane to do something on average over a dozen times a year since late 2021.
Of course the Covid lockdown slowed us down for two years.
When I am at home in Florida, I go swimming at one of the multiple pools or workout at one of the two gyms that’s part of our complex. It’s warm enough most of the year at least during the day.
During the weekends, I go downstairs and hang out at the bar and just sip soda while hanging out with my friend the bartender and whoever else is down there.
I “retired my wife” in 2020 when I was 46 and she was 44 8 years into my marriage so she could pursue her passion projects and we could pick up and travel as often as we wanted to - the joys of working remotely.
Atom is not around. Not 100 percent sure that VSCode will be around. (But I also don’t think that this should hold anyone back who finds VSCode to fit their needs best. There’ll be something else that will take its place.)
Mind you, before this goes to prod please add error handling and logging. What happens when bar fails? What about baz? Now, please rewrite this so your team mates can maintain and extend. Yawn, I’ll wait for the PR.
Gotcha, thanks for the feedback! We should also totally A/B test this! I'll make sure that this ties in with the quarterly OKRs, too! I hope I'll get promoted to E6 for that sweet 10% raise next cycle :fingers_crossed: