DeviaVir / zenbot

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

\templates\dashboard.ejs - exchange.name = gdax, but tradingview exchange id = coinbase #1049

Open shr00mie opened 6 years ago

shr00mie commented 6 years ago

just got around to taking a peek at the newly implemented dashboard. lookin' good for a first pass. and me being the lucky one, already found a bug.

as far as zenbot is concerned, the exchange.name for coinbase/gdax, is the latter. so the dashboard is trying to call gdax:coincurrency from tradingview.com. problem is, on tradingview.com, it's not gdax, but coinbase, so the call would have to be coinbase:coincurrency. image

probably a simple fix at the top of dashboard.ejs with something along the lines of if exchange.name = gdax, then exchange.name = coinbase.

image

confirmed and tested by replacing all instances of <%= exchange.name.toUpperCase() %> with COINBASE: image

i'm sure there's a more elegant solution which i'll leave in the hands of the more experienced.

looks like doing what i did is causing some sort of referencial error from i think it was...\stats\index.html. i'll see if i can catch it when it happens next time. doesn't appear to crash zenbot, and it probably won't happen once the aforementioned code to replace gdax with coinbase is done.

i played around with the default ranges and technicals a bit. after manually refreshing the page, i noticed that the custom timeframes remained, but the technicals were reset. is this something we can preserve with cookies?

Example - technicals selected and applied: image

after hitting F5: image

...while we're here...there's a lot of dead space. any chance we might be able to do something more like...: image

aaand another thing. i was wondering why the time on the graph was so far off. looked at the code. sure nuff, hardcoded. image

might i suggest using something like THIS to implement something like var tzName = jstz.determine().name(); to pull TZ from browser?

actually. one more thing. i noticed that after the bot made a purchase, i had to manually refresh the page for it to register. would be nice if the thing refreshed that data on its own and maybe even made a noise/notification when an event like that happened. :)

DeviaVir commented 6 years ago

the GDAX/Coinbase thing should be fixed. Leaving this issue open for the TZ.

SlackerATX commented 6 years ago

I just pulled and I'm still getting an invalid symbol in the GUI. It's showing GDAX rather than COINBASE.

ziad00 commented 6 years ago

Modified the symbol line in the TradingView.widget to this: "symbol": "<%if (exchange.name.toUpperCase() == "GDAX") {%>COINBASE<%} else {%><%= exchange.name.toUpperCase() %><%}%>:<%= asset.toUpperCase() %><%= currency.toUpperCase() %>",

It works for me now but unsure if I created other bugs on the way.

shr00mie commented 6 years ago

@ziad00, from what i could tell, that was the only consequential reference as that's what TV requires for the correct feed. looking forward to testing the PR.