zenbot
zenbot copied to clipboard
\templates\dashboard.ejs - exchange.name = gdax, but tradingview exchange id = coinbase
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.
probably a simple fix at the top of dashboard.ejs with something along the lines of if exchange.name = gdax, then exchange.name = coinbase.
confirmed and tested by replacing all instances of <%= exchange.name.toUpperCase() %>
with COINBASE
:
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:
after hitting F5:
...while we're here...there's a lot of dead space. any chance we might be able to do something more like...:
aaand another thing.
i was wondering why the time on the graph was so far off. looked at the code. sure nuff, hardcoded.
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. :)
the GDAX/Coinbase thing should be fixed. Leaving this issue open for the TZ.
I just pulled and I'm still getting an invalid symbol in the GUI. It's showing GDAX rather than COINBASE.
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.
@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.