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

Support for Bitfinex API #2

Closed
MaxXor opened this issue Jul 10, 2016 · 26 comments
Closed

Support for Bitfinex API #2

MaxXor opened this issue Jul 10, 2016 · 26 comments

Comments

@MaxXor
Copy link

MaxXor commented Jul 10, 2016

It would be really useful to add support for bitfinex trading API.

I've never used NodeJS before, but I'll see if I can help.

@carlos8f
Copy link
Contributor

I will add other exchanges if the demand is there. however each exchange/pair needs to be machine-learned separately and I don't use Bitfinex so I'd rely on other users to submit bug reports.

@BarnumD
Copy link
Contributor

BarnumD commented Jul 31, 2016

Perhaps you have seen the news on twitter that coinbase/gdax may be insolvent. I would vote for bitfinex and/or poloniex trading to be added.

Also, it is possible to add margin trading (with the ability to have the bot short?)

@carlos8f
Copy link
Contributor

zenbot 3.x is going to be based on a new lib zenbrain which exposes a plugin API for all bot tasks. This includes

  • exchanges
  • reducers/data crunchers
  • technical analysis
  • trader bots
  • twitter bots
  • web crawlers
  • graphs/dashboards
  • etc

Bitfinex support will be included, but a problem arises of trying to backfill Bitfinex trades. So far I haven't found a way to get access to their historical trade API, when using an old timestamp it just gives recent trades instead, as if there's an artificial limit on how old you can query.

Anyway I definitely want to include support for all major exchanges that have open APIs.

@lyn168
Copy link

lyn168 commented Sep 1, 2016

Badly needed Bitfinex trading API.

@OpenSourceMasta
Copy link

Any way you could substitute the data set from another source to backfill historical data for bitfinex?

I'm also here to say "Support for Bitfinex +1" I'll help where ever I can to help support it.

@nedievas
Copy link
Contributor

nedievas commented Feb 4, 2017

Support for Bitfinex +1

@nedievas
Copy link
Contributor

http://docs.bitfinex.com/v1/reference#rest-public-trades

limit_trades default 50 and I found maximum 49999

@nedievas
Copy link
Contributor

I have made a branch for Bitfinex support. Now it's collecting history/backfilling/running sim, but I did not made it to trade yet. https://github.com/nedievas/zenbot

@OpenSourceMasta
Copy link

Love it - Awesome work!

Any idea on how to back fill data from Bitfinex rather than let it collect data?

@nedievas
Copy link
Contributor

I'll try to update files this weekend. It's already backfilling the data. I'm trying to get it real trading.

@cloudwaves
Copy link

I have tried installing yet have issue finding the config.js file. I have done that but not sure about the issue.

[ec2-user@ip-10-0-0-12 zenbot]$ ./run.sh
/home/ec2-user/zenbot/node_modules/zenbrain/core/launcher/launcher.js:22
throw new Error('No config found. Please copy config_sample.js to config.js, edit, and re-try.')
^

Error: No config found. Please copy config_sample.js to config.js, edit, and re-try.
at Command. (/home/ec2-user/zenbot/node_modules/zenbrain/core/launcher/launcher.js:22:19)
at Command.listener (/home/ec2-user/zenbot/node_modules/commander/index.js:301:8)
at emitTwo (events.js:87:13)
at Command.emit (events.js:172:7)
at Command.parseArgs (/home/ec2-user/zenbot/node_modules/commander/index.js:615:12)
at Command.parse (/home/ec2-user/zenbot/node_modules/commander/index.js:458:21)
at Object.cli (/home/ec2-user/zenbot/node_modules/zenbrain/zenbrain.js:71:15)
at Object. (/home/ec2-user/zenbot/zenbot:10:7)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

@OpenSourceMasta
Copy link

@cloudwaves - Did you even read what the output said? Did you figure you'd just copy and paste it here for us to hold your hand?

Read other threads, this has been covered a few different times... The hint I'll give you....

('No config found. Please copy config_sample.js to config.js, edit, and re-try.')

@cloudwaves
Copy link

cloudwaves commented Mar 13, 2017

Hi, I have mentioned that I have already done that! I have already copied config_sample.js to config.js.
But still I am getting the same error.

the config.js is present in /home/ec2-user/zenbot/config.js

@cloudwaves
Copy link

Here is the list of file in zenbot folder.

drwxrwxr-x 3 ec2-user ec2-user 4096 Mar 13 08:54 assets
-rw-rw-r-- 1 ec2-user ec2-user 25098 Mar 13 08:54 bitfinex_logic.js
-rw-rw-r-- 1 ec2-user ec2-user 151 Mar 13 08:54 _codemap.js
-rw-rw-r-- 1 ec2-user ec2-user 185 Mar 13 08:54 config_bfx_usd.js
-rw-rw-r-- 1 ec2-user ec2-user 257 Mar 13 08:54 config_bitfinex_assets.js
-rw-rw-r-- 1 ec2-user ec2-user 186 Mar 13 08:54 config_btc_usd.js
-rw-rw-r-- 1 ec2-user ec2-user 1573 Mar 13 08:54 config_defaults.js
-rw-rw-r-- 1 ec2-user ec2-user 185 Mar 13 08:54 config_dsh_usd.js
-rw-rw-r-- 1 ec2-user ec2-user 185 Mar 13 08:54 config_etc_usd.js
-rw-rw-r-- 1 ec2-user ec2-user 185 Mar 13 08:54 config_eth_usd.js
-rw-rw-r-- 1 ec2-user ec2-user 1220 Mar 13 08:58 config.js
-rw-rw-r-- 1 ec2-user ec2-user 185 Mar 13 08:54 config_ltc_usd.js
-rw-rw-r-- 1 ec2-user ec2-user 185 Mar 13 08:54 config_rrt_usd.js
-rw-rw-r-- 1 ec2-user ec2-user 1220 Mar 13 08:54 config_sample.js
-rw-rw-r-- 1 ec2-user ec2-user 185 Mar 13 08:54 config_xmr_usd.js
-rw-rw-r-- 1 ec2-user ec2-user 185 Mar 13 08:54 config_zec_usd.js
-rw-rw-r-- 1 ec2-user ec2-user 1056 Mar 13 08:54 CONTRIBUTING.md
drwxrwxr-x 3 ec2-user ec2-user 4096 Mar 13 08:54 core
-rw-rw-r-- 1 ec2-user ec2-user 1206 Mar 13 08:54 docker-compose.yml
-rw-rw-r-- 1 ec2-user ec2-user 71 Mar 13 08:54 Dockerfile
drwxrwxr-x 28 ec2-user ec2-user 4096 Mar 13 08:58 node_modules
-rw-rw-r-- 1 ec2-user ec2-user 1195 Mar 13 08:54 package.json
-rw-rw-r-- 1 ec2-user ec2-user 4841 Mar 13 08:54 PITCHME.md
drwxrwxr-x 13 ec2-user ec2-user 4096 Mar 13 08:54 plugins
-rw-rw-r-- 1 ec2-user ec2-user 6586 Mar 13 08:54 README.md
-rwxrwxr-x 1 ec2-user ec2-user 53 Mar 13 08:54 reducer.sh
-rwxrwxr-x 1 ec2-user ec2-user 176 Mar 13 08:54 run-btc-usd.sh
-rw-rw-r-- 1 ec2-user ec2-user 1397 Mar 13 08:54 run-mypair.sh
-rwxrwxr-x 1 ec2-user ec2-user 189 Mar 13 08:54 run.sh
-rwxrwxr-x 1 ec2-user ec2-user 53 Mar 13 08:54 server.sh
-rw-rw-r-- 1 ec2-user ec2-user 0 Mar 13 08:54 tracking_scripts.html
-rwxrwxr-x 1 ec2-user ec2-user 118 Mar 13 08:54 update.sh
drwxrwxr-x 2 ec2-user ec2-user 4096 Mar 13 08:54 utils
-rwxrwxr-x 1 ec2-user ec2-user 391 Mar 13 08:54 zenbot

@nedievas
Copy link
Contributor

made a fresh clone.
cp config_sample.js config.js

[bfxbot@gene zenbot]$ ./run.sh
03/13/2017 07:36:34 PM EET [ launcher] cmd launch booting
03/13/2017 07:36:37 PM EET [ launcher] cmd map booting
03/13/2017 07:36:37 PM EET [ launcher] cmd reduce booting
03/13/2017 07:36:37 PM EET [ launcher] cmd run booting
03/13/2017 07:36:37 PM EET [ runner] starting
03/13/2017 07:36:37 PM EET [ launcher] cmd server booting
03/13/2017 07:36:37 PM EET [ server] zenbot/3.5.16 booted!
03/13/2017 07:36:37 PM EET [ server] open http://localhost:3013/?secret=48c29fd024d7780f to see a live graph.
03/13/2017 07:36:37 PM EET [ bitfinex] m24823809 11 trades. 03/13/2017 08:09:40 PM EET SELL 7.646 at $1,233.48 BTC/USD
03/13/2017 07:36:58 PM EET [ bitfinex] m24823810 6 trades. 03/13/2017 08:10:06 PM EET SELL 1.737 at $1,233.47 BTC/USD

everything seems to work.

@OpenSourceMasta
Copy link

Confirmed working over here as well. Try making a fresh copy of it?

It doesn't seem to be your permissions either, those look to be correct. Are there any additional spaces anywhere?

As a relevant update. I almost have all historical information imported into Mongo correctly. Will release script when complete. 💯

@cloudwaves
Copy link

@OpenSourceMasta Yeah, Now I have removed zenbot folder and cloned newly.

[ec2-user@ip-10-0-0-6 ~]$ git clone https://github.com/nedievas/zenbot.git
[ec2-user@ip-10-0-0-6 ~]$ cd zenbot
[ec2-user@ip-10-0-0-6 zenbot]$ cp config_sample.js config.js
[ec2-user@ip-10-0-0-6 zenbot]$ vi config.js
[ec2-user@ip-10-0-0-6 zenbot]$ npm install
[ec2-user@ip-10-0-0-6 zenbot]$ ./run.sh
/home/ec2-user/zenbot/node_modules/zenbrain/core/launcher/launcher.js:22
throw new Error('No config found. Please copy config_sample.js to config.js, edit, and re-try.')
^

Error: No config found. Please copy config_sample.js to config.js, edit, and re-try.
at Command. (/home/ec2-user/zenbot/node_modules/zenbrain/core/launcher/launcher.js:22:19)
at Command.listener (/home/ec2-user/zenbot/node_modules/commander/index.js:301:8)
at emitTwo (events.js:87:13)
at Command.emit (events.js:172:7)
at Command.parseArgs (/home/ec2-user/zenbot/node_modules/commander/index.js:615:12)
at Command.parse (/home/ec2-user/zenbot/node_modules/commander/index.js:458:21)
at Object.cli (/home/ec2-user/zenbot/node_modules/zenbrain/zenbrain.js:71:15)
at Object. (/home/ec2-user/zenbot/zenbot:10:7)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

