Coinigy / api

Coinigy API Examples
162 stars 65 forks source link

Favorites Channel is bringing more than I have #20

Closed leordev closed 6 years ago

leordev commented 6 years ago

I have this code:

var subFavorites = SCsocket.subscribe("FAVORITES");
              console.log(">>> FAVORITES ", subFavorites);
              subFavorites.watch(function(data) {
                console.log("FAVORITES: ", data);
              });

And it's printing basically a bunch of exchanges and markets that I didn't bookmarked. Actually I have only two markets bookmarked... Is anyone having the same problem?

ByronAP commented 6 years ago

Subscribe to your private channel, the channel id is in your coinigy account settings -> Coinigy API -> Click to reveal my Private Channel ID (Websocket API)

leordev commented 6 years ago

@ByronAP thanks a lot for the above solution, it worked nicely.

image

Now, very similar to the same topic is that my favorite ticker is just bringing me the overall data and last price each minute.

It's okay but I still need two things: 1) The current bid and current ask.

2) To cut this time to at least every 20s.

The only solution that I'm thinking right now is to loop through all the favorites ticker and subscribe to the trade and order channels (ie.: TRADE-HITB--BCN--USD and ORDER-HITB--BCN--USD)

The TRADE channel is nice because it gives me real time experience:

But as you can see it does not have the current bid and current ask. So that's why I need to subscribe to ORDER channel which gives me 40 orders every 30 seconds.

So, do you have any other channel or option to TRADE channel that could give me the current bid and ask? Also, is my way of thinking right?

ByronAP commented 6 years ago

Not at the moment no, sorry