Comments (4)
Ok, scratch that. To answer my own question.
Backend actually does send the exchange event, it's just that there is a bug in tools/websocket_client. In line 183, instead of using WebsocketEventResponse type we should use WebsocketEvent type, cause in that case unmarshal actually works correctly. Before I send PR with a fix, can somebody confirm this?
Also, what's the best practice for timestamping ticker updates?
from gocryptotrader.
Hey @jsam, you are correct. If you wish to get exchange ticker/orderbook streamed using the websocket client, you'd want a WebsocketEvent type in for the loop. This way you'll get the exchange info. As for timestamping ticker updates, a solution would be to have a variable in the ticker.Price struct which has a time.Time var and is set to whenever a ticker item is created/updated.
from gocryptotrader.
Hey @jsam I'm already getting the exchange name from the ticker_update event.
So the message from the websocket is structured like:
{
data:any,
exchange:string,
error:any,
event:string
}
Or see my object here. I'm using the exchange property since its not contained within the data property
See here for where I map this object. It's what I use to render the selected exchange/currency here:
Timestamps are definitely missing though.
from gocryptotrader.
Thank you very much. I'll send a PR, after work.
from gocryptotrader.
Related Issues (20)
- Excuse me, are there some examples that can teach me how to use gocryptotrader to write a strategy in golang? HOT 1
- The startTime and endTime must be millisecond on Binance query deposit list. HOT 1
- could not find a copy of typescript to link HOT 1
- Binance websocket example
- Bug in Syncmanger does not allow for tickersync only. HOT 1
- any plan to support mexc? HOT 2
- Plase Help Me ... HOT 1
- Dispatcher tries to return used channels that are `<-chan interface{}` as `chan interface` and fails
- Buy/Sell/Ask/Bid actions do not have an expected outcome
- Bitstamp: depreciated balances *_usd _ fee
- Bitfinex: WS cancel stuck waiting for confirmation HOT 1
- Bitfinex: Switch WS type assertions
- pls add support commex.com HOT 3
- Request for supporting Upbit
- When set kline.interval to OneMonth, AddPaddings error
- database reconnection
- Error: ITBIT: pair config format is nil HOT 3
- Change leverage for Binance margin asset
- Bug in datahistorymanager HOT 4
- Bug in gateio_wrapper.go , it should be 'y' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocryptotrader.