An open source set of out-of-the-box grid policies on Github

Author: fengok, Created: 2021-03-13 23:39:41, Updated: 2021-03-13 23:44:12

  • The policy changed the file name to English before running, to make it easier for everyone to understand the Chinese version I'm trying to make.

  • Digital currency exchanges that can be operated after the strategy is adapted

     * BitMEX :数字货币期货、永续合约
    
     * Bybit :数字货币永续合约
    
     * Binance :数字货币现货
    
     * Binance永续 :数字货币永续合约
    
     * OKEX :数字货币现货
    
     * OKEX永续 :数字货币永续合约
    
     * OKEX期货 :数字货币期货
    
     * Huobi :数字货币现货
    
     * Huobi期货 :数字货币期货
    
     * Huobi永续 :数字货币永续 
    
     * Bitfinex :数字货币现货
    
     * Coinbase :数字货币现货
    
     * Bitstamp :数字货币现货
    

How to use it

  • All code in the policy library is updated regularly to adapt to exchange upgrades and changes.
  • All the policies are available, fill in your own APIKey and Sercet, fill in the parameters and run.
  • Each strategy has a different corresponding exchange, and the same strategy differentiates exchanges based on the name.
  • Mainstream exchanges use the CCXT implementation, while non-mainstream exchanges are also suitable for all publicly available private APIs that can be run directly.
  • Non-mainstream exchange data format returns consistent with CCXT data format to facilitate data analysis
  • Running environment Python 3, CCXT needs to be installed on its own ((pip install ccxt)
  • Python recommends using a Linux system, with tmux allowing for more convenient monitoring strategies
  • JavaScript policy based on FMZ running ((originalbotvs)

How to use the strategy

  • Because each exchange is different, Bitmex's XBT is currently compatible with ETH, OKEX is compatible with BTC/USD, BTC/USDT, ETH/USD, ETH/USDT, and if more pairs are compatible, compatible pairs are added according to the corresponding format in the Quant.py file initialization exchange location and the corresponding websocket subscription location of different exchanges.
  • When filling in the input document exchange, fill it in according to the annotation format
  • The grid can be bidirectional or unidirectional, and the number of grids on one side can be set to 0.
  • 本策略是将订单信息写入Mongodb数据库的,如果要同时运行两个交易所,要将Quant.py文件与对应websocket文件中初始化数据库时的端口改掉,防止端口冲突
  • When the program is initializing the websocket when it is importing the file The parameter ping_interval is the timeout time, which can be set to 20, depending on the requirements
  • The implementation logic of this strategy is to order in bulk for the first time, write the order's direction, status, price into the database, subscribe to the order channel of the websocket, get the order transaction information, if the order state is fully completed, or withdrawn, then change the order state in the database, the check order function in the policy document will take the order's current state from the database, if the order is completed or withdrawn, the order will be re-hanged according to the current situation, achieving the effect of the grid.

More

The grassPraise and worship