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

no tradebot with Kraken #1176

Closed
Kirbylix opened this issue Oct 3, 2017 · 22 comments
Closed

no tradebot with Kraken #1176

Kirbylix opened this issue Oct 3, 2017 · 22 comments

Comments

@Kirbylix
Copy link

Kirbylix commented Oct 3, 2017

Note: for support questions, please join our Discord server

  • I'm submitting a ...
    [X ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository

  • Action taken (what you did)
    Start a new live Gekko -> Tradebot -> @kraken EUR/XBT -> MACD

  • Expected result (what you hoped would happen)
    a Tradebot would start

  • Actual result (unexpected outcome)
    a market guardian was launched, which hangs in the state of loading + Dub Cannot read property 'toLowerCase' of undefined #1090

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)
    Using Gekko v0.5.2 and Gekko UI v0.2.0.
    i use the current sample-config.js
    Browser Console Log:
    Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
    at Oe.e.$emit (build.js:6)
    at a.s.onmessage (build.js:6)
    at HTMLDivElement. (reconnecting-websocket.min.js:2)
    at WebSocket.h.onmessage (reconnecting-websocket.min.js:2)

Uncaught TypeError: Cannot read property 'start' of undefined
at s.gekkoConfig (build.js:16)
at Ri.get (build.js:6)
at Ri.evaluate (build.js:6)
at s.gekkoConfig (build.js:6)
at startGekko (build.js:16)
at s.n [as startGekko] (build.js:6)
at start (build.js:16)
at Proxy.n (build.js:6)
at click (build.js:16)
at HTMLAnchorElement.e (build.js:6)

@cmroche
Copy link
Contributor

cmroche commented Oct 3, 2017

This is related to my change, ill look at it tonight.

@Kirbylix
Copy link
Author

Kirbylix commented Oct 3, 2017

by the way, I ran a PaperTrader via console with the same settings as on top, and get the following error message:
(ERROR): error getting trades Error: Service:Unavailable at /home/pi/gekko/node_modules/kraken-api-es5/index.js:59:13 at Generator.next (<anonymous>) at step (/home/pi/gekko/node_modules/kraken-api-es5/index.js:1:253) at /home/pi/gekko/node_modules/kraken-api-es5/index.js:1:423 at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)

and

(ERROR): error getting trades Error: API:Rate limit exceeded at /home/pi/gekko/node_modules/kraken-api-es5/index.js:59:13 at Generator.next (<anonymous>) at step (/home/pi/gekko/node_modules/kraken-api-es5/index.js:1:253) at /home/pi/gekko/node_modules/kraken-api-es5/index.js:1:423 at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)

@cmroche
Copy link
Contributor

cmroche commented Oct 3, 2017

These are not likely related to any changes, but instead that krakens API is notoriously unreliable in recent times.

@cmroche
Copy link
Contributor

cmroche commented Oct 3, 2017

@Kirbylix After looking at the issue, actually I no longer think this is related to my changes to the kraken exchange. Instead the cause looks to be the config of fees

#1173
#1090

@Kirbylix
Copy link
Author

Kirbylix commented Oct 4, 2017

when i click on the "Start" Button, i get this:
Uncaught TypeError: Cannot read property 'start' of undefined at s.gekkoConfig (build.js:16) at Ri.get (build.js:6) at Ri.evaluate (build.js:6) at s.gekkoConfig (build.js:6) at startGekko (build.js:16) at s.n [as startGekko] (build.js:6) at start (build.js:16) at Proxy.n (build.js:6) at click (build.js:16) at HTMLAnchorElement.e (build.js:6)

@pprados
Copy link

pprados commented Oct 5, 2017

Hi,
After download the last stable branch, I try to run 'node gekko/gekko.js --config sample-config.js'
I can receive a trace when the code call MACD.update() and MACD.check().
But, If i change the config.watch in sample-config.js:
exchange: 'poloniex', currency: 'USDT', asset: 'BTC',
changed to
exchange: 'kraken', currency: 'EUR', asset: 'XBT',
The methods update() or check() was not called.

I try with UI interface, it's the same.

@Kirbylix
Copy link
Author

Kirbylix commented Oct 6, 2017

and another error with kraken:
error getting trades { HTTPError: Response code 522 (undefined) at stream.catch.then.data (/home/pi/gekko/node_modules/got/index.js:182:13) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) name: 'HTTPError', host: 'api.kraken.com', hostname: 'api.kraken.com', method: 'POST', path: '/0/public/Trades', protocol: 'https:', url: 'https://api.kraken.com/0/public/Trades', statusCode: 522, statusMessage: undefined, headers: { date: 'Thu, 05 Oct 2017 16:42:19 GMT', 'content-type': 'text/html; charset=UTF-8', 'transfer-encoding': 'chunked', connection: 'close', 'set-cookie': [ '__cfduid=d819f08b00a98b9fe3192141bf021688d1507221724; expires=Fri, 05-Oct-18 16:42:04 GMT; path=/; domain=.kraken.com; HttpOnly' ], expires: 'Thu, 01 Jan 1970 00:00:01 GMT', 'cache-control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', pragma: 'no-cache', 'x-frame-options': 'SAMEORIGIN', server: 'cloudflare-nginx', 'cf-ray': '3a91d4ff0b0d1ab7-DUS' } }

