Show Posts
|
Pages: [1]
|
Try changing ws into wss.
|
|
|
Thanks you both for your answers!
|
|
|
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?
|
|
|
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.
|
|
|
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?
|
|
|
It seems to be working now. Now I also get trade and lag messages. Apparently it was something at MtGox's side.
|
|
|
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.
|
|
|
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 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?
|
|
|
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.
|
|
|
also abusing this thread to get a 2nd post...
|
|
|
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 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?
|
|
|
|