加密货币自动化交易实现
策略参考股票交易,仍是回落卖出,反弹买入,这里基于币安平台现货交易实现。

实战效果:

部署步骤:
1、租一台海外服务器,Linux或Windows均可,币安API需要海外服务器才能连接,安装好Python环境及必要的库。
2、保证币安现货账户中至少有一种加密货币和USDT
3、替换py文件中的api_key及api_secret为你的交易API key及密钥,设置好其他参数,运行py文件即可,每隔3秒扫描一次行情。程序中将总资产分成了20份,每次买入大约消耗1份左右的资产,可自行调整。
api_key='XXX' api_secret='XXX' ... profit_fall_percent=0.2 #相比上次交易,上涨回落幅度达到20%后卖出 loss_reflect_percent=0.2 #相比上次交易,下跌反弹幅度达到20%后加仓 min_profit_percent=0.008 #相比上次交易,需要达到0.8%的盈利幅度才能卖出 min_loss_percent=0.008 #相比上次交易,需要达到0.8%的亏损幅度才能加仓
代码AutoTradingBN.py:
Hi team, I’d like to learn more about your services and how they could fit my needs. Could someone reach out at your earliest convenience? Thanks in advance.
Glad to hear you’d like to learn more. If you’re interested, you can email to the author.
Hello, I’d appreciate the chance to talk through what you offer and see if we’re a good fit. Would appreciate a call back to discuss further. Looking forward to hearing back.
Thanks. If you’re interested, you can email to the author.
Wow, it’s fun!
thanks