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

  • NOTE: Some programming functionality is required

  • The first is the web address:https://github.com/fengok/ThorCryptocurrencyQuant

  • 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: digital currency futures and perpetual contracts

      • Bybit: a permanent contract for digital currency

      • Binance: the digital currency of cash

      • Binance Sustainable: The digital currency of sustainable contracts

      • OKEX: Cash in digital currency

      • OKEX Sustainable: The Digital Currency is a Sustainable Contract

      • OKEX futures: futures on digital currencies

      • Huobi: Digital currency is cash

      • Huobi futures: digital currency futures

      • Huobi Sustainable: Digital currencies are sustainable

      • Bitfinex: the digital currency of cash

      • Coinbase: the digital currency of cash

      • Bitstamp: digital currency on the go

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