Coder Social home page Coder Social logo

496080199 / binance_grid_trader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 51bitquant/binance_grid_trader

0.0 1.0 0.0 72 KB

A grid trading strategy and trading-bot for Binance Exchange. 币安交易所的网格交易

License: MIT License

Python 99.92% Shell 0.08%

binance_grid_trader's Introduction

51bitquant网格交易策略

使用 how to use

  1. 修改配置文件, config your config file.
{
  "platform": "binance_spot",
  "symbol": "ETHUSDT",
  "api_key": "replace your api key here",
  "api_secret": "replace your api secret here",
  "gap_percent": 0.005,
  "quantity": 0.01,
  "max_orders": 1,
  "proxy_host": "",
  "proxy_port": 0
}
  1. platform: 是交易的平台, 填写 binance_spot 或者 binance_future, 如果交易的是合约的,就填写binance_future. if you want to trade future, use binance_future, or binance_spot for spot exchange in Binance.
  2. symbol 交易对: BTCUSDT, BNBUSDT等, trading pair like BTCUSDT, ETHUSDT.
  3. api_key : 从交易所获取 api key from Binance
  4. api_secret: 交易所获取 api secret from Binance
  5. gap_percent: 网格交易的价格间隙, the grid step
  6. quantity : 每次下单的数量, the order quantity you want to trade every time.
  7. max_orders: 单边的下单量: max order count.
  8. proxy_host: 如果需要用代理的话,请填写你的代理 your proxy host, if you want proxy
  9. proxy_port: 代理端口号 your proxy port for connecting to binance.

修改完配置文件后,用shell 命令运行下面的shell 命令:

sh start.sh

网格交易的原理视频讲解链接: https://www.bilibili.com/video/BV1Jg4y1v7vr/

how to use.

  1. download the code, and edit the config.json file, input your configuration, then save the file.
  2. run the main.py file in Pycharm or use the shell script. then run sh start.sh

交易所注册推荐码

网格交易策略使用行情

  • 震荡行情
  • 适合币圈的高波动率的品种
  • 适合现货, 如果交易合约,需要注意防止极端行情爆仓。

服务器购买

推荐ucloud的服务器

  • 价格便宜
  • 网络速度和性能还不错
  • 推荐链接如下:可以通过下面链接够买服务器,可以享受打折优惠:

https://www.ucloud.cn/site/global.html?invitation_code=C1x2EA81CD79B8C#dongjing

视频讲解如下: https://www.bilibili.com/video/BV1eK4y147HT/

部署服务器

参考我的博客

linux 常用命令

  • cd # 是切换工作目录, 具体使用可以通过man 指令 | 指令 --help
  • clear
  • ls # 列出当前文件夹的文件
  • rm 文件名 # 删除文件
  • rm -rf 文件夹 # 删除文件
  • cp # 拷贝文件 copy
  • scp scp binance_grid_trader.zip [email protected]:/home/ubuntu
  • pwd
  • mv # 移动或者剪切文件
  • ps -ef | grep main.py # 查看进程
  • kill 进程id # 杀死当前进程

部署

直接把代码上传到服务器, 通过scp命令上传

  • 先把代码压缩一下
  • 通过一下命令上传到自己的服务器, xxx.xxx.xxx.xxx为你的服务器地址, :/home/ubuntu表示你上传到服务器的目录

scp binance_grid_trader.zip [email protected]:/home/ubuntu

安装软件 sudo apt-get install 软件名称 | 库

sudo apt-get install unzip # pip install requests 解压文件 unzip binance_grid_trader.zip

进入该文件夹目录

cd binance_grid_trader

安装依赖包

pip install -r requirements.txt

执行运行脚本

sh start.sh

查看程序运行的id

ps -ef | grep main.py

杀死进程, 关闭程序

kill <进程ID>

linux服务器指令和网格策略实盘部署过程如下 https://www.bilibili.com/video/BV1mK411n7JW/

更多课程内容

请参考网易云课堂的视频

联系我

可以添加我的微信,如果你有什么量化问题、python学习、课程咨询等方面的问题,都可以咨询我。

51bitquant个人微信

binance_grid_trader's People

Contributors

51bitquant avatar

Watchers

James Cloos 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.