But if I clone from https://github.com/carlos8f/zenbot.git, it working without any issue. Since I don't have GDAX account, I cannot use that... If you want to test, please PM me to spicepearls(at)gmail(dot)com.

@nedievas
Copy link
Contributor

Don't know if it matters. I try to reproduce your error again:

[bfxbot@gene ~]$ git clone https://github.com/nedievas/zenbot
Cloning into 'zenbot'...
remote: Counting objects: 6657, done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 6657 (delta 55), reused 0 (delta 0), pack-reused 6563
Receiving objects: 100% (6657/6657), 5.70 MiB | 3.18 MiB/s, done.
Resolving deltas: 100% (4266/4266), done.
Checking connectivity... done.
[bfxbot@gene ~]$ cd zenbot/
[bfxbot@gene zenbot]$ cp config_sample.js config.js
[bfxbot@gene zenbot]$ npm install
npm WARN deprecated node-uuid@1.4.7: use uuid module instead

> microtime@2.1.1 install /home/bfxbot/zenbot/node_modules/microtime
> node-gyp rebuild

make: Entering directory '/home/bfxbot/zenbot/node_modules/microtime/build'
  CXX(target) Release/obj.target/microtime/src/microtime.o
  SOLINK_MODULE(target) Release/obj.target/microtime.node
  COPY Release/microtime.node
make: Leaving directory '/home/bfxbot/zenbot/node_modules/microtime/build'

> bufferutil@1.2.1 install /home/bfxbot/zenbot/node_modules/bufferutil
> node-gyp rebuild

make: Entering directory '/home/bfxbot/zenbot/node_modules/bufferutil/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
make: Leaving directory '/home/bfxbot/zenbot/node_modules/bufferutil/build'

> utf-8-validate@1.2.2 install /home/bfxbot/zenbot/node_modules/utf-8-validate
> node-gyp rebuild

