Skip to content

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.

Notifications You must be signed in to change notification settings

Veras-D/traderBot

Repository files navigation

🤖 Crypto SMA Trading Bot (TypeScript)

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.

📈 Strategy Overview

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.

🛠️ Features

  • 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

📦 Installation

# Clone the repo
git clone [email protected]:Veras-D/traderBot.git
cd traderBot

# Install dependencies
npm install

🚀 Run the Bot

# Using ts-node (dev mode)
npx ts-node src/bot.ts

# Or compile and run
npm run build
node dist/bot.js

🐳 Run with Docker

docker build -t crypto-bot .
docker run -it crypto-bot

Or using Docker Compose:

docker-compose up

⚙️ Configuration

  • 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).


📊 Example Output

Current Price: 62284.13
SMA (13): 62112.50
SMA (21): 62002.75
Bought at: 62284.13

... later ...

Sold at: 62530.00
Profit: +0.39%

🧪 Testnet Only

⚠️ This bot currently operates only on Binance Testnet — no real funds are used. It's safe to test and experiment freely.


📌 Roadmap

  • SMA Strategy
  • RSI + MACD Integration
  • Web Dashboard (Streamlit or React)
  • Telegram Bot Notifications
  • Real Binance Trading Support (with proper auth)

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published