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

Commit

Permalink
v4.1.0: release to master (#1069)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
DeviaVir committed Jan 7, 2018
1 parent 10c2384 commit f235ba1
Show file tree
Hide file tree
Showing 18 changed files with 6,837 additions and 1,824 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: node_js
node_js:
- "8"
- "9"
before_install:
- rm -rf package-lock.json
- npm install https://github.com/floatdrop/pinkie-promise.git
- npm install -g node-gyp
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Changelog

- [v4.1.0](https://github.com/carlos8f/zenbot/releases/tag/v4.1.0) (Latest)
- more indicators
- more strategies
- more exchanges
- too many bug fixes to list here
- web UI
- Travis
- Docker automated builds
- Automated tests
- [v4.0.5](https://github.com/carlos8f/zenbot/releases/tag/v4.0.5)
- handle insufficient funds errors from gdax
- new trend_ema defaults adjusted for latest btc movements: 20m period, neutral_rate=0
- include more data in sim output
- remove rarely useful trend_ema options
- avoid abort in trader on failed getTrades()
- v4.0.4
- debugging for polo odd results
- sim: simplify and correct makerFee assessment
- fix conf path in API credentials errors
- fix order total under 0.0001 error on polo
- Docker: extend README slightly (thanks [@DeviaVir](https://github.com/deviavir) and [@egorbenko](https://github.com/egorbenko))
- docker-compose: do not expose mongodb by default! (thanks [@DeviaVir](https://github.com/deviavir))
- v4.0.3
- fix for docker mongo host error
- link for new Discord chat!
- fix polo crash on getOrder weird result
- fix oversold_rsi trigger while in preroll
- fix polo "not enough..." errors
- fancy colors for price report
- display product id in report
- fix poloniex backfill batches too big, mongo timeouts
- fix cursorTo() crash on some node installs
- memDump for debugging order failures
- fix column spacing on progress report
- v4.0.2
- minor overhaul to trend_ema strat - added whipsaw filtering via std. deviation (`--neutral_rate=auto`)
- trim preroll of sim result graph
- v4.0.1
- Added .dockerignore (thanks [@sulphur](https://github.com/sulphur))
- fix crashing on mongo timeout during backfill
- fix gaps in poloniex backfill
- default backfill days 90 -> 14
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ RUN mkdir -p /app
WORKDIR /app

COPY package.json /app/
RUN npm install -g node-gyp && npm install --unsafe-perm
COPY webpack.config.js /app/
COPY webpack-src /app/webpack-src
COPY templates /app/templates
RUN npm install -g node-gyp
RUN npm install --unsafe-perm

COPY . /app
RUN ln -s /app/zenbot.sh /usr/local/bin/zenbot
Expand Down
188 changes: 112 additions & 76 deletions README.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions commands/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,11 @@ module.exports = function container (get, set, clear) {
get('db.trades').select(opts, function (err, trades) {
if (err) throw err
if (!trades.length) {
console.log('------------------------------------------ INITIALIZE OUTPUT ------------------------------------------')
var head = '------------------------------------------ INITIALIZE OUTPUT ------------------------------------------';
console.log(head)
get('lib.output').initializeOutput(s)
console.log('---------------------------- STARTING ' + so.mode.toUpperCase() + ' TRADING ----------------------------')
var minuses = Math.floor((head.length - so.mode.length - 19) / 2)
console.log('-'.repeat(minuses) + ' STARTING ' + so.mode.toUpperCase() + ' TRADING ' + '-'.repeat(minuses + (minuses % 2 == 0 ? 0 : 1)))
if (so.mode === 'paper') {
console.log('!!! Paper mode enabled. No real trades are performed until you remove --paper from the startup command.')
}
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-windows.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server:
build: .
image: deviavir/zenbot:unstable
volumes:
- ./conf.js:/app/conf.js
- ./extensions:/app/extensions
Expand All @@ -12,7 +12,7 @@ mongodb:
image: mongo:latest
volumes_from:
- mongodb-data
command: mongod --smallfiles
command: mongod --smallfiles --bind_ip=0.0.0.0 --logpath=/dev/null

mongodb-data:
image: mongo:latest
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.1'
services:

server:
build: .
image: deviavir/zenbot:unstable
volumes:
- ./conf.js:/app/conf.js
- ./extensions:/app/extensions
Expand All @@ -22,7 +22,7 @@ services:
image: mongo:latest
volumes:
- ./data/db:/data/db
command: mongod --smallfiles --logpath=/dev/null
command: mongod --smallfiles --bind_ip=0.0.0.0 --logpath=/dev/null
ports:
- 27017:27017

Expand Down
2 changes: 1 addition & 1 deletion extensions/exchanges/bittrex/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = function container(get, set, clear) {
var timeout = 2500
}

console.error(('\Bittrex API error - unable to call ' + method + ' (' + error.message + '), retrying in ' + timeout / 1000 + 's').red)
console.error(('\nBittrex API error - unable to call ' + method + ' (' + error.message + '), retrying in ' + timeout / 1000 + 's').red)
setTimeout(function () {
exchange[method].apply(exchange, args)
}, timeout)
Expand Down
6 changes: 3 additions & 3 deletions extensions/exchanges/poloniex/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = function container (get, set, clear) {
return retry('getTrades', func_args)
}
if (!body.map) {
console.error('\getTrades odd result:')
console.error('\ngetTrades odd result:')
console.error(body)
return retry('getTrades', func_args)
}
Expand All @@ -100,7 +100,7 @@ module.exports = function container (get, set, clear) {
return retry('getBalance', args)
}
if (body.error) {
console.error('\ggetBalance error:')
console.error('\ngetBalance error:')
console.error(body)
return retry('getBalance', args)
}
Expand All @@ -126,7 +126,7 @@ module.exports = function container (get, set, clear) {
return retry('getQuote', args)
}
if (body.error) {
console.error('\ggetQuote error:')
console.error('\ngetQuote error:')
console.error(body)
return retry('getQuote', args)
}
Expand Down
6 changes: 0 additions & 6 deletions extensions/strategies/dema-lessnoise/_codemap.js

This file was deleted.

83 changes: 0 additions & 83 deletions extensions/strategies/dema-lessnoise/strategy.js

This file was deleted.

5 changes: 4 additions & 1 deletion extensions/strategies/dema/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = function container (get, set, clear) {
this.option('down_trend_threshold', 'threshold to trigger a sold signal', Number, 0)
this.option('overbought_rsi_periods', 'number of periods for overbought RSI', Number, 9)
this.option('overbought_rsi', 'sold when RSI exceeds this value', Number, 80)
this.option('noise_level_pct', 'do not trade when short ema is with this % of last short ema', Number, 0)
},

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

if (typeof s.period.dema_histogram === 'number' && typeof s.lookback[0].dema_histogram === 'number') {
if ((s.period.dema_histogram - s.options.up_trend_threshold) > 0 && (s.lookback[0].dema_histogram - s.options.up_trend_threshold) <= 0) {
if (s.options.noise_level_pct != 0 && (s.period.ema_short / s.lookback[0].ema_short * 100 < s.options.noise_level_pct)) {
s.signal = 'null';
} else if ((s.period.dema_histogram - s.options.up_trend_threshold) > 0 && (s.lookback[0].dema_histogram - s.options.up_trend_threshold) <= 0) {
s.signal = 'buy';
} else if ((s.period.dema_histogram + s.options.down_trend_threshold) < 0 && (s.lookback[0].dema_histogram + s.options.down_trend_threshold) >= 0) {
s.signal = 'sell';
Expand Down
5 changes: 3 additions & 2 deletions extensions/strategies/noop/_codemap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
_ns: 'zenbot',

'strategies.noop': require('./strategy')
}
'strategies.noop': require('./strategy'),
'strategies.list[]': '#strategies.noop'
}
4 changes: 2 additions & 2 deletions extensions/strategies/trendline/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ module.exports = function container (get, set, clear) {
s.signal = 'buy'
}
else if (
s.growth === false |
s.growth2 === false |
s.growth === false ||
s.growth2 === false ||
s.accel === false
)
{
Expand Down
6 changes: 3 additions & 3 deletions lib/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ module.exports = function container (get, set, clear) {
process.stdout.write(z(8, pct(diff), ' ')[diff >= 0 ? 'green' : 'red'])
}
else {
process.stdout.write(z(8, '', ' '))
process.stdout.write(z(9, '', ' '))
}
var volume_display = s.period.volume > 99999 ? abbreviate(s.period.volume, 2) : n(s.period.volume).format('0')
volume_display = z(8, volume_display, ' ')
Expand Down Expand Up @@ -789,8 +789,8 @@ module.exports = function container (get, set, clear) {
z(19, 'DATE', ' ').grey,
z(17, 'PRICE', ' ').grey,
z(9, 'DIFF', ' ').grey,
z(15, 'VOL', ' ').grey,
z(12, 'RSI', ' ').grey,
z(10, 'VOL', ' ').grey,
z(8, 'RSI', ' ').grey,
z(32, 'ACTIONS', ' ').grey,
z(25, 'BAL', ' ').grey,
z(22, 'PROFIT', ' ').grey
Expand Down

0 comments on commit f235ba1

Please sign in to comment.