make: Entering directory '/home/bfxbot/zenbot/node_modules/utf-8-validate/build'
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory '/home/bfxbot/zenbot/node_modules/utf-8-validate/build'
zenbot_trader@3.5.16 /home/bfxbot/zenbot
├── ansi_up@1.3.0
├─┬ axios@0.13.1
│ └─┬ follow-redirects@0.0.7
│   └── stream-consume@0.1.0
├─┬ bitfinex-api-node@0.2.9
│ ├─┬ debug@2.6.3
│ │ └── ms@0.7.2
│ ├─┬ request@2.81.0
│ │ ├── aws-sign2@0.6.0
│ │ ├── aws4@1.6.0
│ │ ├── caseless@0.12.0
│ │ ├─┬ combined-stream@1.0.5
│ │ │ └── delayed-stream@1.0.0
│ │ ├── extend@3.0.0
│ │ ├── forever-agent@0.6.1
│ │ ├─┬ form-data@2.1.2
│ │ │ └── asynckit@0.4.0
│ │ ├─┬ har-validator@4.2.1
│ │ │ ├─┬ ajv@4.11.5
│ │ │ │ ├── co@4.6.0
│ │ │ │ └── json-stable-stringify@1.0.1
│ │ │ └── har-schema@1.0.5
│ │ ├─┬ hawk@3.1.3
│ │ │ ├── boom@2.10.1
│ │ │ ├── cryptiles@2.0.5
│ │ │ ├── hoek@2.16.3
│ │ │ └── sntp@1.0.9
│ │ ├─┬ http-signature@1.1.1
│ │ │ ├── assert-plus@0.2.0
│ │ │ ├─┬ jsprim@1.4.0
│ │ │ │ ├── assert-plus@1.0.0
│ │ │ │ ├── extsprintf@1.0.2
│ │ │ │ ├── json-schema@0.2.3
│ │ │ │ └── verror@1.3.6
│ │ │ └─┬ sshpk@1.11.0
│ │ │   ├── asn1@0.2.3
│ │ │   ├── assert-plus@1.0.0
│ │ │   ├── bcrypt-pbkdf@1.0.1
│ │ │   ├─┬ dashdash@1.14.1
│ │ │   │ └── assert-plus@1.0.0
│ │ │   ├── ecc-jsbn@0.1.1
│ │ │   ├─┬ getpass@0.1.6
│ │ │   │ └── assert-plus@1.0.0
│ │ │   ├── jodid25519@1.0.2
│ │ │   ├── jsbn@0.1.1
│ │ │   └── tweetnacl@0.14.5
│ │ ├── is-typedarray@1.0.0
│ │ ├── isstream@0.1.2
│ │ ├── json-stringify-safe@5.0.1
│ │ ├─┬ mime-types@2.1.14
│ │ │ └── mime-db@1.26.0
│ │ ├── oauth-sign@0.8.2
│ │ ├── performance-now@0.2.0
│ │ ├── safe-buffer@5.0.1
│ │ ├── stringstream@0.0.5
│ │ ├─┬ tough-cookie@2.3.2
│ │ │ └── punycode@1.4.1
│ │ ├── tunnel-agent@0.6.0
│ │ └── uuid@3.0.1
│ └─┬ ws@0.8.1
│   ├─┬ bufferutil@1.2.1
│   │ └── nan@2.5.1
│   ├── options@0.0.6
│   ├── ultron@1.0.2
│   └─┬ utf-8-validate@1.2.2
│     └── nan@2.4.0
├─┬ coinbase-exchange@0.2.1  (git+https://github.com/carlos8f/coinbase-exchange-node.git#e6133d9a9e4ee3c5f911ba533529167e16e99324)
│ ├── async@1.5.0
│ ├── bintrees@1.0.0
│ ├─┬ lodash.assign@3.0.0
│ │ ├─┬ lodash._baseassign@3.2.0
│ │ │ ├── lodash._basecopy@3.0.1
│ │ │ └─┬ lodash.keys@3.1.2
│ │ │   ├── lodash._getnative@3.9.1
│ │ │   └── lodash.isarguments@3.1.0
│ │ └─┬ lodash._createassigner@3.1.1
│ │   ├── lodash._isiterateecall@3.0.9
│ │   └── lodash.restparam@3.6.1
│ ├─┬ lodash.foreach@3.0.0
│ │ ├── lodash._arrayeach@3.0.0
│ │ ├── lodash._baseeach@3.0.4
│ │ ├── lodash._bindcallback@3.0.1
│ │ └── lodash.isarray@3.0.4
│ ├─┬ lodash.partial@3.0.0
│ │ ├── lodash._baseslice@3.0.3
│ │ ├─┬ lodash._createwrapper@3.2.0
│ │ │ └── lodash._root@3.0.1
│ │ └── lodash._replaceholders@3.0.0
│ ├─┬ nock@3.6.0
│ │ ├─┬ chai@3.5.0
│ │ │ ├── assertion-error@1.0.2
│ │ │ ├─┬ deep-eql@0.1.3
│ │ │ │ └── type-detect@0.1.1
│ │ │ └── type-detect@1.0.0
│ │ ├── deep-equal@1.0.1
│ │ ├── lodash@2.4.1
│ │ ├─┬ mkdirp@0.5.1
│ │ │ └── minimist@0.0.8
│ │ └── propagate@0.3.1
│ ├─┬ num@0.2.1
│ │ └── int@0.1.1
│ ├─┬ request@2.51.0
│ │ ├── aws-sign2@0.5.0
│ │ ├─┬ bl@0.9.5
│ │ │ └─┬ readable-stream@1.0.34
│ │ │   └── isarray@0.0.1
│ │ ├── caseless@0.8.0
│ │ ├─┬ combined-stream@0.0.7
│ │ │ └── delayed-stream@0.0.5
│ │ ├── forever-agent@0.5.2
│ │ ├─┬ form-data@0.2.0
│ │ │ ├── async@0.9.2
│ │ │ └─┬ mime-types@2.0.14
│ │ │   └── mime-db@1.12.0
│ │ ├─┬ hawk@1.1.1
│ │ │ ├── boom@0.4.2
│ │ │ ├── cryptiles@0.2.2
│ │ │ ├── hoek@0.9.1
│ │ │ └── sntp@0.2.4
│ │ ├─┬ http-signature@0.10.1
│ │ │ ├── asn1@0.1.11
│ │ │ ├── assert-plus@0.1.5
│ │ │ └── ctype@0.5.3
│ │ ├── mime-types@1.0.2
│ │ ├── node-uuid@1.4.7
│ │ ├── oauth-sign@0.5.0
│ │ ├── qs@2.3.3
│ │ └── tunnel-agent@0.4.3
│ └── ws@1.1.0  (git+https://github.com/carlos8f/ws.git#d2f503883a96d3354ef582d4526857c84a81ba02)
├── colors@1.1.2
├─┬ commander@2.9.0
│ └── graceful-readlink@1.0.1
├── formatmicro@1.0.6
├─┬ kraken-api@0.1.7
│ └── querystring@0.2.0
├── micro-request@666.0.8
├── moment@2.17.1
├── moment-timezone@0.5.11
├─┬ motley@2.2.8
│ ├── addr@1.0.1
│ ├── codemap@1.3.1
│ ├── expres@0.0.5
│ ├── formidable@1.1.1
│ ├── href@0.1.1
│ ├─┬ middler@0.8.2
│ │ └─┬ bladerunner@0.1.3
│ │   ├── methods@1.1.2
│ │   ├─┬ minimatch@3.0.3
│ │   │ └─┬ brace-expansion@1.1.6
│ │   │   ├── balanced-match@0.4.2
│ │   │   └── concat-map@0.0.1
│ │   └── path-to-regexp@1.7.0
│ ├── pause@0.1.0
│ ├── qs@6.4.0
│ ├── run-series@1.1.4
│ ├─┬ sosa_mem@1.0.1
│ │ └── sosa@1.1.3
│ └─┬ sosa_session@1.0.0
│   ├── cookie@0.2.4
│   └── idgen@2.0.2
├─┬ motley-buffet@2.0.2
│ └─┬ buffet@1.0.10
│   ├─┬ accesslog@0.0.2
│   │ └── dateable@0.1.3
│   ├─┬ dish@1.0.7
│   │ ├── from@0.1.7
│   │ └─┬ lru-cache@4.0.2
│   │   ├── pseudomap@1.0.2
│   │   └── yallist@2.1.2
│   └─┬ mayonnaise@0.3.3
│     └─┬ dollop@0.4.5
│       ├─┬ glob@7.1.1
│       │ ├── fs.realpath@1.0.0
│       │ ├─┬ inflight@1.0.6
│       │ │ └── wrappy@1.0.2
│       │ ├── once@1.4.0
│       │ └── path-is-absolute@1.0.1
│       ├── rimraf@2.6.1
│       └─┬ sinon@1.17.7
│         ├── formatio@1.1.1
│         ├── lolex@1.3.2
│         ├── samsam@1.1.2
│         └─┬ util@0.10.3
│           └── inherits@2.0.1
├─┬ motley-mongo@2.0.5
│ ├─┬ mongodb@2.2.24
│ │ ├── es6-promise@3.2.1
│ │ ├─┬ mongodb-core@2.1.8
│ │ │ ├── bson@1.0.4
│ │ │ └─┬ require_optional@1.0.0
│ │ │   ├── resolve-from@2.0.0
│ │ │   └── semver@5.3.0
│ │ └─┬ readable-stream@2.1.5
│ │   └── isarray@1.0.0
│ └── sosa_mongo@1.0.3
├─┬ motley-templ@2.0.4
│ ├─┬ handlebars@4.0.6
│ │ ├─┬ optimist@0.6.1
│ │ │ └── wordwrap@0.0.3
│ │ ├─┬ source-map@0.4.4
│ │ │ └── amdefine@1.0.1
│ │ └─┬ uglify-js@2.8.12
│ │   ├── source-map@0.5.6
│ │   ├── uglify-to-browserify@1.0.2
│ │   └─┬ yargs@3.10.0
│ │     ├── camelcase@1.2.1
│ │     ├─┬ cliui@2.1.0
│ │     │ ├─┬ center-align@0.1.3
│ │     │ │ ├─┬ align-text@0.1.4
│ │     │ │ │ ├─┬ kind-of@3.1.0
│ │     │ │ │ │ └── is-buffer@1.1.5
│ │     │ │ │ ├── longest@1.0.1
│ │     │ │ │ └── repeat-string@1.6.1
│ │     │ │ └── lazy-cache@1.0.4
│ │     │ ├── right-align@0.1.3
│ │     │ └── wordwrap@0.0.2
│ │     ├── decamelize@1.2.0
│ │     └── window-size@0.1.0
│ └── templ@1.4.3
├─┬ multi-progress@2.0.0
│ └── progress@1.1.8
├── numbro@1.8.1  (git+https://github.com/carlos8f/numbro.git#11a9605bbd8a0bc8dc27c778cd7b4f467aebe2fa)
├── object-get@2.1.0
├─┬ os-monitor@1.0.5
│ ├─┬ readable-stream@2.1.5
│ │ ├── buffer-shims@1.0.0
│ │ ├── core-util-is@1.0.2
│ │ ├── inherits@2.0.3
│ │ ├── isarray@1.0.0
│ │ ├── process-nextick-args@1.0.7
│ │ ├── string_decoder@0.10.31
│ │ └── util-deprecate@1.0.2
│ └── underscore@1.8.3
├── run-parallel@1.1.6
├── run-parallel-limit@1.0.3
├─┬ sig@1.0.0
│ └─┬ json-stable-stringify@0.0.1
│   └── jsonify@0.0.0
├─┬ timebucket@0.3.4
│ └─┬ microtime@2.1.1
│   ├── bindings@1.2.1
│   └── nan@2.3.5
├─┬ twit@2.2.5
│ ├── bluebird@3.5.0
│ └── mime@1.3.4
├─┬ zenbrain@1.0.0-alpha  (git+https://github.com/carlos8f/zenbrain.git#bbda526bb833d9b258d8e6d187c1d5789c4cead0)
│ └── numbro@1.8.1  (git+https://github.com/carlos8f/numbro.git#e6e9a0d5f4c32939a7c19cf1546c7766b38cd31f)
└── zero-fill@2.2.3

npm WARN zenbot_trader@3.5.16 No repository field.
npm WARN zenbot_trader@3.5.16 No license field.
[bfxbot@gene zenbot]$ ./run.sh
03/14/2017 06:21:49 AM EET [    launcher] cmd `launch` booting
03/14/2017 06:21:52 AM EET [    launcher] cmd `map` booting
03/14/2017 06:21:52 AM EET [    launcher] cmd `reduce` booting
03/14/2017 06:21:52 AM EET [    launcher] cmd `run` booting
03/14/2017 06:21:52 AM EET [      runner] starting
03/14/2017 06:21:52 AM EET [    launcher] cmd `server` booting
03/14/2017 06:21:52 AM EET [      server] zenbot/3.5.16 booted!
03/14/2017 06:21:52 AM EET [      server] open http://192.168.0.200:3013/?secret=4ae27adaec740b04 to see a live graph.
03/14/2017 06:21:53 AM EET [    bitfinex]    m24824455    1000 trades. 03/14/2017 06:55:34 AM EET  BUY       562.855 at     $1,233.91 BTC/USD
03/14/2017 06:22:14 AM EET [    bitfinex]    m24824456       2 trades. 03/14/2017 06:56:57 AM EET  BUY         1.021 at     $1,231.40 BTC/USD

Please check if everything matches.

@cloudwaves
Copy link

What is your OS? I am doing exactly the same.
I am using AWS Linux m4.small.

Hear is my installation log.
`[ec2-user@ip-10-0-0-6 zenbot]$ npm install
npm WARN package.json zenbot_trader@3.5.16 No repository field.
npm WARN package.json zenbot_trader@3.5.16 No license field.
npm WARN deprecated node-uuid@1.4.7: use uuid module instead

microtime@2.1.1 install /home/ec2-user/zenbot/node_modules/timebucket/node_modules/microtime
node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
make: Entering directory /home/ec2-user/zenbot/node_modules/timebucket/node_modules/microtime/build' CXX(target) Release/obj.target/microtime/src/microtime.o SOLINK_MODULE(target) Release/obj.target/microtime.node COPY Release/microtime.node make: Leaving directory /home/ec2-user/zenbot/node_modules/timebucket/node_modules/microtime/build'

utf-8-validate@1.2.2 install /home/ec2-user/zenbot/node_modules/bitfinex-api-node/node_modules/ws/node_modules/utf-8-validate
node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
make: Entering directory /home/ec2-user/zenbot/node_modules/bitfinex-api-node/node_modules/ws/node_modules/utf-8-validate/build' CXX(target) Release/obj.target/validation/src/validation.o SOLINK_MODULE(target) Release/obj.target/validation.node COPY Release/validation.node make: Leaving directory /home/ec2-user/zenbot/node_modules/bitfinex-api-node/node_modules/ws/node_modules/utf-8-validate/build'

bufferutil@1.2.1 install /home/ec2-user/zenbot/node_modules/bitfinex-api-node/node_modules/ws/node_modules/bufferutil
node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
make: Entering directory /home/ec2-user/zenbot/node_modules/bitfinex-api-node/node_modules/ws/node_modules/bufferutil/build' CXX(target) Release/obj.target/bufferutil/src/bufferutil.o SOLINK_MODULE(target) Release/obj.target/bufferutil.node COPY Release/bufferutil.node make: Leaving directory /home/ec2-user/zenbot/node_modules/bitfinex-api-node/node_modules/ws/node_modules/bufferutil/build'
formatmicro@1.0.6 node_modules/formatmicro

micro-request@666.0.8 node_modules/micro-request

zero-fill@2.2.3 node_modules/zero-fill

object-get@2.1.0 node_modules/object-get

run-parallel-limit@1.0.3 node_modules/run-parallel-limit

run-parallel@1.1.6 node_modules/run-parallel

colors@1.1.2 node_modules/colors

ansi_up@1.3.0 node_modules/ansi_up

commander@2.9.0 node_modules/commander
└── graceful-readlink@1.0.1

multi-progress@2.0.0 node_modules/multi-progress
└── progress@1.1.8

sig@1.0.0 node_modules/sig
└── json-stable-stringify@0.0.1 (jsonify@0.0.0)

moment-timezone@0.5.11 node_modules/moment-timezone

os-monitor@1.0.5 node_modules/os-monitor
├── underscore@1.8.3
└── readable-stream@2.1.5 (buffer-shims@1.0.0, string_decoder@0.10.31, inherits@2.0.3, process-nextick-args@1.0.7, util-deprecate@1.0.2, core-util-is@1.0.2, isarray@1.0.0)

numbro@1.8.1 node_modules/numbro

axios@0.13.1 node_modules/axios
└── follow-redirects@0.0.7 (stream-consume@0.1.0, debug@2.6.3)

timebucket@0.3.4 node_modules/timebucket
└── microtime@2.1.1 (bindings@1.2.1, nan@2.3.5)

motley@2.2.8 node_modules/motley
├── pause@0.1.0
├── addr@1.0.1
├── href@0.1.1
├── run-series@1.1.4
├── formidable@1.1.1
├── expres@0.0.5
├── sosa_mem@1.0.1 (sosa@1.1.3)
├── qs@6.4.0
├── sosa_session@1.0.0 (cookie@0.2.4, idgen@2.0.2)
├── codemap@1.3.1 (debug@2.6.3)
└── middler@0.8.2 (bladerunner@0.1.3)

motley-mongo@2.0.5 node_modules/motley-mongo
├── sosa_mongo@1.0.3 (sosa@1.1.3)
└── mongodb@2.2.24 (es6-promise@3.2.1, readable-stream@2.1.5, mongodb-core@2.1.8)

motley-buffet@2.0.2 node_modules/motley-buffet
└── buffet@1.0.10 (accesslog@0.0.2, dish@1.0.7, middler@0.8.2, mayonnaise@0.3.3)

kraken-api@0.1.7 node_modules/kraken-api
├── querystring@0.2.0
└── request@2.81.0 (aws-sign2@0.6.0, oauth-sign@0.8.2, tunnel-agent@0.6.0, forever-agent@0.6.1, is-typedarray@1.0.0, caseless@0.12.0, stringstream@0.0.5, safe-buffer@5.0.1, aws4@1.6.0, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, performance-now@0.2.0, uuid@3.0.1, qs@6.4.0, combined-stream@1.0.5, mime-types@2.1.14, tough-cookie@2.3.2, form-data@2.1.2, hawk@3.1.3, http-signature@1.1.1, har-validator@4.2.1)

bitfinex-api-node@0.2.9 node_modules/bitfinex-api-node
├── debug@2.6.3 (ms@0.7.2)
├── ws@0.8.1 (options@0.0.6, ultron@1.0.2, utf-8-validate@1.2.2, bufferutil@1.2.1)
└── request@2.81.0 (aws-sign2@0.6.0, forever-agent@0.6.1, oauth-sign@0.8.2, tunnel-agent@0.6.0, is-typedarray@1.0.0, caseless@0.12.0, stringstream@0.0.5, safe-buffer@5.0.1, aws4@1.6.0, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, performance-now@0.2.0, uuid@3.0.1, qs@6.4.0, combined-stream@1.0.5, mime-types@2.1.14, tough-cookie@2.3.2, form-data@2.1.2, hawk@3.1.3, http-signature@1.1.1, har-validator@4.2.1)

twit@2.2.5 node_modules/twit
├── mime@1.3.4
├── bluebird@3.5.0
└── request@2.81.0 (aws-sign2@0.6.0, forever-agent@0.6.1, oauth-sign@0.8.2, tunnel-agent@0.6.0, is-typedarray@1.0.0, caseless@0.12.0, stringstream@0.0.5, safe-buffer@5.0.1, aws4@1.6.0, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, performance-now@0.2.0, uuid@3.0.1, qs@6.4.0, combined-stream@1.0.5, mime-types@2.1.14, tough-cookie@2.3.2, form-data@2.1.2, hawk@3.1.3, http-signature@1.1.1, har-validator@4.2.1)

coinbase-exchange@0.2.1 node_modules/coinbase-exchange
├── async@1.5.0
├── lodash.partial@3.0.0 (lodash._baseslice@3.0.3, lodash._replaceholders@3.0.0, lodash._createwrapper@3.2.0)
├── ws@1.1.0 (ultron@1.0.2)
├── num@0.2.1 (int@0.1.1)
├── lodash.foreach@3.0.0 (lodash._arrayeach@3.0.0, lodash.isarray@3.0.4, lodash._bindcallback@3.0.1, lodash._baseeach@3.0.4)
├── lodash.assign@3.0.0 (lodash._createassigner@3.1.1, lodash._baseassign@3.2.0)
├── bintrees@1.0.0
├── request@2.51.0 (tunnel-agent@0.4.3, aws-sign2@0.5.0, forever-agent@0.5.2, caseless@0.8.0, oauth-sign@0.5.0, stringstream@0.0.5, json-stringify-safe@5.0.1, mime-types@1.0.2, qs@2.3.3, node-uuid@1.4.7, tough-cookie@2.3.2, combined-stream@0.0.7, http-signature@0.10.1, form-data@0.2.0, bl@0.9.5, hawk@1.1.1)
└── nock@3.6.0 (propagate@0.3.1, json-stringify-safe@5.0.1, deep-equal@1.0.1, lodash@2.4.1, debug@2.6.3, mkdirp@0.5.1, chai@3.5.0)

motley-templ@2.0.4 node_modules/motley-templ
├── templ@1.4.3 (dish@1.0.7, mayonnaise@0.3.3)
└── handlebars@4.0.6 (async@1.5.2, source-map@0.4.4, optimist@0.6.1, uglify-js@2.8.12)

moment@2.17.1 node_modules/moment

zenbrain@1.0.0-alpha node_modules/zenbrain
├── run-series@1.1.4
└── numbro@1.8.1
[ec2-user@ip-10-0-0-6 zenbot]$ `

@nedievas
Copy link
Contributor

nedievas commented Mar 14, 2017

Linux gene.birt 4.9.13-200.fc25.x86_64 #1 SMP Mon Feb 27 16:48:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[bfxbot@gene zenbot]$ mongo --version
MongoDB shell version: 2.6.12
[bfxbot@gene zenbot]$ npm -v
3.10.10

@cloudwaves
Copy link

can you please PM me? we shall try in AWS? I don't have Virtual Box installed in my machine to install other linux versions rather then available in AWS (RHEL, SUSE, UBUNTU, AMAZON Linux)! (NOT ALLOWED IN OFFICE) :(

@cloudwaves
Copy link

Finally it got worked in Redhat Linux from AWS. Below steps are I have followed.

yum groupinstall -y 'Development Tools'
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
yum -y install nodejs
vi /etc/yum.repos.d/mongodb-org-3.0.rep (create repo for mongodb install)
[mongodb-org-3.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/
gpgcheck=0
enabled=1
exit
sudo yum install -y mongodb-org
sudo service mongod start
sudo chkconfig mongod on
git clone https://github.com/nedievas/zenbot.git
cd zenbot
cp config_sample.js config.js
vi config.js (modify your api destils to live trade)
npm install
npm link
./run.sh

@cloudwaves
Copy link

Live Graph has No Data :(

Also I just run to see the backtest
[root@ip-10-0-0-8 zenbot]# ./zenbot sim
03/14/2017 02:04:55 AM EDT [ launcher] cmd sim booting
{
"id": "e56db87358b7068e",
"ticks": 0,
"sim_end_timestamp": "03/08/2017 07:00:00 PM EDT",
"sim_start_bucket": "7d2450",
"sim_start_time": 1481760000000,
"sim_start_tick": "7d2450",
"sim_start_timestamp": "12/14/2016 07:00:00 PM EDT",
"end_us": 1489471495824345,
"last_us": 5723,
"last_duration": "5ms 723µs",
"sim_time": 0,
"sim_duration": "",
"input_hash": "97d170e1550eee4afc0af065b78cda302a97674c"
}
simulation result graph: http://10.0.0.8:3013/?sim_id=e56db87358b7068e&period=6h&limit=2000&selector=bitfinex.BTC-USD

Still the URL has No Data:(

@nedievas
Copy link
Contributor

nedievas commented Mar 14, 2017

That's because you have to backfill before backtesting.
Example for BTC-USD: ./zenbot launch map --backfill --config config.js --rs btc_usd
Example for all assets: ./zenbot launch map --backfill --config config_bitfinex_assets.js
At least keep backfilling BTC for 7 days to get full sim. For other assets you'll get informed when backfill is complete.

@cloudwaves
Copy link

I am not sure I am running it correctly to backfill!

Command
./zenbot launch map --backfill run --config config_btc_usd.js --rs btc_usd

03/14/2017 03:27:06 AM EDT [    bitfinex]    m24824607      11 trades. 03/14/2017 03:27:04 AM EDT  BUY         6.415 at     $1,225.80 BTC/USD
03/14/2017 03:27:16 AM EDT [    bitfinex]    m24824607   49999 trades. 03/14/2017 03:27:04 AM EDT  BUY     30670.073 at     $1,209.50 BTC/USD
03/14/2017 03:27:26 AM EDT [    bitfinex]    m24824607       2 trades. 03/14/2017 03:27:12 AM EDT  BUY         0.510 at     $1,225.50 BTC/USD
03/14/2017 03:27:35 AM EDT [    bitfinex]    m24824607   49999 trades. 03/14/2017 03:27:12 AM EDT  BUY     30670.083 at     $1,209.50 BTC/USD
03/14/2017 03:27:46 AM EDT [    bitfinex]    m24824607       4 trades. 03/14/2017 03:27:41 AM EDT  BUY         3.162 at     $1,225.50 BTC/USD
03/14/2017 03:27:55 AM EDT [    bitfinex]    m24824607   49999 trades. 03/14/2017 03:27:41 AM EDT  BUY     30673.235 at     $1,209.51 BTC/USD
03/14/2017 03:28:06 AM EDT [    bitfinex]    m24824607       2 trades. 03/14/2017 03:27:55 AM EDT  BUY         1.271 at     $1,225.50 BTC/USD
03/14/2017 03:28:15 AM EDT [    bitfinex]    m24824607   49999 trades. 03/14/2017 03:27:55 AM EDT  BUY     30674.006 at     $1,209.51 BTC/USD
03/14/2017 03:28:27 AM EDT [    bitfinex]    m24824608       3 trades. 03/14/2017 03:28:15 AM EDT  BUY         0.771 at     $1,225.57 BTC/USD
03/14/2017 03:28:34 AM EDT [    bitfinex]    m24824608   49999 trades. 03/14/2017 03:28:15 AM EDT  BUY     30674.006 at     $1,209.51 BTC/USD
03/14/2017 03:28:47 AM EDT [    bitfinex]    m24824608       7 trades. 03/14/2017 03:28:44 AM EDT  BUY         6.848 at     $1,225.49 BTC/USD
03/14/2017 03:28:52 AM EDT [    bitfinex]    m24824608   49999 trades. 03/14/2017 03:28:33 AM EDT  BUY     30672.685 at     $1,209.51 BTC/USD
03/14/2017 03:29:10 AM EDT [    bitfinex]    m24824608   49999 trades. 03/14/2017 03:28:44 AM EDT  BUY     30680.720 at     $1,209.52 BTC/USD
03/14/2017 03:29:18 AM EDT [    bitfinex]    m24824609       7 trades. 03/14/2017 03:29:09 AM EDT  BUY        10.035 at     $1,225.36 BTC/USD
03/14/2017 03:29:28 AM EDT [    bitfinex]    m24824609   49999 trades. 03/14/2017 03:29:09 AM EDT  BUY     30675.720 at     $1,209.52 BTC/USD
03/14/2017 03:29:38 AM EDT [    bitfinex]    m24824609       5 trades. 03/14/2017 03:29:28 AM EDT SELL         1.269 at     $1,225.32 BTC/USD
03/14/2017 03:29:47 AM EDT [    bitfinex]    m24824609   49999 trades. 03/14/2017 03:29:28 AM EDT  BUY     30675.720 at     $1,209.53 BTC/USD

with default bitfinex_logic.js was the trading profitable? how much BTC I need to run the trade ?

@carlos8f
Copy link
Contributor

Zenbot 4 is out, so I'm cleaning up 3.x issues. Please use and test 4, thanks!

gelotus pushed a commit to gelotus/zenbot that referenced this issue Jun 28, 2017
Implement working dir as variable editable in conf.
DeviaVir added a commit that referenced this issue Jul 28, 2017
node-gyp and node v8.x are not friends, stick to boron for now

Rename talib's MACD (#2)

* Rename talib's MACD so it doesn't overlap with original macd
supersabbath pushed a commit to supersabbath/zenbot that referenced this issue Oct 2, 2017
node-gyp and node v8.x are not friends, stick to boron for now

Rename talib's MACD (DeviaVir#2)

* Rename talib's MACD so it doesn't overlap with original macd
defkev added a commit to defkev/zenbot that referenced this issue Mar 24, 2018
With deposit set order would be below minimum with asset on hold
DeviaVir pushed a commit that referenced this issue Apr 23, 2018
* Completely rework --buy_max_amt

As much as i like the --buy_max_amt feature i was never a fan of how it was implemented, leave alone the naming being confusing at best as it simply doesn't just account for the amount the bot can buy but how much he is actually able to trade.

* Renames --buy_max_amt to --deposit for sake of clarification
* Using --buy_max_amt will still work but print a deprecated warning
* Instead of using --deposit to size buy orders use it to limit the balance available to the bot
* This allows us to use it together with --buy_pct
* --deposit will still account for asset held to calculate the available currency balance
* So if the asset held is covering --deposit the bot will have 0 currency (0% of currency balance) available, if not currency will be filled to the point it compensates for the difference (up to 100% of currency balance)
* If deposit is exceeding asset + currency the bot will also use 100% of currency balance held
* Deposit will be updated on each price change and new period to ensure the bot always only trades the amount as defined by --deposit
* Profit calculation will no longer go havoc as long as currency balance doesn't fall below whats currently deposited into the bot
* If enabled this will add two new columns to the output displaying the total currency balance (in green) as well as how much percentage (gray) of currency balance (0 - 100%) is currently used by the bot
* Works in Live, Paper & Sim mode

* Profit

* Fix profit calculation for stats and API
* Add deposit to Web GUI's capital row

* Profit starts at 100% on reset

* WebUI Print deposit only if enabled

* Add deposit to sim/exchange

* Less invasive profit fix

* Use deposit for profit/stats in sim if enabled

* Remove prev_trades dashboard sorting

* Restore prev_trades dashboard sorting

* Resolve upstream conflicts

* Update engine.test to match changes

As deposit no longer overrides buy_pct this is kinda expected...

* Update engine.test to match changes #2

With deposit set order would be below minimum with asset on hold

* Reset profit on deposit change
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants