zelyony
Newbie
Offline
Activity: 23
Merit: 0
|
|
May 23, 2011, 05:02:07 PM Last edit: May 23, 2011, 09:48:45 PM by zelyony |
|
I prefer my suggestion of a request packet which the client can send at any time to request the complete depth state, and then relative +volume -volume stream continues from there.
good variant (1) but people dont want to calculate depth state. they often will request the one. more traffic, slow server, bad trading. variant (1.5) every depth message contains all state. without unnessary attrs - one number is price, next in pair is volume with right sort order: "depth":{"asks":[X.XXXX, V.VVV,...],"bids":[...]} another variant (2): - new channel for depth-20(or some N) values asks & bids every one minute (only for checking purpose or as starting point) - clear description of algorithm how calculate depth state over trade & depth channels one more variant (2.5): - depth values is absolute forever - new attr "pos" with values { +N, N, -N } where +N - new row inserted at N pos, rows [N..end] shifted down N - updates values ar row N -N - row N deleted. other rows shifted to close gap (to up) - "trade" values must match the changes in "depth" values (a priori) - but still need starting point - current depth state - use variant (2) or something pros: simple calcs, asks & bids always sorted by server(that must be), traffic +1attr, CPU calcs almost same(as now) "make your choice!" We need as many digits as people can specify, which as far as I know is an unlimited amount.
now: values with volume less 0.001 remains in my depth state after process depth & trades from corresponding channels. but next ticker does not account for their. so, I delete them from calculated depth state.
|
|
|
|
leepfrog
|
|
May 25, 2011, 05:52:36 PM |
|
This might be a stupid question but I dont fully understand the meaning of the ticker.php api. It returns something like that:
{"ticker":{"high":7.51,"low":7,"vol":33895,"buy":7.257,"sell":7.3499,"last":7.2591}}
What exactly is high and low? the rest seems pretty clear but I am not sure about those two
|
|
|
|
Clark
|
|
May 25, 2011, 06:03:12 PM |
|
The ticker high and low are probably those respective prices for the current trading session, which I'm guessing is a full day. You should watch the ticker values for when the volume resets to zero, as that would be the beginning of the trading session.
|
|
|
|
leepfrog
|
|
May 25, 2011, 06:12:55 PM |
|
Makes sense - I'll watch it. Thanks!
|
|
|
|
Clark
|
|
May 25, 2011, 08:14:04 PM |
|
I'm not sure it's been mentioned before, but the data type of the getDepth.php return does not seem to be application/json, so it is not possible to do a cross-domain call to MtGox for the depth of market data.
This would be a really easy and quick fix in the getDepth.php code...
|
|
|
|
robottwo
Newbie
Offline
Activity: 6
Merit: 0
|
|
June 07, 2011, 03:09:51 AM |
|
Hi, The websockets API is *great*. I have a suggestions for the protocol:
The size in the depth messages should publish the new absolute size, not the relative size. Subscribers can still figure out the relative size change by subtracting from the previous update at that size, but this provides better error recovery on the client side.
|
|
|
|
zelyony
Newbie
Offline
Activity: 23
Merit: 0
|
|
June 08, 2011, 03:15:33 PM Last edit: June 12, 2011, 11:33:27 AM by zelyony |
|
hint (from my bugs) see MSDN Math.Round( decimal d, int decimals ), which I use MtGox rounds numbers NOT SAME: If the value of the first digit in d to the right of the decimals decimal position is 5, the digit in the decimals position is rounded up if it is odd, or left unchanged if it is even. If the precision of d is less than decimals, d is returned unchanged. The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.
some datas: {"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe","depth":{"price":30.22425,"type":1,"volume":1},"op":"private","origin":"broadcast","private":"depth"} {"channel":"d5f06780-30a8-4a48-a2f8-7ed181b4a13f","op":"private","origin":"broadcast","private":"ticker","ticker":{"buy":30,"high":31.89,"last":30,"low":18.6,"sell":30.2243,"vol":98781}}
|
|
|
|
zelyony
Newbie
Offline
Activity: 23
Merit: 0
|
|
June 08, 2011, 05:03:45 PM |
|
There's a new MTGox websocket API. This API works by subscription to channels, and each channel is represented by an UUID.
Which min volume of order required for trading (min step size)? I saw volume=0.007 in depth channel, but ticker channel ignores that values (so values lessOrEqual 0.007 I ignore)
|
|
|
|
jaybny
|
|
June 10, 2011, 06:06:16 PM |
|
is websockets down? any ETA?
thanks
|
|
|
|
af12345
Newbie
Offline
Activity: 1
Merit: 0
|
|
June 11, 2011, 02:45:56 PM |
|
I think the API shows a lot of promise, but it's seems to be missing one key detail --- without publishing an order-id on the depth message, and the constituent order-ids on the trade message, it's not really possible to ever get in sync.
The reason is as follows: if you start your connection and receive an order @ 25 for volume 10, and then there is a trade @ 25 for volume 5, you can't tell if the trade was for part of the order you just received, or an earlier order (pre your connection time).
If, however, you were to provide an order-id on the depth message, and the pair of order ids on the trades, then all ambiguity is removed.
|
|
|
|
Clark
|
|
June 11, 2011, 03:27:26 PM |
|
Here are some things I've noticed after building some web applications using the WebScokets API: - Switching to the Secure WebSocket (wss://) would dramatically improve compatibility, especially for those behind a proxy
- Security would also allow users to send trades via the WebSocket, which would simplify trading to one connection instead of polling+WS.
- Send the prices and volumes as integers! Bitcoins are stored as integers in the client but displayed as floats by dividing by 1e8. Some of the prices and volumes quoted over the WebSocket are floating point numbers with much more precision than the 8th decimal, which doesn't make sense in the framework of Bitcoin overall.
- The ability to request the depth of market table entries through the WS
- More consistency in depth of market updates - I have to poll the data every so often in order to eliminate discrepancies, which is not very robust and could be misleading to people using my service.
|
|
|
|
zelyony
Newbie
Offline
Activity: 23
Merit: 0
|
|
June 12, 2011, 05:27:35 PM |
|
it will be good create IRC-channel - for talks
- for "websockets OFF for hour"
- for bans in websockets (if exists)
at now opened socket, sent handshake, received nothing - conn reset by peer and I dont know what happened and how long it will last
|
|
|
|
kseistrup
|
|
June 12, 2011, 05:30:14 PM |
|
- Switching to the Secure WebSocket (wss://) would dramatically improve compatibility, especially for those behind a proxy
- …
+1 for wss:// Cheers,
|
Klaus Alexander Seistrup
|
|
|
matt.collier
Member
Offline
Activity: 105
Merit: 10
|
|
June 12, 2011, 10:32:56 PM |
|
Hello all, developing in Java here. Aiming at creating an interface similar to Trade Station's Matrix: http://www.tradestation.com/strategy_testing/market_depth.shtmI'm using Open Office Calc as the front end. I've got the real-time data flowing into calc nicely, but I've run into the same sync issues everyone else is having. As others have done, I'm bootstrapping my depth info with http://mtgox.com/code/data/getDepth.php, but before long, none of the volume information makes any sense. I'll be happy to share my source with any interested parties. For now I'm going to put this on the back burner until a solution to the sync issue has been implemented. I'll put my vote in for a channel that publishes absolute volume information in addition to some effective bootstrapping method.
|
|
|
|
bitoption
Newbie
Offline
Activity: 56
Merit: 0
|
|
June 13, 2011, 05:17:55 AM |
|
I'm getting deafening silence from my python websockets client today. This is sad, since I use it to give pricing cues on bitoption.org; I've noticed some websockets-gox stuff is working right now, some is not.
Any indications as to what's what and why?
|
|
|
|
Clark
|
|
June 13, 2011, 05:39:32 AM |
|
It would be nice to hear from MagicalTux about the progress of the back end rewrite and deployment. Also, a formal documentation of the WebSockets API is most welcome.
I'm still seeing the feed at the moment, but it stopped a little earlier today. Very odd.
|
|
|
|
netxshare
|
|
June 13, 2011, 06:24:58 AM |
|
I am also having issues, my current connection to the websocket is showing data but any new connectionss fail to get anything more then a response header.
|
donations: 1CWddfhXagPoWgzUCs7oVHFjwBmqbAoJRr
|
|
|
zelyony
Newbie
Offline
Activity: 23
Merit: 0
|
|
June 13, 2011, 07:24:25 AM Last edit: June 14, 2011, 08:36:22 PM by zelyony |
|
found site with fast check websockets (and wss too) http://websocket.org/echo.htmlbrowser must support websockets (or enabled it) for now MtGox-WebSockets requires Sec-WebSocket-Key1 and Sec-WebSocket-Key2 and 8bytes-data at now (UTC 19:27 13-jun) WS dont responds with 16bytes of hash and at now (UTC 20:37 13-jun) no connection at now (UTC 20:35 14-jun) System.Net.Sockets.SocketException: Connection refused
|
|
|
|
molecular
Donator
Legendary
Offline
Activity: 2772
Merit: 1019
|
|
June 13, 2011, 07:55:22 PM |
|
I'm getting deafening silence from my python websockets client today. This is sad, since I use it to give pricing cues on bitoption.org; I've noticed some websockets-gox stuff is working right now, some is not.
Any indications as to what's what and why?
There have been 2 periods where no trades happened and the websocket was dead, apparently some mysql troubles. Maybe you stumbled into one of these.
|
PGP key molecular F9B70769 fingerprint 9CDD C0D3 20F8 279F 6BE0 3F39 FC49 2362 F9B7 0769
|
|
|
|
|