Stock Algorithm


I’ve got a stock algorithm that has been in progress for several years. As many of you know I have a degree in physics and experience in signal analysis. I started the algorithm off and it looked promising, was simulating quite well (20% gains per month), but it wouldn’t work out. I was never getting anywhere near those gains. I was breaking even at best and even going red sometimes.

I got frustrated and kept tweaking it and debugging it. I thought “well I don’t know what I’m doing so I must be wrong”. Eventually, after several years of tweaking, I recognized that the input data – my stock ticks – that I was working off of were garbage. As the old saying goes, garbage in – garbage out. I never thought to troubleshoot the brokerage firm end of things. I realized this probably around 6 months ago. Consequently, I’ve been working ever since to remedy it. Unfortunately, I was reluctant the entire time to have confidence in myself.

I enjoy the challenge of this project and the potential upside to this is quite large. However, I’m at the point now where to ensure the stability of the program, I must switch programming platforms. I’m using Interactive Brokers for the brokerage service and running the algorithm in Excel. I probably should have just jumped all in and wrote it in an independent interface, but they recommended starting with Excel. I would have had a lot easier time doing it in an independent interface as it wouldn’t have caused me so many headaches with instability issues.

Regardless, I’m currently in the process of figuring out what it’ll take to switch over to an independent program and largely do away from running it in Excel. I’d ultimately like to get this up and going and use some of the proceeds to finance my side projects. Regardless, it’s taught me a ton about coding. I’ve built my own database – literally, not just using SQL or something off the shelf – but built my own database. This database allows me to simulate my algorithm on past data as well as keeping track of various events in the algorithm. I’ve learned even more about signal analysis and programming in general and have become an even better programmer. I’ve also had to debug Interactive Brokers’ code from time to time. Overall, though, it’s been a good project, just slightly frustrating.