skorotkiewicz / ninjabot

A fast cryptocurrency bot implemented in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ninja Bot

tests Go Reference

A fast cryptocurrency bot implemented in Go

⚠️ Caution: Working in progress 🚧

Instalation

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

Example of Usage

Check example directory:

  • Paper Wallet (Live Simulation)
  • Backtesting
  • Real Account (Binance)

CLI

To download historical data you can download ninjabot CLI from release page

  • Download 30 days: ninjabot download --pair BTCUSDT --timeframe 1d --days 30 --output ./btc.csv

Backtesting Example

  • Backtesting from example directory:
go run example/backtesting/main.go

Output:

[SETUP] Using paper wallet                   
[SETUP] Initial Portfolio = 10000.000000 USDT 
+---------+--------+-----+------+--------+--------+-----------+
|  PAIR   | TRADES | WIN | LOSS | % WIN  | PAYOFF |  PROFIT   |
+---------+--------+-----+------+--------+--------+-----------+
| ETHUSDT |      8 |   6 |    2 | 75.0 % | 12.215 | 5641.9314 |
| BTCUSDT |     12 |   5 |    7 | 41.7 % |  5.137 | 3373.9726 |
+---------+--------+-----+------+--------+--------+-----------+
|   TOTAL |     20 |  11 |    9 | 55.0 % |  7.968 | 9015.9040 |
+---------+--------+-----+------+--------+--------+-----------+
--------------
WALLET SUMMARY
--------------
0.000000 BTC
1.723774 ETH
15015.904020 USDT
--------------
START PORTFOLIO =  10000 USDT
FINAL PORTFOLIO =  19015.904019955597 USDT
GROSS PROFIT    =  9015.904020 USDT (90.16%)
MARKET CHANGE   =  396.71%
--------------
Chart available at http://localhost:8080

Plot result:

Roadmap:

  • Live Trading

    • Order Limit, Market, OCO, and Stop
    • Custom Strategy
  • Backtesting

    • Paper Wallet (Live Trading with fake wallet)
    • Load Feed from CSV
    • Market Orders
    • Limit Orders
    • OCO Orders
    • Stop Orders
  • Bot CLI - Utilities to support studies

    • Download
    • Plot (Candles + Sell / Buy orders)

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.

About

A fast cryptocurrency bot implemented in Go

License:MIT License


Languages

Language:Go 97.8%Language:JavaScript 1.3%Language:HTML 0.7%Language:Makefile 0.1%