DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.23k stars 2.03k forks source link

No Chart Data #133

Closed carlosgb55 closed 7 years ago

carlosgb55 commented 7 years ago

Hi, I'm trying to test zenbot, run zenbut with the default config and without key to the exchanges, but zenbot don't show any chart, even in the simulation. Is it something a missed? Maybe mongodb? I install the mongodb that shipped with ubuntu 16.04. Any help would be great. Thanks! zenbotnochart

cyzanfar commented 7 years ago

Same issue here

nibzo1 commented 7 years ago

did you back fill the data from your exchange, it took me some time to get it all working.

cyzanfar commented 7 years ago

I don't think so... Not sure how to do that can you guide me :) ?

cyzanfar commented 7 years ago

Do you need to fill in all the fields in config.js in order for it to display data ?

nibzo1 commented 7 years ago

Not all the fields, definitely your API key & secret. Im using Kraken exchange and it does not require a passphrase

Try running the following command. It will request data from the API of the exchange and store this in the mongodb datastore. You can then try this command, I believe this will load the data. Once this is complete you should see the data in the chart

./zenbot launch map --backfill

cyzanfar commented 7 years ago

Cool! I tried what you said , filled the passphrase api key and secret in config.js. Now when I run ./zenbot launch map --backfill

I get this error:

TypeError: Cannot read property 'indexOf' of undefined
    at /Users/cyrusghazanfar/Desktop/cryptocurrency/zenbot/utils/get_products.js:6:19
    at Array.filter (native)
    at get_products (/Users/cyrusghazanfar/Desktop/cryptocurrency/zenbot/utils/get_products.js:5:23)
    at mapper (/Users/cyrusghazanfar/Desktop/cryptocurrency/zenbot/plugins/gdax/backfiller.js:12:20)
    at /Users/cyrusghazanfar/Desktop/cryptocurrency/zenbot/node_modules/run-parallel/index.js:41:7
    at Array.forEach (native)
    at module.exports (/Users/cyrusghazanfar/Desktop/cryptocurrency/zenbot/node_modules/run-parallel/index.js:40:11)
    at mapper (/Users/cyrusghazanfar/Desktop/cryptocurrency/zenbot/node_modules/zenbrain/core/mapper/mapper.js:9:5)
    at Object.<anonymous> (/Users/cyrusghazanfar/Desktop/cryptocurrency/zenbot/node_modules/zenbrain/core/launcher/launcher.js:76:11)
    at Immediate.<anonymous> (/Users/cyrusghazanfar/Desktop/cryptocurrency/zenbot/node_modules/sosa/api.js:15:12)
05/10/2017 02:02:22 PM EDT [    launcher] cmd `map` exited with code 1, respawning now.
05/10/2017 02:02:23 PM EDT [    launcher] cmd `map` booting
/Users/cyrusghazanfar/Desktop/cryptocurrency/zenbot/utils/get_products.js:6
      if (c.assets.indexOf(product.asset) === -1) return false

Any idea what might be going wrong ?

nibzo1 commented 7 years ago

I think the you will probably be missing a couple of variables. try adding --config config_eth_btc.js to the command. You you will to need to change it for your currency and asset pairs you are using.

You could also add to your config.js file. Again change to suit you currency pair and exchange codes c.assets = [ "XETH" ] c.currencies = [ "ZEUR" ]

cyzanfar commented 7 years ago

Thanks it looks like the graph is working now. Do I need to wait until it has all the 91 days past data ? what to do next to visualize buy and sell positions of the algorithm ?

Here is how it looks so far:

screen shot 2017-05-10 at 2 30 52 pm
nibzo1 commented 7 years ago

Cool success!

The app should work without all data backfilled, but I believe you need need to have enough captured for the decision making to work correctly. I cant recall if this is config based or built in.

Also the app will mark the price wall with arrows for the buys and sells like the picture on this project home page. It works for me but I have issues with the buys not showing up when I restart the app. You may have better luck

You may have a slight config issue in one of the files files as the price tracker near the top left is ETH/BTC.

cyzanfar commented 7 years ago

Yeah I noticed that too... It's strange since the console is showing buy and sell positions but the graph isn't. Check this out:

screen shot 2017-05-10 at 2 59 50 pm

Also my config.js

var c = module.exports = require('./config_defaults')()

// mongo stuff
c.mongo_url = "mongodb://" + (process.env.MONGODB_PORT_27017_TCP_ADDR || "localhost") + ":27017/zenbrain" // change if your mongo server isn't local

c.mongo_username = null // normally not needed
c.mongo_password = null

c.gdax_key = 'hidden' // TO ENABLE BOT TRADING: set this to GDAX api key,
c.gdax_secret = 'hidden' // set this to GDAX api secret,
c.gdax_passphrase = 'hidden' // set this to GDAX api passphrase.
c.trade_log = true // log new trades as they come in.

// watch these exchanges
c.watch_exchanges = [
  //"bitfinex",
  "gdax",
  //"kraken",
  //"poloniex"
]

// selector for indicators, trading, etc
c.default_selector = "gdax.BTC-USD"

// add selectors in the format "{exchange-slug}.{asset}-{currency}" to graph them
c.graph_selectors = [
  c.default_selector,
  "gdax.ETH-BTC",
  "gdax.ETH-USD"
]

