Crypto Trading Bot using Python

I have been doing this AI/ML bootcamp for the past couple of months and I had this idea to try and create a bot that traded crypto based off of a regression model it would create. The bot interacts with the Coinbase API and grabs real time price data for any currency (I have it set for bitcoin in the current version). Then it applies multiple financial indicator functions on the pricing data and throws all of that into a bunch of arrays that get compiled into a pandas dataframe. While this data is being compiled, the bot is executing random buy/sells on the changing price and recording the profit change and adding that data array to the dataframe as well. Then this data is exported to another python script that does a linear regression model on the data with profit being the independent variable. This function is then fed back to the bot and it begins to execute buy/sells off of whether the function says the current parameters will increase price. The bot tries to execute buys like 99% of the time which is a huge issue with the model but I am happy that the basic idea works. This would need to be fined tuned a bunch to actually get it working in the way that I intended. I wanted it to execute trades very quickly to try and make marginal gains on the rapid price changes but it is not set up to operate that way as of right now. One of the biggest issues with this is that I might be trying to basically model an environment that is not modellable lol. I mean its literally chaotic price swings so I shouldn’t be too disappointed it wasn’t making any money….if it was I probably wouldn’t be writing this blog.

Link to the github repo:

https://github.com/lmgisme/cryptobot

Leave a Reply

Your email address will not be published.