I want to build a system that buys and sells stocks automatically. This isn't a new thing. Lots of institutional investors use algorithmic trading systems. Recently a bunch of retail algorithmic trading platforms have become available that let anyone configure their own algorithmic trading systems. I'm not particularly interested in using someone else's platform, but am very interested in writing my own from scratch.
I've read most of the books out there on writing algorithmic trading systems, including systems for trading stocks and cryptocurrencies. I can sum up the architectures and code examples that these books describe succinctly as "hot garbage." Seriously, there's no way a viable software system could be written following the examples in these books. So, it looks like I'll be starting at the bottom and working my way up, at least from the perspective of the technology.
There is much more to draw from when looking at strategies to implement within an algorithmic trader. The classic advice is "buy low, sell high." That's great, but it's tricky to know what constitutes high or low and how to get a computer to decide if it is the right time to buy. Simply watching for a stock to fall isn't enough. Enron's stock went very low before it utterly fell apart. There are whole books on trading strategies that seek to answer the question of when to buy and when to sell. I'm slightly skeptical about the efficacy of any one strategy though. Presumably, if one of them worked really well, everyone would use it.
One unlikely place that I'm drawing inspiration from is sensory biology. I read Ed Yong's "An Immense World" and it got me thinking of these trading systems from the perspective of sensory biology. There are a lot of parallels. An organism detect a stimulus via a receptor. The receptor is a part of a sense organ which is part of the sensory system. The sensory system converts that initial stimulus into information. Presumably the organism then decides on a response. I see an algorithmic trading system as being similar, except that instead of a stimulus being a certain smell or sound, it might be the current trading price of a stock. I'll expand on this notion as I build out the trading system.
I want to create a system that outperforms the market over a 12 month period. For this objective, making money isn't the only way to succeed. What I'll do is benchmark the trading system against the performance of the S&P 500. If the S&P has a positive return over a 12 month period, then I want to generate a higher return. If the S&P loses money over a 12 month period, then I want to generate smaller losses. This way, if we are mired in a recession, I don't need to wait for us to pull out of it to hit my objective.