// trade logic
c.logic = require('./default_logic')

c.assets = [ "XETH" ]
c.currencies = [ "ZEUR" ]

Do you see something unusual ?

nibzo1 commented 7 years ago

c.assets = [ "XETH" ] c.currencies = [ "ZEUR" ]

Looks like your trying to use BTC? You added the variables I pointed you to earlier you but you need to set to the currency you wish to trade.

Change to this and it might work for you c.assets = [ "BTC" ] c.currencies = [ "USD" ]

cyzanfar commented 7 years ago

awesome that's done thanks. Still not seeing the buy and sell arrows on the graph. How can I simulate the default strategy ?

nibzo1 commented 7 years ago

./zenbot sim --verbose

this will run the trade sim and output a link at the end. once that is completed you can start the server and view the link. You should see arrows then.

./server.sh

The entries in the console are trades from the exchange. The bars on the chart is generated from these trades. The log will show when you logic triggers a buy you will see an order created, once this is confirmed by the exchange the arrow should appear on the chart.

Although this is the thought process from what I can see.

cyzanfar commented 7 years ago

Ugh hahaha I tried that also but seems like I don't have enough historical data ?

screen shot 2017-05-10 at 3 19 49 pm

Sorry for bothering you lol but the setup is a pain :/

nibzo1 commented 7 years ago

No worries, I've been through much of this setup fun recently although with Kraken exchange. Had to hack a few changes into default_logic.js

stevepm commented 7 years ago

I'm not getting any chart data either.

Steps:

  1. git clone https://github.com/carlos8f/zenbot.git
  2. cd zenbot
  3. npm install
  4. cp config_sample.js config.js
  5. ./run.sh
  6. Visit the url in the shell

I see it going through all of the steps as well as see my mongodb filling up with data

05/11/2017 12:52:59 PM PDT [        gdax]    m24908872     100 trades. 05/11/2017 12:52:54 PM PDT  BUY        63.242 at     $1,846.84 BTC/USD
05/11/2017 12:53:08 PM PDT [      trader] gdax.BTC-USD No trader API key provided. Starting in advisor mode. --Zen
05/11/2017 12:53:08 PM PDT [      trader] gdax.BTC-USD need more historical data, only have 0 of 26 5m ticks
05/11/2017 12:53:08 PM PDT [      trader] gdax.BTC-USD skipping historical tick zb:m24908872
05/11/2017 12:53:08 PM PDT [    reporter] 05/11/2017 12:52:00 PM PDT    m24908872      36 trades.                      RSI:n/a CLOSE:    $1,847.00 USD gdax.BTC-USD BAL:   $10,000.00 ROI:1.000
05/11/2017 12:53:19 PM PDT [        gdax]    m24908873       3 trades. 05/11/2017 12:53:11 PM PDT SELL         0.109 at     $1,846.34 BTC/USD
05/11/2017 12:53:33 PM PDT [     reducer] processing  11/ticks sec, thought queue: 0
05/11/2017 12:53:40 PM PDT [        gdax]    m24908873      16 trades. 05/11/2017 12:53:40 PM PDT  BUY        12.815 at     $1,846.98 BTC/USD
05/11/2017 12:54:04 PM PDT [      trader] gdax.BTC-USD need more historical data, only have 1 of 26 5m ticks
05/11/2017 12:54:04 PM PDT [      trader] gdax.BTC-USD skipping historical tick zb:m24908873
05/11/2017 12:54:04 PM PDT [    reporter] 05/11/2017 12:53:00 PM PDT    m24908873      16 trades.                      RSI:n/a CLOSE:    $1,847.00 USD gdax.BTC-USD BAL:   $10,000.00 ROI:1.000
05/11/2017 12:54:20 PM PDT [        gdax]    m24908874       2 trades. 05/11/2017 12:54:19 PM PDT  BUY         3.899 at     $1,846.92 BTC/USD
05/11/2017 12:54:40 PM PDT [        gdax]    m24908874      18 trades. 05/11/2017 12:54:34 PM PDT  BUY         4.161 at     $1,846.45 BTC/USD
05/11/2017 12:55:00 PM PDT [        gdax]    m24908874       7 trades. 05/11/2017 12:54:44 PM PDT  BUY         2.574 at     $1,846.98 BTC/USD
05/11/2017 12:55:04 PM PDT [      trader] gdax.BTC-USD need more historical data, only have 1 of 26 5m ticks
05/11/2017 12:55:04 PM PDT [    reporter] 05/11/2017 12:54:00 PM PDT    m24908874      18 trades.                      RSI:n/a CLOSE:    $1,846.84 USD gdax.BTC-USD BAL:    $9,997.32 ROI:1.000
05/11/2017 12:55:20 PM PDT [        gdax]    m24908875      10 trades. 05/11/2017 12:55:16 PM PDT  BUY         6.888 at     $1,846.99 BTC/USD
05/11/2017 12:55:41 PM PDT [        gdax]    m24908875      12 trades. 05/11/2017 12:55:36 PM PDT  BUY         4.041 at     $1,846.12 BTC/USD

Any ideas why I don't see any chart data?

nibzo1 commented 7 years ago

Between step 4 & 5 did you change config.js Based on what your saying sounds like it should work.

carlos8f commented 7 years ago

Cleaning up 3.x issues