I built a trading Algorithm that predicts the price of Bitcoin
Since people love predictions, I created a trading algorithm that uses machine learning in order predict the price of Bitcoin and then places a buy order based on this prediction. Obligatory AI-generated hero image.
Here’s how I built it, and how the strategy works. I will also be sharing a link to the GitHub repo so you can see the source code directly.
First off — Prerequisites
- The tools: for this project I decided to go with C#, Visual Studio 2022 and .NET6. Visual Studio 2022 comes with a built-in machine learning module that’s easy to integrate into the codebase.
- A dataset: Kaggle is great place to get free datasets that can be used in machine learning. I went with this one. It contains 1 minute, 1 hour and 1 day timeframes since 2013 so it’s pretty good.
Now the strategy
The idea is to predict a new price, and then act on this prediction by placing a trade. Since I have access to 1 minute, 1 hour and 1 day historical data, means that I can choose which value I want the model to predict. I went with the 1 hour dataset so that I can generate a 1 hour prediction. My My thinking was that 1 minute seemed too close to matter and 1 day would be taking too much of a chance. So the goal is to predict what the price of Bitcoin would be an…