Update: I have been live paper trading this algorithm for the last week and the entries and exits have matched backtests so far. Paper profit w/ leverage so far is decent. I am not dumb enough to think that this means anything yet. The main issue right now is that I occasionally lose the connection to Interactive Brokers and then everything stops working. I haven't spent any time fixing this issue yet, but I believe that the underlying cause is my using WiFi which is kind of flaky on this motherboard. As such, I will probably create a Docker container to use some form of headless/automated Interactive Broker connection and deploy it to one of the cloud providers. I plan to have that change completed by this week (so next update should be Jan 14).
I wanted to add that the underlying cause is obviously some code issue. I don't want to investigate that right now, and since I wanted to get the trading off my gaming/work machine, this may kill two birds with one stone. If it doesn't, then I'll still at least have gotten the trading off my gaming machine (I actually play Rocket League while it's trading, kinda funny).
Are you sure that your machine has enough RAM to handle both your game and TWS at the same time? TWS is very RAM-hungry. In case you don't need the GUI that TWS offers, could you consider to to use Gateway instead. Gateway has a much smaller footprint.
Thanks for the suggestion! I'm already using gateway but I have 32GB of RAM and 4 logical cores. So far no problems!
I've never seen TWS to use over a gig and a half of ram. Not really an issue with today's memory configurations. As far as the disconnects go @nooby_mcnoob you're going to have to solve that issue whether it's on your own box or "in the cloud." The connection could disconnect at any time for any reason and you should completely expect that to happen. Unfortunately that probably means you're gonna need an if statement somewhere behind the scenes.
That amount of RAM should be sufficient. TWS uses about 1.5 ~ 2 GB of RAM. Gateway uses only a small fraction of that (0.02 GB or something small like that?). It is important for you to figure out what portion of the communication chain is causing the disruptions you mentioned. Not only to make your setup more reliable, but also for your own piece of mind. Is it your internet provider? Or is it something on your end (e.g. modem, router, wifi, or software implementation)?
Minor update: I have fixed the issue and also set up a Docker image for the trading. Will have it running locally this week, still paper trading though. A week late, but still done...