Ninja Bot
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:
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.
from Hacker News https://ift.tt/3f6tslS
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.