Code Monkey home page Code Monkey logo

ml-crypto-trading-bot's Introduction

๐Ÿค– ml-crypto-trading-bot

Cryptocurrency trading bot using Machine Learning and Rust. Inspired by CyberPunkMetalHead/cryptocurrency-machine-learning-prediction-algo-trading.

โš ๏ธ Disclaimer

This bot has been developed in response to another project and out of curiousity to see if I could build an improved version in Rust. The efficiency of the strategy itself hasn't been thoroughly tested. Use this program at your own risk!

๐Ÿ“– Strategy

The trading strategy is relatively simple:

  • Fetch the last X days of hourly kline (candle) data from Binance.
  • Train a machine learning model on the data. I'm using LightGBM, which is a fast gradient boosting framework that uses tree based learning algorithms. It's not perfect and predictions aren't nearly as close to reality as other solutions like recurrent neural networks (RNN) like LSTM, but in my testing it can provide a good indicator for basic market movements (price up or down), which is all I need for this strategy.
  • Using the trained model, predict the current candle high price. If it's lower than the current open or close (i.e current) price, wait for the next candle and start over. Otherwise, place a buy order.
  • Finally, the bot waits for the price to go up until the the prediction is reached. If the prediction isn't reached by the end of the candle, it just waits until the prediction is reached eventually.

๐Ÿ’ป Installation & usage

Install Rust and clone this repository:

$ git clone https://github.com/sleeyax/ml-crypto-trading-bot.git
$ cd ml-crypto-trading-bot

Then, copy the config file and edit it accordingly (should be self-explanatory):

$ cp config.example.yaml config.yaml
$ vim config.yaml # or use any other text editor of choice to edit the config file

To run the bot in development mode, execute:

$ RUST_LOG=debug cargo run

To run the bot in production mode, execute:

$ RUST_LOG=info cargo run

You can also build a release binary with cargo build -r and copy it + your config file to a VPS or raspberry pi.

๐Ÿ“ท Screenshots

image

ml-crypto-trading-bot's People

Contributors

sleeyax avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.