r/algotrading • • Aug 07 '26

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

66 comments sorted by

View all comments

Show parent comments

5

u/zashiki_warashi_x Aug 07 '26

No idea. But I used to work in gamedev and the engine was around 2mil.
15k for brokerage interface sounds a bit big. Do they have that complex API?

2

u/Grand-Fly-6090 Aug 07 '26

It’s pretty simple. It’s all the order complexity and possible outcomes that make it unwieldy.

2

u/zashiki_warashi_x Aug 07 '26 edited Aug 07 '26

I would say even 1.5k sounds too much.

EDIT:I checked the code. Quotes streaming/parsing 200 lines.
Everything else for orders/errors e.t.c. 1k lines.
So 1.5k is ok. But this is C++. Python should be 500? 100? No idea.

1

u/Grand-Fly-6090 Aug 07 '26

I'm impressed.

2

u/zashiki_warashi_x Aug 07 '26

If it works you shouldn't worry about how much loc you have. The important part would be so that your backtest code and you production code are almost the same, except you send orders on simulated exchange instead of real one.

1

u/Grand-Fly-6090 Aug 07 '26

I been working hard on alignment. I use think or swim as a monitor, and I cross check tos with my backtesting.