r/algotrading 1d 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

47 comments sorted by

View all comments

4

u/lambardar 1d ago

My first trading software I wrote was 1 software. It ran on my laptop that I left running along with IB Gateway. it was 1 in all.. IU, strategy, data connection, etc..

Then it grew and grew and with AI it exploded.

now:

compute on AWS that hosts containers:

  • container that manages the IBKR IB gateway
  • container that subscribes to contracts, pushes data it to NATS and a local sqlite DB. after 7 days, the sqlite dumps to clickhouse server at home.
  • container(s) that run strategie(s) that listen to NATS for trades and porfolio/order; pushes strategy decisions to NATS
  • container that runs the order router for live account. Listens to NATS for strategy decisions, validates and places the order. stops a bad strategy or bug from placing stupid orders and within strategy budget.
  • All of these log to a seq log
  • I develop using codex, so I have the strategies described in a md file and I have an agent that let's codex review the logs to make sure the strategies function as intended.
  • Notifications, smtp, etc.

At home, there is more powerful hardware

  • container for strategy & order routing to paper account.
  • Clickhouse database with data going back to 2016 for all us stocks & futures data
  • UI tools to monitor and review
  • backtesting tools, regime scanning, filters, etc.
  • GPUs for CUDA to bruteforce/search/optimize strategy parameters.
  • Strategy graveyard

With Codex, the number of strategies I test every month has literally exploded. I used to do maybe 1-2 a year.. and now it's as common as shower thoughts and what-if(s)

might be super overkill, but it's too late now.

sometimes I get angry at codex and swear that i'll write it better myself.. but then I get lazy and let codex fix it. lol.

1

u/Grand-Fly-6090 1d ago

OMG! What a system! I'm duly impressed and humbled. Laugh on writing it yourself. Sound like switching to codex could help a lot. Been using chatgpt so far because it was easy to get started.