A work in progress Cryptocurrency for common exchanges like Bitfinex and Bitmex. As most trading bots just provide basic buy and sell signals they provide many stuff to get profitable eg exchange orders like stop-losses or stop-limits are not supported by main bots. Also the limitation of fixed timeframe and technical indicators must be broken
Not production ready only basic functionality
- Fully use Websocket for exchange communication to react as fast as possible on market
- Multi pair support in one instance
- sqlite3 storage for candles, tickers, ...
- Webserver UI
- Support for going "Short" and "Long"
- Signal browser dashboard for pairs
- Slack and email notification
- node.js
- sqlite3
- technicalindicators
- tulipindicators - tulind
- TA-Lib
- twig
- express
- Bootstrap v4
- Tradingview widgets
Install packages
npm install
Create instance file for pairs and changes
cp instance.js.dist instance.js
Provide a configuration with your exchange credentials
cp conf.json.dist conf.json
Create a new sqlite data base
# use bot.sql scheme to create the tables
sqlite3 bot.db < bot.sql
Lets start it
node index.js trade
Some browser links
- UI: http://127.0.0.1:8080
- Signals: http://127.0.0.1:8080/signals
- Tradingview: http://127.0.0.1:8080/tradingview/BTCUSD
- Backtesting: http://127.0.0.1:8080/backtest
- Order & Pair Management: http://127.0.0.1:8080/pairs
As the webserver provides just basic auth for access you should combine some with eh a https for public server. Here s simple proxy_pass
for nginx.
# /etc/nginx/sites-available/YOURHOST
server {
server_name YOURHOST;
location / {
proxy_pass http://127.0.0.1:8080;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/YOURHOST/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/YOURHOST/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
You should also set the listen ip to a local one
# config.json
webserver.ip: 127.0.0.1
Currently there is a the UI for backtesting
node index.js backfill -e bitmex -p 1m -s XRPZ18
For custom strategies use var/strategies folder.
Find some example strategies inside modules/strategy/strategies
- Bitmex with leverage configuration (+testnet)
- Binance
- Bitfinex (margin wallet)
order_adjust
Keep open orders in bid / ask of the orderbook in first position
stoploss
provide general stoploss order in percent of entry price (Exchange Order)risk_reward_ratio
Creates Risk Reward order for take profit and stoploss (Exchange Order Limit+Stop)
'watchdogs': [
{
'name': 'stoploss',
'percent': 3,
},
{
'name': 'risk_reward_ratio',
'target_percent': 6,
'stop_percent': 3,
}
],
npm test
Other bots with possible design pattern
- https://github.com/DeviaVir/zenbot
- https://github.com/magic8bot/magic8bot
- https://github.com/askmike/gekko
- https://github.com/freqtrade/freqtrade
- https://github.com/Ekliptor/WolfBot
- https://github.com/andresilvasantos/bitprophet
- https://github.com/kavehs87/PHPTradingBot
Some strategies based on technical indicators for collection some ideas
- https://github.com/freqtrade/freqtrade-strategies
- https://github.com/freqtrade/freqtrade-strategies/tree/master/user_data/strategies/berlinguyinca
- https://github.com/xFFFFF/Gekko-Strategies
- https://github.com/sthewissen/Mynt/tree/master/src/Mynt.Core/Strategies
- https://github.com/Ekliptor/WolfBot/tree/master/src/Strategies