Code Monkey home page Code Monkey logo

balance's Introduction

balance

基于币安交易所实现的动态平衡策略:

固定币种间的比例 价格变化一定百分比时 通过买卖将比例还原
例: BNB-USDT 为 50%:50% 目前价格350 则持有100个BNB+35000USDT
当价格变成400时 BNB应有数量=(35000+40000)/2/400=93.75 此时需要卖掉100-93.75=6.25
当价格变成300时 BNB应有数量=(35000+30000)/2/300=108.33 此时需要买入 8.33
如此反复

使用

1 配置config/config.yaml
2 运行 go run mian.go
3 没问题的话打包放服务器或本地跑就可以了

说明

凡是设置中涉及到的币种都将按照权重重新平衡 意味着您无法保留一定的数量做备用,
可转移至子账户或资金账户以隔离资金

待完善

1 请求出现网络问题需要添加适当的容错
2 区分何时程序需要停止 其他意外情况下可记录并稳定运行
3 告警和通知覆盖到位

回测情况可查阅 doc/回测报告.md

总的来说不看好 对市场行情要求较高 大体横盘才可以
否则收益不能得到保证(不如拿着不动) 看以后能不能有哪方面优化吧

balance's People

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.