Bitcoin Forum
June 21, 2024, 03:53:14 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Other / Beginners & Help / Re: MtGox websocket API: I get ticker and depth messages, but no trade or lag on: May 02, 2013, 07:10:50 PM
Try changing ws into wss.
2  Economy / Marketplace / Re: [BETA] MTGox websocket API, testers wanted on: April 29, 2013, 12:04:02 PM
Thanks you both for your answers!
3  Economy / Trading Discussion / Re: MtGox API version 2: Unofficial Documentation on: April 29, 2013, 11:29:46 AM
Is it possible to withdraw USD from MtGox to an OKPAY account using the API? I can't seem to find the commands. However I can assign withdraw rights to an API key, or is that only for withdrawing BTC?
4  Economy / Marketplace / Re: [BETA] MTGox websocket API, testers wanted on: April 28, 2013, 09:02:40 PM
Are you talking about trades in other currencies or about all trades? Because I'm pretty sure that you have to update your depth tables when a trade message comes in as is explained here https://bitcointalk.org/index.php?topic=5855.msg1636817#msg1636817. I do that and it seems to be working fine. I only don't know what to do with trades in other currencies.

I'm already using the trick to use ticker messages to fix the tables when they appear to be broken, but that doesn't happen a lot.
5  Economy / Marketplace / Re: [BETA] MTGox websocket API, testers wanted on: April 28, 2013, 02:42:57 PM
I've downloaded the full bid / ask tables in USD with 'depth/full' and try to update them as depth and trade messages come in. From https://support.mtgox.com/entries/20800336-Multi-Currency-Trading I understand that the tables in USD also include the bids / asks in other currencies, that are converted to USD at the daily rate of the European Central Bank minus / plus a fee of 2.5 %.

How do I update my tables when a primary trade comes in with a price_currency other than USD?
6  Other / Beginners & Help / Re: MtGox websocket API: I get ticker and depth messages, but no trade or lag on: April 27, 2013, 08:53:33 AM
It seems to be working now. Now I also get trade and lag messages. Apparently it was something at MtGox's side.
7  Economy / Marketplace / Re: [BETA] MTGox websocket API, testers wanted on: April 27, 2013, 08:52:40 AM
To answer my own question above. It seems to be working now. Now I also get trade and lag messages. Apparently it was something at MtGox's side.
8  Other / Beginners & Help / Re: Websocket API: Unknown mtgox message type: op on: April 25, 2013, 04:12:32 PM
Try subscribing to "depth" ( or "ticker" or "trades" ). See https://en.bitcoin.it/wiki/MtGox/API/Streaming#mtgox.subscribe. I also find it difficult to understand why you have to subscribe and unsubscribe with different names.

9  Economy / Marketplace / Re: [BETA] MTGox websocket API, testers wanted on: April 22, 2013, 05:51:04 PM
I'm experimenting with the MtGox websocket API. I'm using Python with the websocket module from https://pypi.python.org/pypi/websocket-client. See example code below

Code:
import threading
import websocket
import json

class mtgox( threading.Thread ):

    def run( self ):
        websocket.enableTrace( True )
        url = 'ws://websocket.mtgox.com/mtgox?Currency=USD'
        self.socket = websocket.WebSocketApp( url, on_open = self.on_open )
        self.socket.run_forever( )

    def subscribe( self, channel ):
        output = { 'op': 'mtgox.subscribe', 'type': channel }
        output = json.dumps( output )
        self.socket.send( output )

    def on_open( self, socket ):
        self.subscribe( 'depth' )
        self.subscribe( 'lag' )        
        self.subscribe( 'ticker' )
        self.subscribe( 'trades' )

if __name__ == '__main__':
    mtgox = mtgox( )
    mtgox.start( )

When I run this code I receive ticker and depth messages, but no lag or trade messages. Also I do not get any replies to my mtgox.subscribe commands, that the documentation seems to promise. However when I send a mtgox.subscribe command with a wrong type parameter, I get an error message "Unknown mtgox message type", so it seems my subscribe commands are received and accepted.

Could somebody please tell me why I'm not receiving trade and lag messages?
10  Other / Beginners & Help / Re: Newbie restrictions on: April 20, 2013, 07:54:29 PM
5th post. Today I've spend many hours reading this forum before registering, and now I've got to read for 4 more, before I can post in the appropriate section. Oh well, there's plenty of interesting stuff here.
11  Other / Beginners & Help / Re: 420 on: April 20, 2013, 04:45:09 PM
I had to google this...
12  Other / Beginners & Help / Re: hello everyone on: April 20, 2013, 04:42:08 PM
hello world
13  Other / Beginners & Help / Re: Hello from newbie on: April 20, 2013, 04:35:51 PM
also abusing this thread to get a 2nd post...
14  Other / Beginners & Help / MtGox websocket API: I get ticker and depth messages, but no trade or lag on: April 20, 2013, 04:26:30 PM
I'm experimenting with the MtGox websocket API. This API is documented here https://en.bitcoin.it/wiki/MtGox/API/Streaming and discussed here https://bitcointalk.org/index.php?topic=5855.msg86219#msg86219. However since I'm a newbie I can't post my question there, so I have to ask it here. I'm using Python with the websocket module from https://pypi.python.org/pypi/websocket-client. See example code below

Code:
import threading
import websocket
import json

class mtgox( threading.Thread ):

    def run( self ):
        websocket.enableTrace( True )
        url = 'ws://websocket.mtgox.com/mtgox?Currency=USD'
        self.socket = websocket.WebSocketApp( url, on_open = self.on_open )
        self.socket.run_forever( )

    def subscribe( self, channel ):
        output = { 'op': 'mtgox.subscribe', 'type': channel }
        output = json.dumps( output )
        self.socket.send( output )

    def on_open( self, socket ):
        self.subscribe( 'depth' )
        self.subscribe( 'lag' )        
        self.subscribe( 'ticker' )
        self.subscribe( 'trades' )

if __name__ == '__main__':
    mtgox = mtgox( )
    mtgox.start( )

When I run this code I receive ticker and depth messages, but no lag or trade messages. Also I do not get any replies to my mtgox.subscribe commands, that the documentation seems to promise. However when I send a mtgox.subscribe command with a wrong type parameter, I get an error message "Unknown mtgox message type", so it seems my subscribe commands are received and accepted.

Could somebody please tell me why I'm not receiving trade and lag messages?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!