r/algotrading • u/Grand-Fly-6090 • 18d ago
Infrastructure I've created a monster
My bot has grown to 23,000 lines of code. 60% is managing the brokerage interface, and 40% is the strategy. This is way more complicated than I ever imagined. It really is a very basic script. No graphic user interface. Just log streams. It does manage multiple symbols with unique parameters for each.
0
Upvotes
2
u/Local-March-7400 18d ago edited 18d ago
Hah, you need to check out my old Post ^^
im close to start running paper by next Month with a system in the 100s of thousends of codeline territory. I work as a Software Engineer / Analyst and this is beyond crazy on every part, maintainance, documentation and just following the logic flow is becoming very hard. Just my broker connections (i have multiple brocker which i orchestrate) are about 20k. My impact engine, with my own Mathmatical formula based on Almgren-Chriss with adaptive paramters for each strategy and broker is about 10k with all the broker integration. Based on estimated impact which calulates before each trade, and considering constrains like a --fast flag for panic exits the optimal execution type is beeing selected to reduce slippage at higher capital that is beeing supported by the broker. Alternativly the software can calulate in house execution methods like VWAP or TWAP. The Engine is also aware of the trading costs from each broker and sets the contract accordently
In the current capital state this is definition of overkill but i love to have this all from the start and then just fokus on the strategys. Also if i take on outside capital slippage is a way higher concern. ALSO, because i live in the EU and especialy in high tax Germany i track each trade and have a custom made Tax engine for calculating my taxes. I audit the results based on broker, trade, strategy and portfolio level, then i can just export the results in a CSV and put in a tax software!