Show Posts
|
Pages: [1] 2 »
|
Hi,
Anyone know where I can find a good Huobi price feed for the Bitcoin and OKCoin price feed for the litecoin?
Preferably in json-format, and if there is a real-time websocket for price / trade updating, all the better.
Thanks, Dirk
|
|
|
I am having an issue again with withdrawing BTC, withdrawed over 24 hours ago. Anyone else experiencing problems now?
|
|
|
Hi,
At Mtgox when trying to withdraw BTC I get a message:
Limit reached or not enough bitcoins in your account
I do have enough BTC in my account and I did not reach my limit. Anyone else experiencing such a problem?
Thanks for any insight.
|
|
|
$accessKey = "YOUR_ACCESS_KEY"; $secretKey = "YOUR_SECRET_KEY";
You replaced your key and secret I presume? Yeah :-).
|
|
|
Hi, For BTCChina I use the provided PHP code, but I always get a 401 Unauthorized error. Anyone know how to fix this problem? Thanks, Dirk --- This is the code: <?php function sign($method, $params = array()){ $accessKey = "YOUR_ACCESS_KEY"; $secretKey = "YOUR_SECRET_KEY"; $mt = explode(' ', microtime()); $ts = $mt[1] . substr($mt[0], 2, 6); $signature = http_build_query(array( 'tonce' => $ts, 'accesskey' => $accessKey, 'requestmethod' => 'post', 'id' => 1, 'method' => $method, 'params' => '', //implode(',', $params), )); var_dump($signature); $hash = hash_hmac('sha1', $signature, $secretKey); return array( 'ts' => $ts, 'hash' => $hash, 'auth' => base64_encode($accessKey.':'. $hash), ); } function request($method, $params){ $sign = sign($method, $params); $options = array( CURLOPT_HTTPHEADER => array( 'Authorization: Basic ' . $sign['auth'], 'Json-Rpc-Tonce: ' . $sign['ts'], ), ); $postData = json_encode(array( 'method' => $method, 'params' => $params, 'id' => 1, )); print($postData); $headers = array( 'Authorization: Basic ' . $sign['auth'], 'Json-Rpc-Tonce: ' . $sign['ts'], ); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; BTC China Trade Bot; '.php_uname('a').'; PHP/'.phpversion().')' ); curl_setopt($ch, CURLOPT_URL, 'https://api.btcchina.com/api_trade_v1.php'); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // run the query $res = curl_exec($ch); return $res; /**/ } try { var_dump(request('getAccountInfo', array())); } catch (Exception $e) { echo "Error:".$e->getMessage(); } ?>
|
|
|
Hi,
Lately I experience an unstable connection to the Mtgox websocket, sometimes it also takes very long before the server starts pushing messages (it does say it is connected fine though).
Is this a common problem, or might it be a problem with my connection?
Thanks,
Dirk
|
|
|
Hi, I use a PHP script to send requests to MtGox, but lately get a lot of empty data back on requests and have to try hundreds or thousands of times before I get actual data back after sending a request. Did anyone experience a similar problem, any idea how to resolve? The code is here, key and secret removed: <?php function mtgox_query($path, array $req = array()) { // API settings $key = ''; $secret = ''; // generate a nonce as microtime, with as-string handling to avoid problems with 32bits systems $mt = explode(' ', microtime()); $req['nonce'] = $mt[1].substr($mt[0], 2, 6); // generate the POST data string $post_data = http_build_query($req, '', '&'); $prefix = ''; if (substr($path, 0, 2) == '2/') { $prefix = substr($path, 2)."\0"; } // generate the extra headers $headers = array( 'Rest-Key: '.$key, 'Rest-Sign: '.base64_encode(hash_hmac('sha512', $prefix.$post_data, base64_decode($secret), true)), ); // our curl handle (initialize if required) static $ch = null; if (is_null($ch)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')'); } //curl_setopt($ch, CURLOPT_URL, ' https://data.mtgox.com/api/'.$path); curl_setopt($ch, CURLOPT_URL, ' https://23.67.8.44/api/'.$path); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // run the query $res = curl_exec($ch); if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch)); $dec = json_decode($res, true); if (!$dec) throw new Exception('Invalid data received, please make sure connection is working and requested API exists'); return $dec; print json_encode($dec); } ?> Thanks, Dirk.
|
|
|
Hi,
I get a lot of 500 internal server errors on the v2 Gox API, is this a common thing? Any suggested solutions?
Thanks, Dirk
|
|
|
Hi,
When I use the CancelOrder method in the trade API and send order_id: (actual order id) with it, I get this back:
error: "invalid parameter: order_id" success: 0
Doesn't make sense, because order_id seems to be the right parameter?
Anyone know how to go about this?
Thanks, Dirk
|
|
|
I think the nonce is not really tied to the time? You could just count it up at each request?
Possible, though I need to keep a database of the nonce value then, which I currently don't have :-).
|
|
|
Thanks, I ran into that I think, or it could be something else, it isn't working anymore.
I now use this, that should work for at least a while (if you have a better way I'd gladly hear so, but I think it is limited since you have only 10 digits and you want some accuracy on the milli or microsecond level, the best I can do probably is to add 110000000 to it):
$req['nonce'] = substr($mt[1],-7).substr($mt[0], 2, 3);
I get this error message back:
invalid nonce parameter; 0 8905540614
I don know why it gives a zero first, but the 8905540614 is the nonce I send. It's kinda weird, because it is 10 digits and it's ever-increasing (I reset the keys), so something else might still be causing it.
|
|
|
I am testing code for the BTC-E trading platform, however, it seems like it can only process one API request per second, if I do more it gives an invalid nonce parameter error back. It can only process one API request per unique nonce and your nonce is number of seconds since the Unix epoch, so you are changing your nonce only once per second. You are skipping the microseconds part of microtime() return. Please read: http://php.net/manual/en/function.microtime.php, or the quickest shortcut would be $req['nonce'] = (int) 10000*microtime(true); I already tried generating a more complex nonce, but it didn't work. Apparently it needs a nonce of exactly 10 numbers (this is mentioned nowhere however), which I now generate partly from the seconds and from the microseconds part: $mt = explode(' ', microtime()); $req['nonce'] = substr($mt[1],-4).substr($mt[0], 2, 6); Issue solved now, thanks for the reply.
|
|
|
Hi,
I am testing code for the BTC-E trading platform, however, it seems like it can only process one API request per second, if I do more it gives an invalid nonce parameter error back.
I use PHP, this is the code to generate the nonce:
$mt = explode(' ', microtime()); $req['nonce'] = $mt[1];
If I try a more complex nonce, like:
$req['nonce'] = $mt[1].substr($mt[0], 2, 6);
I also get an invalid nonce parameter error back.
Anyone ran into the same problem? How to solve it?
Thanks, Dirk
|
|
|
Thanks, that makes sense.
Does anyone know if there is something available (pref open source) that I can integrate easily in my own Javascript/HTML/PHP based trading system?
|
|
|
Hi,
I want to create an order management system; can someone with experience with the Websocket API as well as the HTTP API shortly tell the pros and cons of the two for inserting/deleting/updating/showing orders? I already (partly) wrote the logic to calculate which orders I wanted to insert and I am coding in a Javascript/HTML/PHP environment.
Is there a difference in reliability between the Websocket and HTTP API for inserting/deleting/updating/showing orders?
Thanks, Dirk.
|
|
|
What's a more reliable way to insert/cancel/update orders, through HTTP or through the websocket?
|
|
|
What about using AJAX, could that do the trick?
|
|
|
Thanks, had an initital peak into Goxtool, looks like I should be able to configure it in a the right way. Was it hard for you to make a program that works on multiple exchanges? Are you also able to adjust your price based on real time data of multiple exchanges?
|
|
|
Basically, what I'd like, is to be able to calculate a fair value of the bitcoin price based on
a.) real-time order book data b.) recent time and sales data c.) manual adjustments or additional algorithms based on historic data or future projections
Then, I would like to be able to put orders into the system in an efficient manner.
Preferably I also would like to have a graphical representation of the order book as well a graphical way to show which orders are mine. I'd also like to put orders in or cancel orders just by clicking on the graphical user interface.
If there is open source software available that does exactly that, or that I can relatively easily adjust to do just that, that would be best of course.
|
|
|
Java or python are the best for this project. I have built a trading bot. It is a great experience and a lot of hard work.
How long did it take you? Did you publish the software?
|
|
|
|