Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

4.1.3 #1724

Merged
merged 209 commits into from
Oct 1, 2018
Merged

4.1.3 #1724

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
ab10d78
Exchanges: update-products 1011
Apr 24, 2018
0b5c973
Fix Bittrex error (#1563)
brucetus Apr 25, 2018
4d9a12d
Exchanges: update-products 1019
Apr 26, 2018
61b7850
Bittrex code cleanup (#1566)
brucetus Apr 26, 2018
f338ec7
Exchanges: update-products 1023
Apr 27, 2018
b40e453
Exchanges: update-products 1026
Apr 29, 2018
6a0b025
Exchanges: update-products 1029
Apr 30, 2018
4ed6401
Exchanges: update-products 1032
May 1, 2018
5a604de
Exchanges: update-products 1038
May 2, 2018
ac703fd
Exchanges: update-products 1041
May 3, 2018
f55800d
Exchanges: update-products 1045
May 4, 2018
4dbfff2
Exchanges: update-products 1047
May 5, 2018
e5a7d3c
Exchanges: update-products 1051
May 7, 2018
812c7b3
Exchanges: update-products 1053
May 8, 2018
c196b09
Exchanges: update-products 1057
May 11, 2018
abf8f69
Exchanges: update-products 1059
May 12, 2018
f728c51
so long, Zenbot
May 14, 2018
19f012e
Fixed grammatical error in dashboard (#1588)
KonaeAkira May 14, 2018
90f8f82
Mistake with ws calc request. (fix for #516 and partially #868) (#1586)
May 14, 2018
d104103
Docker and commandline improvements (#1583)
TechupBusiness May 14, 2018
1735ab4
Webpack: split js and css into its own bundles (#1582)
defkev May 14, 2018
96bced2
Edit max_sell/buy_loss_pct defaults in conf-sample.js (#1578)
brucetus May 14, 2018
e34b717
fix broken balance command (#1573)
illya13 May 14, 2018
7d6f332
Exchanges: update-products 1070
May 14, 2018
18a09a7
Exchanges: update-products 1074
May 15, 2018
1b2f646
Exchanges: update-products 1076
May 16, 2018
f8c10ae
Exchanges: update-products 1079
May 18, 2018
0a8e3ca
Exchanges: update-products 1083
May 19, 2018
50fb98b
Exchanges: update-products 1085
May 20, 2018
9213956
CEXIO: getTrades return error to engine (#1595)
defkev May 21, 2018
96ab7f9
Exchanges: update-products 1090
May 22, 2018
f9b038a
Exchanges: update-products 1092
May 23, 2018
728fcfa
Repairs #1596 error (#1601)
loudbinary May 24, 2018
5821eac
Repair duplicate key issue on backfill, resolves #1596 (#1600)
loudbinary May 24, 2018
dd0c702
Exchanges: update-products 1099
May 24, 2018
837d9da
Exchanges: update-products 1101
May 25, 2018
c717ab6
Exchanges: update-products 1105
May 28, 2018
161a732
Exchanges: update-products 1107
May 29, 2018
a3a9a17
Exchanges: update-products 1109
May 30, 2018
6625db5
Exchanges: update-products 1111
May 31, 2018
563f5ef
Exchanges: update-products 1113
Jun 1, 2018
e291c11
Exchanges: update-products 1124
Jun 5, 2018
abde160
Exchanges: update-products 1126
Jun 6, 2018
f119e26
Exchanges: update-products 1129
Jun 7, 2018
6ba4f35
Exchanges: update-products 1132
Jun 8, 2018
74030de
Exchanges: update-products 1134
Jun 9, 2018
9371e25
Exchanges: update-products 1137
Jun 11, 2018
d3482d5
Exchanges: update-products 1141
Jun 12, 2018
a73de74
fix(package): update webpack-cli to version 3.0.4 (#1616)
DeviaVir Jun 12, 2018
2a01ef1
Add OHLC candle backfilling (#1614)
brucetus Jun 12, 2018
042401e
Exchanges: update-products 1147
Jun 13, 2018
714199d
Exchanges: update-products 1151
Jun 14, 2018
5ff3a3e
typo in README.md (#1620)
nikhilsaraf Jun 14, 2018
39e5bae
Exchanges: update-products 1157
Jun 15, 2018
b504b59
Exchanges: update-products 1163
Jun 17, 2018
2a358a4
Add asset to push message (#1623)
defkev Jun 18, 2018
f7f29b9
Add strategies that utilize TA-Lib and Tulip-Lib (#1621)
station384 Jun 18, 2018
48a8ddf
fix(package): update mathjs to version 5.0.0 (#1622)
greenkeeper[bot] Jun 18, 2018
a59257a
Exchanges: update-products 1173
Jun 18, 2018
63d60b7
Debug lib (#1624)
defkev Jun 18, 2018
3726cb1
fix(package): update poloniex.js to version 0.0.9 (#1618)
greenkeeper[bot] Jun 18, 2018
46d5958
fix(package): update gdax to version 0.8.0 (#1594)
greenkeeper[bot] Jun 18, 2018
10db2be
fix(package): update bl to version 2.0.1 (#1625)
DeviaVir Jun 18, 2018
9244ff4
fix(package): update stats-lite to version 2.1.1 (#1575)
greenkeeper[bot] Jun 18, 2018
b713636
CEXIO: Migrate over to WebSocket (#1615)
defkev Jun 18, 2018
14c77ff
CEXIO: Use debug lib (#1626)
defkev Jun 19, 2018
47eab4d
Exchanges: update-products 1186
Jun 19, 2018
1cef181
Exchanges: update-products 1188
Jun 20, 2018
a8d3f72
Exchanges: update-products 1190
Jun 21, 2018
bed3bb5
Add minimum trades and fitnessCalcType options (#1631)
station384 Jun 21, 2018
40ee542
Exchanges: update-products 1194
Jun 22, 2018
4547e3a
Exchanges: update-products 1200
Jun 23, 2018
268839f
Exchanges: update-products 1202
Jun 24, 2018
58886ed
Exchanges: update-products 1204
Jun 25, 2018
22ba3c9
Code Cleanup (#1634)
station384 Jun 25, 2018
bedb6df
Added missing parameter text (#1638)
theDiverDK Jun 26, 2018
82fca9f
Exchanges: update-products 1211
Jun 26, 2018
2353a57
Exchanges: update-products 1213
Jun 27, 2018
a666e18
Exchanges: update-products 1215
Jun 28, 2018
a5e610c
chore(package): update yargs to version 12.0.1 (#1643)
greenkeeper[bot] Jun 29, 2018
e41a01b
Exchanges: update-products 1220
Jun 29, 2018
64c6361
Exchanges: update-products 1223
Jul 1, 2018
962efee
Update strategy.js (#1646)
diegstroyer Jul 5, 2018
57ced3d
Exchanges: update-products 1231
Jul 5, 2018
617dda0
Update strategy.js (#1651)
diegstroyer Jul 5, 2018
600a9d1
Exchanges: update-products 1236
Jul 6, 2018
601ba22
Exchanges: update-products 1240
Jul 7, 2018
94050eb
Exchanges: update-products 1242
Jul 8, 2018
505557d
fix(package): update css-loader to version 1.0.0 (#1653)
greenkeeper[bot] Jul 9, 2018
026d2cf
Exchanges: update-products 1245
Jul 9, 2018
3137136
Exchanges: update-products 1250
Jul 10, 2018
03101ee
Exchanges: update-products 1252
Jul 11, 2018
eb4f5e3
Exchanges: update-products 1257
Jul 12, 2018
5a8ae8f
Cross-platform Makefile (#1660)
jraviotta Jul 12, 2018
982d7ee
Added database to .gitignore (#1658)
jraviotta Jul 12, 2018
b19ef1b
Time-sync function to update container time (#1659)
jraviotta Jul 12, 2018
955ee6b
Fix Poloniex not fetching all available trades (#1565) (#1661)
darkerego Jul 13, 2018
654b307
Exchanges: update-products 1269
Jul 13, 2018
1a2c27c
Exchanges: update-products 1273
Jul 14, 2018
02c41da
Exchanges: update-products 1275
Jul 15, 2018
44e14cc
Exchanges: update-products 1277
Jul 16, 2018
424941e
Exchanges: update-products 1279
Jul 17, 2018
1e2d717
Exchanges: update-products 1281
Jul 18, 2018
e367ffd
Exchanges: update-products 1284
Jul 19, 2018
cc692c4
Fix issue #1664: Error 'Invalid end time.' on Poloniex (#1666)
cvinacua Jul 19, 2018
e28aa61
Discord has been removed
DeviaVir Jul 19, 2018
f592f5a
Update README.md
DeviaVir Jul 20, 2018
472bd87
Stop complaint flood
DeviaVir Jul 20, 2018
70c2c86
Exchanges: update-products 1290
Jul 20, 2018
311ac90
Exchanges: update-products 1292
Jul 21, 2018
d78a331
Exchanges: update-products 1296
Jul 22, 2018
722c0a5
fix(package): update ws to version 6.0.0 (#1668)
greenkeeper[bot] Jul 23, 2018
8090824
Exchanges: update-products 1299
Jul 23, 2018
38f1cb3
Exchanges: update-products 1301
Jul 24, 2018
f1ab8bf
Exchanges: update-products 1303
Jul 25, 2018
e3be53a
Exchanges: update-products 1305
Jul 26, 2018
dba506d
Exchanges: update-products 1307
Jul 27, 2018
37bd037
Exchanges: update-products 1309
Jul 28, 2018
2621f10
Exchanges: update-products 1311
Jul 29, 2018
0036300
Exchanges: update-products 1313
Jul 30, 2018
521d45c
Exchanges: update-products 1315
Jul 31, 2018
f6cf772
Exchanges: update-products 1317
Aug 1, 2018
4355a63
Exchanges: update-products 1319
Aug 2, 2018
c6398df
Exchanges: update-products 1321
Aug 3, 2018
d7288d8
Exchanges: update-products 1323
Aug 4, 2018
493f92f
Exchanges: update-products 1325
Aug 5, 2018
39d10fc
Exchanges: update-products 1327
Aug 6, 2018
7cd88d5
Exchanges: update-products 1329
Aug 7, 2018
c86f0d0
Exchanges: update-products 1333
Aug 8, 2018
86ad6d8
fix(package): update jasmine to version 3.2.0 (#1676)
greenkeeper[bot] Aug 9, 2018
39ebb8d
fix(package): update postcss-loader to version 3.0.0 (#1675)
greenkeeper[bot] Aug 9, 2018
193b503
fix(package): update style-loader to version 0.22.1 (#1677)
DeviaVir Aug 9, 2018
9689797
Exchanges: update-products 1344
Aug 9, 2018
137fdaf
Exchanges: update-products 1346
Aug 10, 2018
80a6cb7
Exchanges: update-products 1348
Aug 11, 2018
241cbda
Exchanges: update-products 1350
Aug 12, 2018
149f004
Exchanges: update-products 1352
Aug 13, 2018
52e4fb0
Exchanges: update-products 1354
Aug 14, 2018
9de8d0f
Exchanges: update-products 1356
Aug 15, 2018
e1df50d
Exchanges: update-products 1358
Aug 16, 2018
a0b3e21
Exchanges: update-products 1360
Aug 17, 2018
a63bbb9
Exchanges: update-products 1362
Aug 18, 2018
0402220
Exchanges: update-products 1364
Aug 19, 2018
d319182
Exchanges: update-products 1366
Aug 20, 2018
b6c2c09
Exchanges: update-products 1368
Aug 21, 2018
607fde5
Exchanges: update-products 1370
Aug 22, 2018
47b9111
Exchanges: update-products 1373
Aug 23, 2018
de6240e
Modified to support Binance MIN_NOTIONAL Filter (#1687)
cvinacua Aug 23, 2018
e4c4a9c
Exchanges: update-products 1378
Aug 24, 2018
ceef864
Exchanges: update-products 1381
Aug 25, 2018
af8c742
RSI, oversold start optimization (#1691)
diegstroyer Aug 25, 2018
6b483ac
Exchanges: update-products 1384
Aug 26, 2018
558a910
Fixed max_size. The script was taking maxPrice instead of maxQty. (#1…
cvinacua Aug 27, 2018
738b066
Exchanges: update-products 1389
Aug 27, 2018
64a8226
Exchanges: update-products 1396
Aug 29, 2018
47f3e8c
fix(package): update style-loader to version 0.23.0 (#1695)
greenkeeper[bot] Aug 29, 2018
3d98df1
Fixed to make proper use of the MIN_NOTIONAL parameter. (#1693)
cvinacua Aug 29, 2018
4b44daa
fix(package): update babel-loader to version 8.0.0 (#1697)
greenkeeper[bot] Aug 29, 2018
dcb2c7a
Exchanges: update-products 1401
Aug 30, 2018
6083cca
Exchanges: update-products 1403
Aug 31, 2018
1a15bfb
Exchanges: update-products 1407
Sep 1, 2018
5da21d5
Exchanges: update-products 1409
Sep 2, 2018
3486505
fix(package): update bitfinex-api-node to version 2.0.0 (#1698)
greenkeeper[bot] Sep 3, 2018
2c69655
Exchanges: update-products 1412
Sep 3, 2018
97b603b
Exchanges: update-products 1414
Sep 4, 2018
e520860
Exchanges: update-products 1416
Sep 5, 2018
83ccbfa
Exchanges: update-products 1418
Sep 6, 2018
eae5c80
Exchanges: update-products 1420
Sep 7, 2018
ac3d61b
Exchanges: update-products 1422
Sep 8, 2018
42d9ac5
Exchanges: update-products 1424
Sep 9, 2018
0b5d74b
Exchanges: update-products 1426
Sep 10, 2018
d22d313
Exchanges: update-products 1442
Sep 11, 2018
ac1e78a
Exchanges: update-products 1442
Sep 11, 2018
042f137
Exchanges: update-products 1453
Sep 12, 2018
aa8e4eb
Greenkeeper/ccxt 1.17.280 (#1708)
DeviaVir Sep 12, 2018
f6abf3f
Update stats-lite to the latest version 🚀 (#1706)
greenkeeper[bot] Sep 12, 2018
02b08cc
Exchanges: update-products 1469
Sep 13, 2018
411a816
Exchanges: update-products 1469
Sep 13, 2018
60697c3
Exchanges: update-products 1483
Sep 14, 2018
2a1303f
Exchanges: update-products 1491
Sep 15, 2018
ff36fd8
Exchanges: update-products 1500
Sep 16, 2018
baead52
Exchanges: update-products 1507
Sep 17, 2018
8db20f9
Exchanges: update-products 1516
Sep 18, 2018
ca374e1
Exchanges: update-products 1524
Sep 19, 2018
241880e
Exchanges: update-products 1524
Sep 19, 2018
9f60122
Update resolve-url-loader to the latest version 🚀 (#1709)
greenkeeper[bot] Sep 20, 2018
a05ecb9
Update pushbullet to the latest version 🚀 (#1710)
greenkeeper[bot] Sep 20, 2018
98aeb99
Greenkeeper/ccxt 1.17.321 (#1713)
DeviaVir Sep 20, 2018
2addb1f
Exchanges: update-products 1540
Sep 20, 2018
e63562d
Exchanges: update-products 1540
Sep 20, 2018
2397a22
Exchanges: update-products 1548
Sep 21, 2018
c471707
Exchanges: update-products 1548
Sep 21, 2018
17580c5
Exchanges: update-products 1560
Sep 22, 2018
be79ea2
Exchanges: update-products 1568
Sep 23, 2018
527833d
Exchanges: update-products 1571
Sep 24, 2018
44236f8
Exchanges: update-products 1578
Sep 25, 2018
3d95834
Exchanges: update-products 1585
Sep 26, 2018
8271fab
Exchanges: update-products 1585
Sep 26, 2018
4923e78
Exchanges: update-products 1590
Sep 27, 2018
1cdd0d1
Exchanges: update-products 1598
Sep 28, 2018
589429d
Exchanges: update-products 1598
Sep 28, 2018
4fc31b1
Exchanges: update-products 1605
Sep 29, 2018
2504fd4
Exchanges: update-products 1605
Sep 29, 2018
0975ffb
Greenkeeper/ccxt 1.17.360 (#1720)
DeviaVir Sep 30, 2018
c707966
Greenkeeper/babel loader 8.0.4 (#1721)
DeviaVir Sep 30, 2018
f10140b
Greenkeeper/husky 1.0.1 (#1722)
DeviaVir Sep 30, 2018
e782c30
Exchanges: update-products 1618
Sep 30, 2018
7a58bc4
fixing vulnerabilities in repo (#1723)
DeviaVir Oct 1, 2018
c035304
Merge branch 'master' of github.com:DeviaVir/zenbot into unstable
DeviaVir Oct 1, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env-sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BASIC_AUTH_ZEN=ommm:$apr1$1n0zqO2y$A2ueB9zMWZTYTtfckFhql1
TRAEFIK_HOST_ZEN=myhost.com
BASIC_AUTH_DB=ommm:$apr1$1n0zqO2y$A2ueB9zMWZTYTtfckFhql1
TRAEFIK_HOST_DB=db.myhost.com
TRAEFIK_NETWORK_NAME=traefik-proxy
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ dist/*
simulations/sim_*.json
gen.*.bat
gen.*.sh

.env
scripts/auto_backtester/backtesting_*.csv
database/*
18 changes: 12 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
FROM node:8

RUN mkdir -p /app
FROM node:8 as builder
ADD . /app
WORKDIR /app

COPY . /app
RUN npm install -g node-gyp
RUN npm install --unsafe

FROM node:8-alpine

ADD . /app
WORKDIR /app

COPY --from=builder /usr/local/lib/node_modules/ /usr/local/lib/node_modules/
COPY --from=builder /app/node_modules /app/node_modules/
COPY --from=builder /app/dist /app/dist/

RUN ln -s /app/zenbot.sh /usr/local/bin/zenbot

ENV NODE_ENV production

ENTRYPOINT ["/usr/local/bin/node", "zenbot.js"]
ENTRYPOINT ["/app/zenbot.sh"]
CMD [ "trade", "--paper" ]
132 changes: 132 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Check if this is Windows
ifneq (,$(findstring WINDOWS,$(PATH)))
WINDOWS := True
endif

# Set shell to cmd on windows
ifdef WINDOWS
SHELL := C:/Windows/System32/cmd.exe
endif

# Don't use sudo on windows
SUDO := "sudo"
ifdef WINDOWS
SUDO :=
endif

# set home dir to user's home on windows running MINGW
ifdef MSYSTEM
HOME := $(subst \,/,$(HOME))
endif

# Get the root dir of this file
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

# Define the full path to this file
THIS_FILE := $(lastword $(MAKEFILE_LIST))

# Set docker-compose file selector for windows
ifneq (,$(findstring WINDOWS,$(PATH)))
DC_CONFIG=$(ROOT_DIR)/docker-compose-windows.yml
else
DC_CONFIG=$(ROOT_DIR)/docker-compose.yml
endif

# Find or create a home for sensitive environment variables
# Check my secret place
CREDS=$(HOME)/.bash/.credentials
ifneq ("$(wildcard $(CREDS))","")
CREDENTIALS := $(CREDS)
else
# Check a normal place
CREDS=$(HOME)/.credentials
ifneq ("$(wildcard $(CREDS))","")
CREDENTIALS := $(CREDS)
else
$(info $(shell "mkdir" $(CREDS)))
endif
endif

# To use arguments with make execute: make -- <command> <args>
ARGS = $(filter-out $@,$(MAKECMDGOALS))
MAKEFLAGS += --silent

list:
sh -c "echo; $(MAKE) -p no_targets__ | awk -F':' '/^[a-zA-Z0-9][^\$$#\/\\t=]*:([^=]|$$)/ {split(\$$1,A,/ /);for(i in A)print A[i]}' | grep -v '__\$$' | grep -v 'Makefile'| sort"

#############################
# ZENBOT
#############################

list-strategies:
docker-compose exec server zenbot list-strategies $(ARGS)

list-selectors:
docker-compose exec server zenbot list-selectors $(ARGS)

backfill:
docker-compose exec server zenbot backfill $(ARGS)

sim:
docker-compose exec server zenbot sim $(ARGS)

trade:
docker-compose exec server zenbot trade $(ARGS)

paper:
docker-compose exec server zenbot trade --paper $(ARGS)

balance:
docker-compose exec server zenbot balance $(ARGS)

buy:
docker-compose exec server zenbot buy $(ARGS)

sell:
docker-compose exec server zenbot sell $(ARGS)

zenbot:
docker-compose exec server zenbot $(ARGS)

#############################
# Docker machine states
#############################
time-sync:
docker run --rm --privileged alpine hwclock -s

up:
$(SUDO) docker-compose --file=$(DC_CONFIG) up

start:
docker-compose start

stop:
docker-compose stop

state:
docker-compose ps

rebuild:
$(SUDO) docker-compose stop
$(SUDO) docker-compose pull
$(SUDO) docker-compose rm --force server
$(SUDO) docker-compose rm --force mongodb
-$(SUDO) docker-compose rm --force adminmongo
$(SUDO) docker-compose build --no-cache
$(SUDO) docker-compose --file=$(DC_CONFIG) up -d --force-recreate


shell:
docker-compose exec server /bin/sh

shellw:
docker exec -it -u root $$(docker-compose ps -q server) /bin/sh

logs:
docker-compose logs $(ARGS)

#############################
# Argument fix workaround
#############################
%:
@:
27 changes: 7 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,8 @@

# Zenbot [![Build/Test Status](https://travis-ci.org/DeviaVir/zenbot.svg?branch=master)](https://travis-ci.org/DeviaVir/zenbot) [![Greenkeeper badge](https://badges.greenkeeper.io/DeviaVir/zenbot.svg)](https://greenkeeper.io/)

## Current Status

Zenbot 4 is functional, but is having trouble reliably making profit. At this point, **I would recommend against trading with large amounts** until some of these issues can be worked out:

- Many people are reporting [losses in live trading](https://github.com/carlos8f/zenbot/issues/189) even if the simulation results and/or paper trading is positive.
- This is my highest priority right now, since an unprofitable bot is not worth much, but please understand that reliably making profit is hard, and so is making a realistic simulator.
- The losses may be due to the default strategy not working well in sideways (non-trending) market conditions, slippage during limit order execution, or both. Currently I would recommend against using Zenbot on a market that is non-trending or trending generally downwards.
- The limit-order strategy that Zenbot uses to avoid taker fees, is prone to race conditions and delays. A mode for using market-type orders will probably need to be made, which may make frequent-trade strategies less viable due to fees, but more reliable execution overall.
- An upcoming feature will allow Zenbot to use a limited amount of your balance, which will help with experimenting with live trading, but mitigating the possible losses from the issues above.

Zenbot is a hobby project for me and I'm sorry that I can't devote myself full-time to it. Since I'm getting busier, development may slow down a bit from here, so please be patient if issues aren't fixed right away.

## Questions
Please ask (programming) questions related to zenbot on stackoverflow. The tag is [zenbot](https://stackoverflow.com/questions/tagged/zenbot).
Please ask (programming) questions related to zenbot on reddit. The subreddit is [zenbot](https://reddit.com/r/zenbot).

## Description

Expand Down Expand Up @@ -76,7 +64,7 @@ cp conf-sample.js conf.js
- View and edit `conf.js`.
- It's possible to use zenbot in "paper trading" mode without making any changes.
- You must add your exchange API keys to enable real trading however.
- API keys do NOT need deposit/withdrawl permissions.
- API keys do NOT need deposit/withdrawal permissions.

If using Docker, skip to section "Docker" below.

Expand Down Expand Up @@ -818,12 +806,6 @@ Or to sell 10% of your BTC,
zenbot sell gdax.BTC-USD --pct=10
```

## Chat with other Zenbot users

[![zenbot logo](https://rawgit.com/deviavir/zenbot/master/assets/discord.png)](https://discord.gg/ZdAd2gP)

Zenbot has a Discord chat! You can get in [through this invite link](https://discord.gg/ZdAd2gP).

## Donate

P.S., some have asked for how to donate to Zenbot development. We accept donations at **Bitcoin addresses** below:
Expand All @@ -840,6 +822,11 @@ P.S., some have asked for how to donate to Zenbot development. We accept donatio

Thanks!

## Noteworthy forks

- [bot18](https://medium.com/@carlos8f_11468/introducing-bot18-the-new-crypto-trading-bot-to-supersede-zenbot-and-unleash-the-zalgo-da8464b41e53)
- [magic8bot](https://github.com/notVitaliy/magic8bot)

- - -

### License: MIT
Expand Down
2 changes: 2 additions & 0 deletions boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module.exports = function (cb) {
var config = {}
var overrides = {}

module.exports.debug = args.debug

// 1. load conf overrides file if present
if(!_.isUndefined(args.conf)){
try {
Expand Down
18 changes: 14 additions & 4 deletions commands/balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var minimist = require('minimist')
, colors = require('colors')
, moment = require('moment')
, objectifySelector = require('../lib/objectify-selector')
, exchangeService = require('../lib/services/exchange-service')
, { formatCurrency } = require('../lib/format')

module.exports = function (program, conf) {
Expand Down Expand Up @@ -33,9 +34,18 @@ module.exports = function (program, conf) {
so.debug = cmd.debug
so.mode = 'live'
function balance () {
s.exchange.getBalance(s, function (err, balance) {
var exchangeServiceInstance = exchangeService(conf)
var exchange = exchangeServiceInstance.getExchange()

var exchangeName = exchange.name // TODO: Refactor all exchanges to be in the format of the stub.exchange, so we can use getName() here.
if (exchange === undefined) {
console.error('\nSorry, couldn\'t find an exchange named [' + exchangeName + '].')
process.exit(1)
}

exchange.getBalance(s, function (err, balance) {
if (err) throw err
s.exchange.getQuote(s, function (err, quote) {
exchange.getQuote(s, function (err, quote) {
if (err) throw err

var bal = moment().format('YYYY-MM-DD HH:mm:ss').grey + ' ' + formatCurrency(quote.ask, s.currency, true, true, false) + ' ' + (s.product_id).grey + '\n'
Expand All @@ -46,10 +56,10 @@ module.exports = function (program, conf) {
console.log(bal)

if (so.calculate_currency) {
s.exchange.getQuote({'product_id': s.asset + '-' + so.calculate_currency}, function (err, asset_quote) {
exchange.getQuote({'product_id': s.asset + '-' + so.calculate_currency}, function (err, asset_quote) {
if (err) throw err

s.exchange.getQuote({'product_id': s.currency + '-' + so.calculate_currency}, function (err, currency_quote) {
exchange.getQuote({'product_id': s.currency + '-' + so.calculate_currency}, function (err, currency_quote) {
if (err) throw err
var asset_total = balance.asset * asset_quote.bid
var currency_total = balance.currency * currency_quote.bid
Expand Down
4 changes: 4 additions & 0 deletions commands/sim.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ module.exports = function (program, conf) {
output_lines.push('error rate: ' + (sells ? n(losses).divide(sells).format('0.00%') : '0.00%').yellow)
}
options_output.simresults.start_capital = s.start_capital
options_output.simresults.last_buy_price = s.last_buy_price
options_output.simresults.last_assest_value = s.trades[s.trades.length-1].price
options_output.net_currency = s.net_currency
options_output.simresults.asset_capital = s.asset_capital
options_output.simresults.currency = n(s.balance.currency).value()
options_output.simresults.profit = profit.value()
options_output.simresults.buy_hold = buy_hold.value()
Expand Down
5 changes: 3 additions & 2 deletions commands/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var tb = require('timebucket')
, objectifySelector = require('../lib/objectify-selector')
, engineFactory = require('../lib/engine')
, collectionService = require('../lib/services/collection-service')
, debug = require('../lib/debug')

module.exports = function (program, conf) {
program
Expand Down Expand Up @@ -519,8 +520,8 @@ module.exports = function (program, conf) {
console.log('\nDumping statistics...'.grey)
toggleStats()
} else if (key === 'L' && !info.ctrl) {
so.debug = !so.debug
console.log('\nDEBUG mode: ' + (so.debug ? 'ON'.green.inverse : 'OFF'.red.inverse))
debug.flip()
console.log('\nDEBUG mode: ' + (debug.on ? 'ON'.green.inverse : 'OFF'.red.inverse))
} else if (info.name === 'c' && info.ctrl) {
// @todo: cancel open orders before exit
console.log()
Expand Down
6 changes: 3 additions & 3 deletions conf-sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ c.sell_pct = 99
// ms to adjust non-filled order after
c.order_adjust_time = 5000
// avoid selling at a loss below this pct set to 0 to ensure selling at a higher price...
c.max_sell_loss_pct = 25
c.max_sell_loss_pct = 99
// avoid buying at a loss above this pct set to 0 to ensure buying at a lower price...
c.max_buy_loss_pct = 25
c.max_buy_loss_pct = 99
// ms to poll order status
c.order_poll_time = 5000
// ms to wait for settlement (after an order cancel)
Expand Down Expand Up @@ -252,4 +252,4 @@ c.output = {}
c.output.api = {}
c.output.api.on = true
c.output.api.ip = '0.0.0.0' // IPv4 or IPv6 address to listen on, uses all available interfaces if omitted
c.output.api.port = 0 // 0 = random port
c.output.api.port = 0 // 0 = random port, set to 17365 if you use docker
67 changes: 67 additions & 0 deletions docker-compose-traefik.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: '3.1'
services:
zenbotserver:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./:/app/
- /app/node_modules/
- /app/dist/
restart: always
tty: true
expose:
- "17365"
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=Host:$(TRAEFIK_HOST_ZEN)"
- "traefik.docker.network=$(TRAEFIK_NETWORK_NAME)"
- "traefik.port=17365"
- "traefik.frontend.auth.basic=$(BASIC_AUTH_ZEN)"
networks:
- internal
- proxy
depends_on:
- mongodb
environment:
- MONGODB_PORT_27017_TCP_ADDR=mongodb

mongodb:
image: mongo:latest
restart: always
volumes:
- ./data/db:/data/db
command: mongod --smallfiles --bind_ip=0.0.0.0 --logpath=/dev/null
networks:
- internal
expose:
- 27017

# "adminMongo is a Web based user interface (GUI) to handle all your MongoDB connections/databases needs."
adminmongo:
image: mrvautin/adminmongo
expose:
- 1234
depends_on:
- mongodb
environment:
- "CONN_NAME=zenbot_mongodb"
- "DB_HOST=mongodb"
- "DB_PORT=27017"
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=Host:$(TRAEFIK_HOST_DB)"
- "traefik.docker.network=$(TRAEFIK_NETWORK_NAME)"
- "traefik.port=1234"
- "traefik.frontend.auth.basic=$(BASIC_AUTH_DB)"
networks:
- internal
- proxy
command: "npm start"

networks:
proxy:
external:
name: "$(TRAEFIK_NETWORK_NAME)"
internal:
external: false
Loading