EVM BNB Band Trader
Implement BNB Chain swing trading with strict risk controls.
1) Configure secrets and params
Set environment variables before running:
- -
EVM_PRIVATE_KEY (wallet private key, never hardcode) - INLINECODE1 (BSC RPC endpoint)
- INLINECODE2 (default WBNB)
- INLINECODE3 (target token)
- INLINECODE4 (trigger buy threshold)
- INLINECODE5 (position size in BNB)
- INLINECODE6 (default
0.05) - INLINECODE8 (default
0.03) - INLINECODE10 (default
10)
2) Run bot
Use script:
CODEBLOCK0
Dry run first:
CODEBLOCK1
3) Strategy rules (fixed)
- - Entry: execute buy when latest price >= INLINECODE12
- Exit TP: sell when price >= entryprice 1.05
- Exit SL: sell when price <= entryprice 0.97
- One-position mode: no pyramiding
4) Safety controls
- - Refuse run if env vars missing
- Refuse run if private key format invalid
- Refuse run if gas or balance insufficient
- Log every decision with timestamp
5) Notes
- - Script uses DEX quote+swap placeholder flow; wire production router/aggregator before real funds.
- Always run dry-run first and validate slippage/gas assumptions.
EVM BNB 波段交易机器人
实现BNB链的波段交易,并配备严格的风险控制。
1) 配置密钥和参数
运行前设置环境变量:
- - EVMPRIVATEKEY(钱包私钥,切勿硬编码)
- BNBRPCURL(BSC RPC端点)
- TOKENIN(默认WBNB)
- TOKENOUT(目标代币)
- BUYTRIGGERPRICE(触发买入阈值)
- BUYSIZEBNB(以BNB计价的仓位大小)
- TAKEPROFITPCT(默认 0.05)
- STOPLOSSPCT(默认 0.03)
- POLL_SECONDS(默认 10)
2) 运行机器人
使用脚本:
bash
python scripts/bnbbandbot.py --mode run
先进行模拟运行:
bash
python scripts/bnbbandbot.py --mode dry-run
3) 策略规则(固定)
- - 入场:当最新价格 >= BUYTRIGGERPRICE 时执行买入
- 止盈退出:当价格 >= 入场价格 1.05 时卖出
- 止损退出:当价格 <= 入场价格 0.97 时卖出
- 单仓位模式:不进行金字塔加仓
4) 安全控制
- - 环境变量缺失时拒绝运行
- 私钥格式无效时拒绝运行
- Gas或余额不足时拒绝运行
- 记录每次决策并附带时间戳
5) 注意事项
- - 脚本使用DEX报价+交换占位流程;使用真实资金前请接入生产级路由器/聚合器。
- 始终先进行模拟运行,并验证滑点和Gas假设。