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

Commit f235ba1

Browse files
authored
v4.1.0: release to master (#1069)
* bring the recent commits to master down into unstable (#1048) * update products.json file to newest trading pairs at binance (#1028) * Binance changed API 24 hours to 1 hour (#1027) * Update README * Update README again * add generation data to gitignore (#1012) * binance changed their API strategy from 24 hour windows to 1 hour. * rename periodLength to period_length (#1035) * Change markup_pct to new markdown and markup, set commonArgs so it is included in all strategies, fix return. (#1047) The only other occurrence is in the readme file noting the legacy aspect. * Update darwin.js * Added support for dema-strategy to darwin.js (#1046) * fix bad escaping on output to console (#1045) * Update periodLength to underscore syntax for darwin * Missing | lead to bitwise operation being performed rather than an OR logical comparison. (#1053) * Console Output adjustment (#1055) * resolution to .csv & .json output (#1058) * resolution to .csv & .json output trogdor123 got me looking at the right section where the params were being input in json. made some minor tweaks to the code and now both are outputting correctly. * Update darwin.js ...changes - formatting. * darwin.js - crossover strategy (#1060) noticed that generational output was static from gen to gen for smalen1 and smalen2. sure enough, those are coded into the strategy itself, but were left out of the darwin.js strategy config for mutation. * Docker (#1061) * docker fix * Resolve docker build problems * noop strategy: readme/links/list (#1062) * Travis. Docker. (#1063) * Updated minimum required node version (#1066) It appears Zenbot wont work on anything before 8.3.0. Updating the minimum required version, for clarity. * Merge DemaStrats (#1067) fixes #1064 * v4.1.0: prepare release (#1068) * v4.1.0: prepare release * update package-lock.json
1 parent 10c2384 commit f235ba1

File tree

18 files changed

+6837
-1824
lines changed

18 files changed

+6837
-1824
lines changed

.travis.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: node_js
2+
node_js:
3+
- "8"
4+
- "9"
5+
before_install:
6+
- rm -rf package-lock.json
7+
- npm install https://github.com/floatdrop/pinkie-promise.git
8+
- npm install -g node-gyp

CHANGELOG.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Changelog
2+
3+
- [v4.1.0](https://github.com/carlos8f/zenbot/releases/tag/v4.1.0) (Latest)
4+
- more indicators
5+
- more strategies
6+
- more exchanges
7+
- too many bug fixes to list here
8+
- web UI
9+
- Travis
10+
- Docker automated builds
11+
- Automated tests
12+
- [v4.0.5](https://github.com/carlos8f/zenbot/releases/tag/v4.0.5)
13+
- handle insufficient funds errors from gdax
14+
- new trend_ema defaults adjusted for latest btc movements: 20m period, neutral_rate=0
15+
- include more data in sim output
16+
- remove rarely useful trend_ema options
17+
- avoid abort in trader on failed getTrades()
18+
- v4.0.4
19+
- debugging for polo odd results
20+
- sim: simplify and correct makerFee assessment
21+
- fix conf path in API credentials errors
22+
- fix order total under 0.0001 error on polo
23+
- Docker: extend README slightly (thanks [@DeviaVir](https://github.com/deviavir) and [@egorbenko](https://github.com/egorbenko))
24+
- docker-compose: do not expose mongodb by default! (thanks [@DeviaVir](https://github.com/deviavir))
25+
- v4.0.3
26+
- fix for docker mongo host error
27+
- link for new Discord chat!
28+
- fix polo crash on getOrder weird result
29+
- fix oversold_rsi trigger while in preroll
30+
- fix polo "not enough..." errors
31+
- fancy colors for price report
32+
- display product id in report
33+
- fix poloniex backfill batches too big, mongo timeouts
34+
- fix cursorTo() crash on some node installs
35+
- memDump for debugging order failures
36+
- fix column spacing on progress report
37+
- v4.0.2
38+
- minor overhaul to trend_ema strat - added whipsaw filtering via std. deviation (`--neutral_rate=auto`)
39+
- trim preroll of sim result graph
40+
- v4.0.1
41+
- Added .dockerignore (thanks [@sulphur](https://github.com/sulphur))
42+
- fix crashing on mongo timeout during backfill
43+
- fix gaps in poloniex backfill
44+
- default backfill days 90 -> 14

Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ RUN mkdir -p /app
44
WORKDIR /app
55

66
COPY package.json /app/
7-
RUN npm install -g node-gyp && npm install --unsafe-perm
7+
COPY webpack.config.js /app/
8+
COPY webpack-src /app/webpack-src
9+
COPY templates /app/templates
10+
RUN npm install -g node-gyp
11+
RUN npm install --unsafe-perm
812

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

README.md

+112-76
Large diffs are not rendered by default.

commands/trade.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,11 @@ module.exports = function container (get, set, clear) {
387387
get('db.trades').select(opts, function (err, trades) {
388388
if (err) throw err
389389
if (!trades.length) {
390-
console.log('------------------------------------------ INITIALIZE OUTPUT ------------------------------------------')
390+
var head = '------------------------------------------ INITIALIZE OUTPUT ------------------------------------------';
391+
console.log(head)
391392
get('lib.output').initializeOutput(s)
392-
console.log('---------------------------- STARTING ' + so.mode.toUpperCase() + ' TRADING ----------------------------')
393+
var minuses = Math.floor((head.length - so.mode.length - 19) / 2)
394+
console.log('-'.repeat(minuses) + ' STARTING ' + so.mode.toUpperCase() + ' TRADING ' + '-'.repeat(minuses + (minuses % 2 == 0 ? 0 : 1)))
393395
if (so.mode === 'paper') {
394396
console.log('!!! Paper mode enabled. No real trades are performed until you remove --paper from the startup command.')
395397
}

docker-compose-windows.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
server:
2-
build: .
2+
image: deviavir/zenbot:unstable
33
volumes:
44
- ./conf.js:/app/conf.js
55
- ./extensions:/app/extensions
@@ -12,7 +12,7 @@ mongodb:
1212
image: mongo:latest
1313
volumes_from:
1414
- mongodb-data
15-
command: mongod --smallfiles
15+
command: mongod --smallfiles --bind_ip=0.0.0.0 --logpath=/dev/null
1616

1717
mongodb-data:
1818
image: mongo:latest

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: '3.1'
33
services:
44

55
server:
6-
build: .
6+
image: deviavir/zenbot:unstable
77
volumes:
88
- ./conf.js:/app/conf.js
99
- ./extensions:/app/extensions
@@ -22,7 +22,7 @@ services:
2222
image: mongo:latest
2323
volumes:
2424
- ./data/db:/data/db
25-
command: mongod --smallfiles --logpath=/dev/null
25+
command: mongod --smallfiles --bind_ip=0.0.0.0 --logpath=/dev/null
2626
ports:
2727
- 27017:27017
2828

extensions/exchanges/bittrex/exchange.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = function container(get, set, clear) {
3838
var timeout = 2500
3939
}
4040

41-
console.error(('\Bittrex API error - unable to call ' + method + ' (' + error.message + '), retrying in ' + timeout / 1000 + 's').red)
41+
console.error(('\nBittrex API error - unable to call ' + method + ' (' + error.message + '), retrying in ' + timeout / 1000 + 's').red)
4242
setTimeout(function () {
4343
exchange[method].apply(exchange, args)
4444
}, timeout)

extensions/exchanges/poloniex/exchange.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module.exports = function container (get, set, clear) {
7373
return retry('getTrades', func_args)
7474
}
7575
if (!body.map) {
76-
console.error('\getTrades odd result:')
76+
console.error('\ngetTrades odd result:')
7777
console.error(body)
7878
return retry('getTrades', func_args)
7979
}
@@ -100,7 +100,7 @@ module.exports = function container (get, set, clear) {
100100
return retry('getBalance', args)
101101
}
102102
if (body.error) {
103-
console.error('\ggetBalance error:')
103+
console.error('\ngetBalance error:')
104104
console.error(body)
105105
return retry('getBalance', args)
106106
}
@@ -126,7 +126,7 @@ module.exports = function container (get, set, clear) {
126126
return retry('getQuote', args)
127127
}
128128
if (body.error) {
129-
console.error('\ggetQuote error:')
129+
console.error('\ngetQuote error:')
130130
console.error(body)
131131
return retry('getQuote', args)
132132
}

extensions/strategies/dema-lessnoise/_codemap.js

-6
This file was deleted.

extensions/strategies/dema-lessnoise/strategy.js

-83
This file was deleted.

extensions/strategies/dema/strategy.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = function container (get, set, clear) {
1515
this.option('down_trend_threshold', 'threshold to trigger a sold signal', Number, 0)
1616
this.option('overbought_rsi_periods', 'number of periods for overbought RSI', Number, 9)
1717
this.option('overbought_rsi', 'sold when RSI exceeds this value', Number, 80)
18+
this.option('noise_level_pct', 'do not trade when short ema is with this % of last short ema', Number, 0)
1819
},
1920

2021
calculate: function (s) {
@@ -47,7 +48,9 @@ module.exports = function container (get, set, clear) {
4748
}
4849

4950
if (typeof s.period.dema_histogram === 'number' && typeof s.lookback[0].dema_histogram === 'number') {
50-
if ((s.period.dema_histogram - s.options.up_trend_threshold) > 0 && (s.lookback[0].dema_histogram - s.options.up_trend_threshold) <= 0) {
51+
if (s.options.noise_level_pct != 0 && (s.period.ema_short / s.lookback[0].ema_short * 100 < s.options.noise_level_pct)) {
52+
s.signal = 'null';
53+
} else if ((s.period.dema_histogram - s.options.up_trend_threshold) > 0 && (s.lookback[0].dema_histogram - s.options.up_trend_threshold) <= 0) {
5154
s.signal = 'buy';
5255
} else if ((s.period.dema_histogram + s.options.down_trend_threshold) < 0 && (s.lookback[0].dema_histogram + s.options.down_trend_threshold) >= 0) {
5356
s.signal = 'sell';
+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
_ns: 'zenbot',
33

4-
'strategies.noop': require('./strategy')
5-
}
4+
'strategies.noop': require('./strategy'),
5+
'strategies.list[]': '#strategies.noop'
6+
}

extensions/strategies/trendline/strategy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ module.exports = function container (get, set, clear) {
7272
s.signal = 'buy'
7373
}
7474
else if (
75-
s.growth === false |
76-
s.growth2 === false |
75+
s.growth === false ||
76+
s.growth2 === false ||
7777
s.accel === false
7878
)
7979
{

lib/engine.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ module.exports = function container (get, set, clear) {
706706
process.stdout.write(z(8, pct(diff), ' ')[diff >= 0 ? 'green' : 'red'])
707707
}
708708
else {
709-
process.stdout.write(z(8, '', ' '))
709+
process.stdout.write(z(9, '', ' '))
710710
}
711711
var volume_display = s.period.volume > 99999 ? abbreviate(s.period.volume, 2) : n(s.period.volume).format('0')
712712
volume_display = z(8, volume_display, ' ')
@@ -789,8 +789,8 @@ module.exports = function container (get, set, clear) {
789789
z(19, 'DATE', ' ').grey,
790790
z(17, 'PRICE', ' ').grey,
791791
z(9, 'DIFF', ' ').grey,
792-
z(15, 'VOL', ' ').grey,
793-
z(12, 'RSI', ' ').grey,
792+
z(10, 'VOL', ' ').grey,
793+
z(8, 'RSI', ' ').grey,
794794
z(32, 'ACTIONS', ' ').grey,
795795
z(25, 'BAL', ' ').grey,
796796
z(22, 'PROFIT', ' ').grey

0 commit comments

Comments
 (0)