Skip to content

Bitget-Trading-Tool/Bitget-AI-Strategy-Trading-Bot

Repository files navigation

Bitget AI Strategy Trading Bot

Production-grade TypeScript spot trading bot for Bitget with an AI signal engine and pluggable strategies: ensemble (recommended), grid, momentum, RSI, and DCA. Includes paper trading, risk controls, persisted state, and a CLI for live runs, single ticks, backtests, and grid planning.

Features

  • AI ensemble — fuses SMA trend, RSI, MACD, EMA, and Bollinger %B into a scored signal with configurable confidence threshold
  • Grid trading — arithmetic or geometric price ladders between LOWER_PRICE and UPPER_PRICE
  • Momentum — short/long SMA crossover signals
  • RSI — oversold/overbought mean-reversion entries
  • DCA — time-based recurring buys
  • Risk manager — daily loss cap, max position size, max open orders, min notional
  • Paper mode — safe local simulation (default) with synthetic candles and fill simulation
  • Bitget REST v2 — signed requests for live spot orders when PAPER_TRADING=false

Requirements

  • Node.js 20+
  • npm 9+
  • Bitget API key, secret, and passphrase (live trading only)

Quick start

cd Bitget-AI-Strategy-Trading-Bot
npm install
cp .env.example .env
# Edit .env — keep PAPER_TRADING=true until you are ready for live trading
npm run build
npm test

Paper trading (recommended first)

npm run tick          # single strategy evaluation + optional paper order
npm run backtest      # 120-step paper simulation
npm run plan          # preview grid levels
npm start             # continuous loop (Ctrl+C to stop)

Live trading

Set in .env:

PAPER_TRADING=false
BITGET_API_KEY=your_key
BITGET_API_SECRET=your_secret
BITGET_PASSPHRASE=your_passphrase

Then:

npm run build
npm start

Configuration

Copy .env.example to .env. Key variables:

Variable Description Default
SYMBOL Trading pair BTCUSDT
STRATEGY ensemble, grid, momentum, rsi, dca ensemble
LOWER_PRICE / UPPER_PRICE Grid / ensemble bounds 60000 / 70000
GRID_COUNT Number of grid rungs 10
GRID_MODE arithmetic or geometric geometric
ORDER_SIZE_USDT Per-trade notional (USDT) 50
AI_WEIGHTRSI_WEIGHT Ensemble weights 0.4 / 0.2 / 0.2 / 0.2
MAX_DAILY_LOSS_USDT Stop trading after daily loss 100
PAPER_TRADING true = simulation true

See .env.example for the full list.

Project structure

src/
  ai/           # Technical indicators + AI signal engine
  cli/          # Commander CLI (start, tick, backtest, plan, status)
  config/       # Zod schema + env loader
  engine/       # Trading loop orchestration
  exchange/     # Bitget REST client + paper simulator
  services/     # Risk manager + state persistence
  strategies/   # Grid, momentum, RSI, DCA, ensemble
  types/        # Shared domain types
  utils/        # Logger, retry, helpers
tests/          # Vitest unit & integration tests

CLI commands

Command Description
npm start Run bot loop
npm run tick One evaluation cycle
npm run backtest Paper backtest (--steps 200)
npm run plan Print grid levels
npm run status Show data/bot-state.json
npm test Run test suite
npm run lint ESLint
npm run typecheck TypeScript check

Strategies overview

Ensemble (default)

Combines AI technical scoring with grid, momentum, and RSI sub-signals using configurable weights. Trades only when aggregated strength exceeds MIN_AI_CONFIDENCE.

Grid

Places logic on price crossing grid rungs between configured bounds. Best in ranging markets.

Momentum

Trades SMA crossovers (bullish = buy, bearish = sell).

RSI

Buys when RSI ≤ RSI_OVERSOLD, sells when RSI ≥ RSI_OVERBOUGHT.

DCA

Schedules buys every DCA_INTERVAL_MS for DCA_AMOUNT_USDT.

Risk disclaimer

Cryptocurrency trading involves substantial risk. This software is provided for educational purposes. Past backtest results do not guarantee future performance. Always test in paper mode and never risk capital you cannot afford to lose.

License

MIT


Technical support

Need help deploying, configuring API keys, or debugging strategies?

Telegram: @tradingtermin

Contact: @tradingtermin on Telegram — technical support for this project.

About

Bitget AI Strategy Trading Bot Bitget AI Strategy Trading Bot Bitget AI Strategy Trading Bot Bitget AI Strategy Trading Bot Bitget AI Strategy Trading Bot Bitget AI Strategy Trading Bot Bitget AI Strategy Trading Bot Bitget AI Strategy Trading Bot Bitget AI Strategy Trading Bot Bitget AI Strategy Trading Bot Bitget AI Strategy Trading Bot Bitget AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors