▶ Full Post Text
Ive been wondering this for a while now, how many of you are seriously developing a big trading infrastructure. After creating a first strategy that seems stable enouth with all the necessary testing and ironing out all the backtesting bugs my engine had (and that i could find), ive started to develop my bot to trade the strategy in paper and then live. Im a german coming from CS and Business backround.
However, after understanding better and better what kind of management for execution, orchestration, robustness and logging / analysis needed, the Development is spireling out of control. What started with a simple IBKR Python bot that saved data in json (i know...) is becoming bigger and bigger, first i wanted a proper postgres DB for telemetry of strategy and integration of my custom made Tax and cost engine (first in R then switched to python). Then wanted a proper React Frontend. Now it had around a few thousend to 10k LOC.
After researching and testing further ive realised that even buying and selling Options on my wanted products on US markets did work as EU citizen.
No problem i thought, then i just switch to the EU Products. Found out about Market impact analysis with calculating Slippage using **Almgren-Chriss model**
[tempory market impact \(slippage\)](https://preview.redd.it/9kl7yesnnr3h1.png?width=371&format=png&auto=webp&s=65d28f8255303dc40bdd18f5b5417a2522110f69)
[total cost of trade](https://preview.redd.it/gxjwwpysnr3h1.png?width=251&format=png&auto=webp&s=88c639f4975cd8e917fbc3ec5716980f0c257bfe)
Found out that with EU products my capacity would drop to 100k from Millions!
Realized after lots of research that the only broker who could handle it was Tastytrade to circument the UCITS ban (has an api, YES! but citadel takes a cut). Therefore needed now multi broker orchestration, integration of market impact before trading, Tax Engine V2, telemetry got more complicated, market data maybe from multiple sources, basicaly had to build a full institutional trading application. Also added tons of robustness features, smart execution engine based on slippage and supported order types based on broker, degrading instead of crashing, alerting/reporting to mobile and possible kill switch.
Found out in testing that bot needs to know when there is a national holiday or half days or shutdowns of exchanges (shocker!), otherwise tons of orders went to the broker and engine could not understand why they wont coming through.
After working on it i halfway thought that maybe i should consider switching to a standard engine like Nautilus or Lean instead of custom made, but quickly realized that for EU traders who need Tax tracking, integration of not so common brokers like tastytrade, advanced telemetry and MFID2 / UCITS robustness 0 software existed. The market ... is non existing. Hacking a already established platform would probely take just as long.
By now my platform is about 200 to 250k NLOC big and ive been working on my strategy and this Trading software for almost 2 years now. Looking to finish EOY. **This a major pain in the ass and i cannot imagine that a lot of people in this sub are going through this. Therefore i have a few Questions:**
\- How long did your infrastructure creation take and how have you minimized the complexity of your algo?
\- Tipps from EU traders?
\- Are you using Custom engine or a already build one?
\- how you handle taxes?
\- Tipps for designing the architecture (have the feeling my architecture became to cluttered and to legacy code dependent. Also its a module based architecture so its less rigid)
\- How much complexity do you have? NLOC?
\- Time to live, did it also take you years of basicaly non stop work?
Thanks for answers and best regards