A simple yet powerful crypto trading bot using SMA (Simple Moving Average) crossover strategy. Built with TypeScript, Axios, and the Binance Testnet API. Ideal for testing trading logic with real-time market data.
This bot uses the SMA crossover strategy:
- Buy when the short-term SMA (13 candles) crosses above the long-term SMA (21 candles).
- Sell when the short-term SMA crosses below the long-term SMA.
- Calculates and logs profits automatically.
- TypeScript support
- Binance Testnet integration
- Logs profit/loss from trades
- Fully containerized with Docker
- GitHub Actions CI-ready
- Deployable for free on Railway or Render
# Clone the repo
git clone [email protected]:Veras-D/traderBot.git
cd traderBot
# Install dependencies
npm install
# Using ts-node (dev mode)
npx ts-node src/bot.ts
# Or compile and run
npm run build
node dist/bot.js
docker build -t crypto-bot .
docker run -it crypto-bot
Or using Docker Compose:
docker-compose up
- API base: Binance Testnet (
https://testnet.binance.vision
) - Symbol: BTC/USDT
- Candlestick interval: 15 minutes
You can tweak these settings directly in src/constants.ts
(coming soon).
Current Price: 62284.13
SMA (13): 62112.50
SMA (21): 62002.75
Bought at: 62284.13
... later ...
Sold at: 62530.00
Profit: +0.39%
- SMA Strategy
- RSI + MACD Integration
- Web Dashboard (Streamlit or React)
- Telegram Bot Notifications
- Real Binance Trading Support (with proper auth)