@cmroche
Copy link
Contributor

cmroche commented Oct 6, 2017

@Kirbylix that error means that cloud flare was unable to connect to kraken, again this is a problem with their API not being reliable, there won’t be much we can do for this aside from maybe reformatting the error message to look nicer.

@Kirbylix
Copy link
Author

Kirbylix commented Oct 6, 2017

thanks for the info.
my current problem is that I have been running the bot for 4 days now (paper trader to see how it reacts). On Kraken I see the signals, but the bot doesn't say... neither in the console...

Config:
watch: kraken EUR-XBT
tradingAdvisor = true / MACD
paperTrader = true
performanceAnalyzer = true
trader = false
adviceLogger = true
candleWriter = false
adviceWriter = false

or did I do something wrong anyway?

@cmroche
Copy link
Contributor

cmroche commented Oct 6, 2017

A changé was merged into develop late last week to fix a problem with paper trading and live trading not generating signals. Which branch are you using and when did you last pull?

@Kirbylix
Copy link
Author

Kirbylix commented Oct 6, 2017

i have:
git clone git://github.com/askmike/gekko.git
=> master branche (stable)
the last pull was today

@cmroche
Copy link
Contributor

cmroche commented Oct 6, 2017

The fix is not yet merged into stable.

@Kirbylix
Copy link
Author

Kirbylix commented Oct 6, 2017

then i will try the develop branch, thx

@eZ3KIEL29
Copy link

same issue:
Gekko version: v0.5.8
Nodejs version: v8.6.0
sqlite 3.16.2

after a real buy or sell, i have this error.

Trader Received advice to go long. Buying ETH
(INFO): Attempting to BUY XXX ETH at kraken price: 264.24000
(ERROR): no data

@eZ3KIEL29
Copy link

i have also import the newest kraken.js into gekko/exchanges from dev branch to solve a problem to get data from kraken.

@cmroche
Copy link
Contributor

cmroche commented Oct 10, 2017

#1192 increases time to retry commands ads improvements to logging of no data error. This might fix the problem if you are hitting the Kraken API rate limit on retries.

@Kirbylix
Copy link
Author

Kirbylix commented Oct 10, 2017

I got another ERROR:
(ERROR): Wanted to buy XBT but the amount is too small (0.024030249022) at kraken
what is the minimum value?

According to kraken, their minimum is 0.002 BTC
Kraken

@Kirbylix
Copy link
Author

All right, I've been running the tradebot for almost five days now. I have received messages via telegram for trades. But the bot didn't buy or sell anything in time...

could someone please upload a working config. js for a tradebot?

@cmroche
Copy link
Contributor

cmroche commented Oct 19, 2017

@Kirbylix There have been a few bug fixed merged to kraken, one of which deals with precision issues in orders which was merged yesterday. Please grab the latest code on the develop branch and try again, if you continue to get new errors post them here.

@Kirbylix
Copy link
Author

I pulled the develop branch.
if there are any errors, I'll let you know.

@metodi-yanev
Copy link

metodi-yanev commented Oct 20, 2017

Hey folks, i've tried the bot with the latest changes, and it still enters a 'no data' - retry loop. What's changed is that it logs the error from the 'getPortfolio' method - 'no data (getPorfolio)'. Actually when i start new live gekko it starts with the same error Kraken did not return portfolio for XBT, assuming 0.. Any ideas? (Command line user)

xerix32 added a commit to xerix32/gekko that referenced this issue Oct 20, 2017
@xerix32
Copy link
Contributor

xerix32 commented Oct 20, 2017

I've found the issue (work for me) introduced with "roundAmount" and new kraken precision (in kraken.js exchange).

Try to change
- var market = this.getCapabilities().markets.find(function(market){ return market.pair[0] === this.currency && market.pair[1] === this.asset });

with

 +  var parent = this;
 +  var market = Trader.getCapabilities().markets.find(function(market){ return market.pair[0] === parent.currency && market.pair[1] === parent.asset });

and try if works for you.

The message "no data" was misleading, and overwrite the true problem (variable scope error), I added more "talking" debug info :
+ log.debug('[kraken.js] entering "setBalance" callback after kraken-api call, err:', err, ' data:' , data);
before overwriting
err = "no data";
that helps me "digging the bug".

I "commited" a pull request
pull request

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

6 participants