mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 16:28:06 +00:00
- Introduced a new swing trading strategy utilizing the RSI indicator on the ETHBTC pair from Binance. - Implemented the `SwingEngine` to manage trading logic, including entry and exit conditions based on RSI thresholds. - Added configuration options for swing direction, trade amount, and RSI parameters in `config.ts`. - Created new documentation for the swing strategy, detailing its behavior and configuration. - Enhanced CLI to support the new swing strategy option. - Added tests for swing logic to ensure correct behavior under various market conditions.
1.6 KiB
1.6 KiB
Swing strategy (RSI on Binance ETHBTC)
This repo’s swing strategy trades the exchange symbol you run the bot with (e.g. TRADE_SYMBOL), but uses Binance spot ETHBTC 4h RSI(14) as the global signal source (per docs/swingtrading/strategy.md).
Key behavior
- Signal source: Binance spot
ETHBTC,4hklines, RSI period14. - Trade target: your selected exchange’s
TRADE_SYMBOL/*_SYMBOL(same as other strategies). - Default mode: short-only (configurable to long / short / both).
- Stop-loss:
- Tries to place a stop-loss order when supported by the venue.
- Always runs a real-time “kill-switch”: if price crosses the stop threshold, it market-closes.
- Spot accounts: if the connected account is
marketType=spotand you configureSWING_DIRECTION=short(orboth), the strategy will refuse to trade.
Environment variables
- Core
SWING_DIRECTION:short(default) |long|bothSWING_TRADE_AMOUNT: position size (falls back toTRADE_AMOUNT)SWING_POLL_INTERVAL_MS: loop interval (default500)
- RSI / signal
SWING_RSI_PERIOD: default14SWING_RSI_HIGH: default70SWING_RSI_LOW: default30SWING_SIGNAL_SYMBOL: defaultETHBTCSWING_SIGNAL_INTERVAL: default4h
- Risk / precision
SWING_STOP_LOSS_PCT: default0.05(5%)SWING_MAX_CLOSE_SLIPPAGE_PCT: default0.05SWING_PRICE_TICK,SWING_QTY_STEP: optional overrides (otherwise synced from exchange when supported)
Run
bun run index.ts --strategy swing
Silent mode:
bun run index.ts --strategy swing --silent