FREE · MIT LICENSE · NO SIGNUP TO DOWNLOAD

Python Crypto Trading Bot — Free Starter

A working 150-line bot for Binance Futures testnet. EMA-cross strategy with risk management. Read it, run it, modify it.

150lines of code
2 minsetup time
Testnetsafe by default
MITopen license

What's in the zip

🐍

bot.py

~150 lines. Connection, candle fetch, EMA signal, order placement, main loop.

⚙️

config.json.example

API keys, symbol, EMA periods, SL/TP %, position size — all in one file.

📦

requirements.txt

Two dependencies: ccxt (exchange) + pandas (candle math). Both PyPI-popular.

📖

README.md

Quick start, strategy explanation, what's missing, risk warning.

Quick start (2 minutes)

# 1. Install dependencies pip install -r requirements.txt # 2. Get free Binance testnet API keys # https://testnet.binancefuture.com # Click "API Key" → Generate # 3. Copy your keys into config.json cp config.json.example config.json nano config.json # fill in api_key and api_secret # 4. Run python3 bot.py

First console output appears within 5 seconds. EMA values + current signal logged every minute.

Strategy logic

Classic EMA(12)/EMA(26) crossover. ~15 lines of actual signal logic.

def compute_signal(df, ema_fast, ema_slow): df['ema_fast'] = df['close'].ewm(span=ema_fast).mean() df['ema_slow'] = df['close'].ewm(span=ema_slow).mean() prev = df.iloc[-2] curr = df.iloc[-1] # Bullish cross: fast EMA crosses above slow EMA if prev['ema_fast'] <= prev['ema_slow'] and curr['ema_fast'] > curr['ema_slow']: return 'long' # Bearish cross if prev['ema_fast'] >= prev['ema_slow'] and curr['ema_fast'] < curr['ema_slow']: return 'short' return None

What's in the starter vs what's in the full course

✓ In the free starter

  • Binance testnet connection
  • EMA(12)/EMA(26) signal
  • Single symbol (BTC/USDT)
  • Stop-loss / take-profit
  • Console logging
  • 2-min setup

✗ Not in the starter (in NEXUS Algo course)

  • Backtest engine on history
  • Multi-timeframe (15m + 1h + 4h)
  • 5 working strategies
  • Volatility / weekend filter
  • Trailing stop, partial close
  • Telegram alerts, crash recovery
  • Portfolio diversification
  • 60-page playbook + Q&A
See NEXUS Algo full course →

Get new free tools when we ship them

Grid bot calculator, security scanner, AI agents templates — sent when ready, no fluff.

No spam. Unsubscribe in one click. ~1 email/week max.

FAQ

Is this safe to run with real money?

This is a starter / educational example. It runs on Binance testnet (virtual USDT) by default. Do not switch to mainnet until you understand every line, have backtested on historical data, and accept full responsibility for losses.

What about API key security?

The config.json stays on your machine. Use IP whitelisting in Binance settings. Never commit config.json to git (we don't include it — only config.json.example).

Does it work on other exchanges?

The code uses ccxt, which supports 100+ exchanges. Change ccxt.binanceusdm to ccxt.bybit, ccxt.okx, etc. Signal logic stays the same.

Why EMA cross? Doesn't it lose money on choppy markets?

Yes, EMA cross alone is a losing strategy long-term — about 40% win rate, false signals in ranges. That's why the full NEXUS Algo course adds volatility filters, multi-timeframe confirmation, and combined indicators. The starter shows the structure, not a profitable system.

Can I sell this code?

It's MIT-licensed — fork, modify, sell. Attribution appreciated, not required.