Bitcoin Forum
June 28, 2024, 12:25:24 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help with Bitstamp API  (Read 917 times)
hail (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
February 25, 2014, 12:48:11 PM
 #1

i found bitstamp live trade stream api in this forum post,

my code:

Code:
var pusher = new Pusher('de504dc5763aeef9ff52');

var trades_channel = pusher.subscribe('live_trades');
trades_channel.bind('trade',  function(data) {
   console.debug(data);

and it is works,
it returns trade data like this:

Code:
amount: 0.30628
id: 3764896
price: 492.23


but it didn't return trade type. how to get?
spin
Sr. Member
****
Offline Offline

Activity: 362
Merit: 261


View Profile
February 25, 2014, 02:32:45 PM
 #2

Never used this but doesn't a trade go both ways.  It is both an ask and a bid?

If you liked this post buy me a beer.  Beers are quite cheap where I live!
bc1q707guwp9pc73r08jw23lvecpywtazjjk399daa
hail (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
February 25, 2014, 03:27:19 PM
 #3

just want know the trade is bid or ask.
spin
Sr. Member
****
Offline Offline

Activity: 362
Merit: 261


View Profile
February 25, 2014, 03:49:57 PM
 #4

That's my point.  I'm assuming this feed gives you executed trades?  If so each trade is matching of a bid and ask at a volume and price.  So it's both, or am I misinterpreting something?

If you liked this post buy me a beer.  Beers are quite cheap where I live!
bc1q707guwp9pc73r08jw23lvecpywtazjjk399daa
hail (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
February 25, 2014, 04:54:06 PM
 #5

don't troll!!!!


if someone buy bitcoin at given price, then the trade type is bid!!! otherwise ask!


spin
Sr. Member
****
Offline Offline

Activity: 362
Merit: 261


View Profile
February 25, 2014, 09:24:00 PM
 #6

If someone bought at a price then someone else sold at the same price.  Bitstamp matches buy and sell orders to create trades.  Thus each trade consists of a matched buy and sell order (or parts thereof).  Thus your trade doesn't tell you if it was a bid or ask because it's a matched pair.

I won't post again because you ask for help yet you won't take it when it's given...

If you liked this post buy me a beer.  Beers are quite cheap where I live!
bc1q707guwp9pc73r08jw23lvecpywtazjjk399daa
hail (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
February 26, 2014, 05:57:01 AM
 #7

If someone bought at a price then someone else sold at the same price.  Bitstamp matches buy and sell orders to create trades.  Thus each trade consists of a matched buy and sell order (or parts thereof).  Thus your trade doesn't tell you if it was a bid or ask because it's a matched pair.

I won't post again because you ask for help yet you won't take it when it's given...
it is different because the sequence, someone first place an order, then someone buy from the order list,it is called a bid.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!