RepositoryGoBRBrazil
RO

rodrigo-brito/ninjabot

A fast trading bot platform for cryptocurrency in Go (Binance)

1.6kstars
201forks
11issues
2views

Featured achievements

The project's latest awards

3
TINIX TRENDING·Topic: binance

#3 Repository of the week

4
TINIX TRENDING·Topic: trading-strategies

#4 Repository of the week

4
TINIX TRENDING·Topic: trading-bot

#4 Repository of the week

Ninjabot

tests codecov Go Reference Discord Discord

A fast cryptocurrency trading bot framework implemented in Go. Ninjabot permits users to create and test custom strategies for spot and futures market.

Docs: https://rodrigo-brito.github.io/ninjabot/

DISCLAIMER
This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS

Installation

go get -u github.com/rodrigo-brito/ninjabot/...

Examples of Usage

Check examples directory:

  • Paper Wallet (Live Simulation)
  • Backtesting (Simulation with historical data)
  • Real Account (Binance)

CLI

To download historical data you can download ninjabot CLI from:

  • Pre-build binaries in release page
  • Or with go install github.com/rodrigo-brito/ninjabot/cmd/ninjabot@latest

Example of usage

# Download candles of BTCUSDT to btc.csv file (Last 30 days, timeframe 1D)
ninjabot download --pair BTCUSDT --timeframe 1d --days 30 --output ./btc.csv

Backtesting Example

  • Backtesting a custom strategy from examples directory:
go run examples/backtesting/main.go

Output:

INFO[2023-03-25 13:54] [SETUP] Using paper wallet                   
INFO[2023-03-25 13:54] [SETUP] Initial Portfolio = 10000.000000 USDT 
---------+--------+-----+------+--------+--------+-----+----------+-----------+
|  PAIR   | TRADES | WIN | LOSS | % WIN  | PAYOFF | SQN |  PROFIT  |  VOLUME   |
+---------+--------+-----+------+--------+--------+-----+----------+-----------+
| ETHUSDT |      9 |   6 |    3 | 66.7 % |  3.407 | 1.3 | 21748.41 | 407769.64 |
| BTCUSDT |     14 |   6 |    8 | 42.9 % |  5.929 | 1.5 | 13511.66 | 448030.05 |
+---------+--------+-----+------+--------+--------+-----+----------+-----------+
|   TOTAL |     23 |  12 |   11 | 52.2 % |  4.942 | 1.4 | 35260.07 | 855799.68 |
+---------+--------+-----+------+--------+--------+-----+----------+-----------+

-- FINAL WALLET --
0.0000 BTC = 0.0000 USDT
0.0000 ETH = 0.0000 USDT
45260.0735 USDT

----- RETURNS -----
START PORTFOLIO     = 10000.00 USDT
FINAL PORTFOLIO     = 45260.07 USDT
GROSS PROFIT        =  35260.073493 USDT (352.60%)
MARKET CHANGE (B&H) =  407.09%

------ RISK -------
MAX DRAWDOWN = -11.76 %

------ VOLUME -----
BTCUSDT         = 448030.05 USDT
ETHUSDT         = 407769.64 USDT
TOTAL           = 855799.68 USDT
-------------------
Chart available at http://localhost:8080

Plot result

Features

Binance SpotBinance Futures
Order Market:ok::ok:
Order Market Quote:ok:
Order Limit:ok::ok:
Order Stop:ok::ok:
Order OCO:ok:
Backtesting:ok::ok:
  • Backtesting

    • Paper Wallet (Live Trading with fake wallet)
    • Load Feed from CSV
    • Order Limit, Market, Stop Limit, OCO
  • Bot Utilities

    • CLI to download historical data
    • Plot (Candles + Sell / Buy orders, Indicators)
    • Telegram Controller (Status, Buy, Sell, and Notification)
    • Heikin Ashi candle type support
    • Trailing stop tool
    • In app order scheduler

Roadmap

  • Include Web UI Controller
  • Include more chart indicators - Details

Exchanges

Currently, we only support Binance exchange. If you want to include support for other exchanges, you need to implement a new struct that implements the interface Exchange. You can check some examples in exchange directory.

Support the project

Address
BTCbc1qpk6yqju6rkz33ntzj8kuepmynmztzydmec2zm4
ETH0x2226FFe4aBD2Afa84bf7222C2b17BBC65F64555A
LTCltc1qj2n9r4yfsm5dnsmmtzhgj8qcj8fjpcvgkd9v3j

Patreon: https://www.patreon.com/ninjabot_github

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
jesse-ai/jesse

An advanced trading bot written in Python

8.8k
Nov 23, 2026
RepositoryGo
avelino/awesome-go

A curated list of awesome Go frameworks, libraries and software

197.2k
Dec 2, 2026
RepositoryPython
freqtrade/freqtrade-strategies

Free trading strategies for Freqtrade bot

5.7k
Sep 8, 2026
RepositoryTypeScript
chrisleekr/binance-trading-bot

Automated Binance trading bot with pluggable strategies, historical backtesting, a live dashboard, and connect an AI agent over MCP

5.6k
Dec 2, 2026
RepositoryC++
ctubio/Krypto-trading-bot

Self-hosted crypto trading bot (automated high frequency market making) written in C++

3.7k
Dec 15, 2024
RepositoryPython
coding-kitties/investing-algorithm-framework

Framework for quantitative trading. Complete framework for development, backtesting, and deploying automated trading algorithms and trading bots.

2.3k
Nov 28, 2026
RepositoryPython
ccxt/ccxt

A unified trading API with more than 100 crypto exchanges and prediction markets in JavaScript / TypeScript / Python / C# / PHP / Go / Java / Rust

45.0k
Nov 27, 2026
RepositoryGo
go-gitea/gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD

59.4k
Dec 1, 2026
RepositoryGo
charmbracelet/bubbletea

A powerful little TUI framework 🏗

46.0k
Dec 2, 2026