Code Monkey home page Code Monkey logo

spot_grid_web's Introduction

默认运行环境是国外的服务器,默认环境是python(linux自带的是python2) 首次运行

pip install -r requirt.txt 

python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py createsuperuser

修改spot_grid_web.settings.py 中的 BINANCE_CONFIG 中的对应的key 和secret

python3 manage.py createsuperuser 用于创建后台登录用户 spot_grid_web.wsgi.py 中的
scheduler.add_job(spot.spot_start_run, "interval", seconds=30, id="spot_grid_run", replace_existing=True) seconds 字段控制间隔时间,每30s会执行一次,如果是1分钟,请设置60

启动运行服务

python3 manage.py runserver 

运行此命令的窗口请勿关闭

浏览器访问 127.0.0.1:8000/admin 添加币对相关信息在spot_trade 部分

推荐使用在有图形界面的云服务器上运行

linux运行

需要将spot_grid_web.settings.py中的ALLOWED_HOSTS = [] 修改为ALLOWED_HOSTS = ["*"] 云服务需要将安全组端口8000 端口开放访问

# linux后台 运行命令
nohup python3 manage.py runserver &
next_buy_price:  币对的买入价格
grid_sell_price:    币对的卖出价格
step: 初始仓位,整数
profit_ratio:   差价盈利率,0.5 代表 0.5%
double_throw_ratio:   差价补仓率 0.5 代表 0.5%
coin_type: 交易对,如BTCUSDT
quantity: 每次买入数量,请填写多个,需要每次买入的数量相同的话也请填写(英文逗号分隔)  如: 1,1
max_count: 连续买入而不卖出的最大次数,用于风控, 整数
current_num:当前连续买入次数,用于风控,整数,当current_num 次数与max_count次数相同时,该币对会自动跳过不买入
current_income:当前收益
if_use: 是否启用,

需要对已经在运行中的币对进行修改时,需要先将币对状态设置为禁用后保存,然后再对需要修改的币对进行参数修改,添加删除币对不需要先启用禁用

此版交易逻辑代码大部分使用是基于此项目的web版简单实现。

币圈投资需谨慎。。。

网格交易

spot_grid_web's People

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.