GithubHelp home page GithubHelp logo

gitter-badger / algo-trading Goto Github PK

View Code? Open in Web Editor NEW

This project forked from garyyu/algo-trading

0.0 0.0 0.0 1.68 MB

algorithm trading on Binance exchange, will extend to other exchanges

License: MIT License

Go 100.00%

algo-trading's Introduction

Algorithm Trading with Binance API

Algorithmic trading (automated trading, black-box trading or simply algo-trading) is the process of using computers programed to follow a defined set of instructions (an algorithm) for placing a trade in order to generate profits at a speed and frequency that is impossible for a human trader. The defined sets of rules are based on timing, price, quantity or any mathematical model. Apart from profit opportunities for the trader, algo-trading makes markets more liquid and makes trading more systematic by ruling out the impact of human emotions on trading activities.

This project is only for cryptocurrency trading for example BTC, ETH, BNB and so on. For the moment, it's using Binance API to do this, and plan to support other exchanges also.

Getting started

Get the code and build

git clone https://github.com/garyyu/algo-trading.git
cd algo-trading
go get
go build

Before running

Some environment variables have to be set before running this algo-trading

Propose to create a file named as binance.env and write these privacy info in it. But remember to keep this file safe!

# APIKEY
export BINANCE_APIKEY="Iuw9nD****"
export BINANCE_SECRET="Xe3yzK****"

# MySQL
export BINANCE_DB_USER="your_db_user_name"
export BINANCE_DB_PWD="your_db_password"

You can find your binance APIKEY and SECRET in your Binance website.

MySQL database preparation

Please read some MySQL basic usage document firstly if you're new to database.

Create a new database with name as binance.

After your MySQL service start up and binance database created, you can set up the database tables for the 1st time:

mysql -uYour_DB_Username -pYour_DB_Password -Dbinance < db/*.sql 

This will set up all the DB tables.

Ready to Run

After setting up all above well, and starting your MySQL database service, then you can run algo-trading now:

souce ~/binance.env
./algo-trading

For the first time of running, it could need some time to download some history K-Lines data from Binance API server.

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.