My Journey to Profitable Algotrader

In 2017 I was captivated by the Bitcoin run to over $20,000.

Like many, I knew I wanted to get involved but I wasn't sure how. Mining, blockchain development, and day trading all seemed interesting, but as a software engineer the idea of algotrading seemed the most interesting.

Fast forward to 2021, my algotrading bot "Bitshark" made me over $100,000 dollars in profit (over 400% return). In total, my bot managed over 10,000 transactions.

In 2017, I had already started searching for strategies for trading. Eventually I found one Youtuber I really liked, trusted, and understood (more on the strategy itself another day). I took up to trying out his strategy by trading manually. I found some success, but often times I would not execute a trade correctly because I was asleep in the middle of the night or at work. This irked me endlessly. I channeled that frustration motivation to create automation.

I started by writing a simple backtesting script from scratch. I knew next to nothing at that point, and I made every mistake you can imagine. "I'm going to be rich in a few weeks!!!" I remember thinking to myself as my backtests returned profit numbers in the hundreds of millions.

After spot checking the backtest against reality, I quickly found out I had made many flawed assumptions and my code was riddled with bugs. Classic rookie mistake, I know. However, despite these setbacks, something had been ignited withing me.

I can build something that makes money while I sleep.

I had never really considered this as an option. My fire and motivation to take this further was burning more intensely than ever.

There were several days I never even got out of bed except to eat and use the restroom. I literally woke up, reached and grabbed my laptop from the nightstand, coded all day, and eventually put my laptop back on the nightstand and went back to sleep for the night.

Eventually, I ironed out all the kinks (or so I thought). I decided I was ready to turn on my bot for the first time.

"Here we go!!!" I thought to myself as I excitedly watched the first live logs come in:

Bought $100 of x
Bought $100 of x
Bought $100 of x
Bought $100 of x
Bought $100 of x
Bought $100 of x

😫 "Oh no, there must be bugs in the runtime code causing an infinite loop of buys!" I scrambled furiously to turn to bot off. This was going to be much harder than I was hoping.

I made some fixes, and turned the bot back on. Different bug. Turned the bot off. Made some fixes. Turned the bot back on. The feedback loop was up and running.

This cycle continued for weeks and months, but eventually my bot stabilized and I was able to keep the bot running for stretches of time without being afraid it would lose all my money.

Eventually my focus shifted from stability and maintainability to strategy optimization. My bot was consistently winning, but something was holding it back -- it was only trading against of symbol pair.

Read more about how I solved Bitshark's single market limitation by using "the slots strategy" in a future blog post.

By the way, I'm on Twitter if you want to follow along with my work!