What is the refresh interval of MtGox ticker API?

1

Unfortunately, the Mt. Gox API does not support JSONP nor CORS at the time of this writing. It seems like it would be easy enough for them to add JSONP support, so if they add it in the near future, this answer should help; until then, however, this answer does not help. The rest of this answer assumes now is the future and they support JSONP.

First of all, you'll want to change callback=showTick to callback=? so jQuery knows to put its autogenerated callback name there. Then when your callback is called, ticker will be a decoded JSON object, not a string, so you'll want to pull the information you want out of there. For example, to show the average price:

jQuery.getJSON('https://mtgox.com/api/1/BTCUSD/ticker?callback=?', function(data) { // We can't use .return because return is a JavaScript keyword. alert(data['return'].avg.display_short);...
0 0
2
...
0 0
3

Real time streaming data may be obtained over the streaming API, using Socket.io or the vanilla websocket

websocket channel list

List of the public streaming channels :

https://mtgox.com/api/2/stream/list_public

Connecting

Host: websocket.mtgox.com or socketio.mtgox.com Port: 80 or 443 ( ssl ) Namespace: /mtgox (Including beginning slash)

The following JavaScript code establishes a connection in the browser: https://socketio.mtgox.com/socket.io/socket.io.js">

var conn = io.connect('https://socketio.mtgox.com/mtgox'); conn.on('message', function(data) { // Handle incoming data object. });

the Currency parameter

use : websocket.mtgox.com:80/mtgox?Currency=EUR

and the websocket will give you updates in EUR currency

if you need need more than one currency, you can add currency symbols like that...

0 0
4

Elasticsearch is near-realtime, in the sense that when you index a document, you need to wait for the next refresh for that document to appear in a search. Refreshing is an expensive operation and that is why by default it’s made at a regular interval, instead of after each indexing operation. This interval is defined by the index.refresh_interval setting, which can go either in Elasticsearch’s configuration, or in each index’s settings. If you use both, index settings override the configuration. The default is 1s, so newly indexed documents will appear in searches after 1 second at most.

Because refreshing is expensive, one way to improve indexing throughput is by increasing refresh_interval. Less refreshing means less load, and more resources can go to the indexing threads. How does all this translate into performance? Below is what our benchmarks revealed when we looked at it through the SPM lens.

Please tweet about Elasticsearch refresh interval vs indexing...

0 0
5

WARNING! MtGox, which was the default exchange in the gadget, is no longer operational. Please download the new version of the gadget which has Bitstamp as default exchange (but of course you can choose to use any exchange with JSON API).

Do you ask yourself these questions?

How can I watch the bitcoin exchange rate? What amount of bitcoins have I mined, but not yet transferred to my wallet, and how much are they worth? How many bitcoins do I currently have, both unpaid in pools and in my wallet, and how much USD can I get for it? How many total bitcoins did I mine since I started mining? I don't mine, but how much is my investment in bitcoins worth in USD (or any other currency) at this moment?

MyBitcoins is a Windows gadget (Vista sidebar or Windows 7) which displays two values: the amount of bitcoins you have, and an estimated value of those bitcoins in your preferred currency.


Features

retrieves data from up to three bitcoin pools retrieves...
0 0
6

API Refresh

Please note the meaning of the terms used in this article:

Refresh intervals describes how often you send API calls to Betfair. The values are set using the API Refresh tab in the Settings Window. Durations describes the actual roundtrip time for a call to travel through the internet to Betfair and back to you (i.e. the roundtrip duration)

They are not the same thing!

This article will help you learn how to ensure that prices and bets travel as fast as possible and are updated with high frequency.

At the end of this article you will set the API Refresh rates as fast as you can. However, and this is important, if you set them too fast you might cause your internet connection to struggle and then the calls will take longer to reach Betfair – resulting in the opposite of what you want.

If you are in the UK then the default refresh intervals will probably work well without any adjustment needed.

If you are not in the UK, then I...

0 0
7

No, search requests are not blocked, because the warmup is done on the same refresh operation, it means that refreshes will lag to accommodate it.

On Wed, May 30, 2012 at 6:20 PM, Otis Gospodnetic

wrote:


OK, sounds like I did kind of get it after all, thanks Shay.

So it's about having 1 separate warming thread, probably continuously warming when indexing is continuous, which means one CPU core is going to be busy just doing that.

But this assumes segments are warmed faster than they are created, right?

If so, what happens when that is not the case?

Do search requests again block?

On Wednesday, May 30, 2012 4:41:52 AM UTC-4, kimchy wrote:

The warmup process will load the field data cache for the new segments to be searched on a different thread, and not block / cause the search requests to have to load it. I am not really sure what you don't understand... :), there is no way around loading the relevant data for new...
0 0
8

Ограничение на количество обращений на уровне приложения

Эти ограничения применяются к вызовам, выполненным с помощью любого маркера доступа, кроме маркеров доступа Страницы. При достижении этого ограничения приложение получает код ошибки 4.

Панель ограничения количества обращений

Просмотреть графики для действия по ограничению количества обращений в своем приложении вы можете в панели приложения.

Ограничения

Ограничения количества обращений применяются к каждому приложению. Инструмент ограничения количества обращений предоставляет информацию о том, насколько близко ваше приложение находится к состоянию регулирования. Нажмите любой пример, чтобы получить подробные сведения о типах использования.

Ваше приложение может совершать 200 вызовов в час в расчете на одного пользователя. Например, если у вашего приложения 100 пользователей, это означает, что оно может совершать 20 000 вызовов. Количество вызовов на одного конкретного пользователя...

0 0
9

A shortcut method for using addEventListener that makes it easier to specify an execution scope, have a listener only run once, associate arbitrary data with the listener, and remove the listener.

This method works by creating an anonymous wrapper function and subscribing it with addEventListener. The wrapper function is returned for use with removeEventListener (or off).

IMPORTANT: To remove a listener added with on, you must pass in the returned wrapper function as the listener, or use remove. Likewise, each time you call on a NEW wrapper function is subscribed, so multiple calls to on with the same params will create multiple listeners.

Example

var listener = myBtn.on("click", handleClick, null, false, {count:3}); function handleClick(evt, data) { data.count -= 1; console.log(this == myBtn); // true - scope defaults to the dispatcher if (data.count == 0) { alert("clicked 3 times!"); myBtn.off("click", listener); //...
0 0
10

Using Refresh Tokens

This is a simple example of how Refresh Tokens can be obtained and used. Using a simple CURL command as the client.

The OAuth2 token endpoint could be (/oauth/token), which handles issuing of all types of grants (access and refresh tokens).

Assuming there is a user ‘test‘ with password ‘test‘ and a client ‘testclient‘ with a client secret ‘secret‘, a sample request of a new Access Token/Refresh Token pair could be the following:

$ curl -X POST -H 'Authorization: Basic dGVzdGNsaWVudDpzZWNyZXQ=' -d 'grant_type=password&username=test&password=test' localhost:3000/oauth/token { "token_type":"bearer", "access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiVlx1MDAxNcKbwoNUwoonbFPCu8KhwrYiLCJpYXQiOjE0NDQyNjI1NDMsImV4cCI6MTQ0NDI2MjU2M30.MldruS1PvZaRZIJR4legQaauQ3_DYKxxP2rFnD37Ip4", "expires_in":20, "refresh_token":"fdb8fdbecf1d03ce5e6125c067733c0d51de209c" }

The authorization header contains the client id and secret...

0 0
11
...
0 0
12
# Run countries_list() to display the full list of countries # For the example Chile is "chl" and China is "chn" # Download trade between Chile and China # Years 2010-2015 (HS92 4 characters) # getdata_interval("chl", "chn", 2010, 2015) # getdata_interval("chl", "chn", 2010, 2015, 1, 1) # equivalent to last command # Download trade between Chile and China # Years 2010, 2012 and 2014 from OEC's API (HS92 4 characters) # getdata_interval("chl", "chn", 2010, 2015, 1, 2) # Download trade between Chile and China # Years 2010, 2012 and 2014 from OEC's API (SITC rev2 4 characters) # getdata_interval("chl", "chn", 2010, 2014, 2, 2) # Download trade between Chile and China # Years 2010, 2012 and 2014 from OEC's API (HS92 6 characters) # getdata_interval("chl", "chn", 2010, 2014, 3,...
0 0
13

Make sure to always use HTTPS when calling the API. Non-TLS HTTP requests cause error 403 to be returned. Using non-TLS requests can leak your authentication credentials.

Make sure that your client validates the server's SSL certificate. Many libraries (e.g. urllib2 in Python2) don't validate server certificates by default. Failing to verify the server certificate makes your application vulnerable to man-in-the-middle attack.

Timestamps are always represented as an integer number of milliseconds since the UTC Epoch (a Unix timestamp).

Prices and volumes are always represented as a decimal strings e.g. "123.3432". We use strings instead of floats to preserve the precision.

Parameters for POST calls are sent as URL-encoded forms (application/x-www-form-urlencoded).

Calls to the Market Data APIs are rate limited to 1 call per 10 seconds. All other API calls are rate limited to 1 call per...

0 0
14
...
0 0
15

Just for kicks, I decided to write a tradebot the other day, and thought it might be interesting for others to see just how simple it is to get a basic bot going. As a quick disclaimer, the bot that we end up with is the bot that I am running right now, but it probably cause you to lose all of your money. I am assuming that you have git installed, a working python installation, and a reasonably well funded mtgox account.

step 1 : download a good trading API

git clone https://github.com/viorels/mtgox-trader.git

This code is dead simple to use, and makes writing your bot take no time at all, so you can focus more on trading strategies rather than worrying about your POST variables getting to mtgox alright.

step 2 : move defaultsettings.py to settings.py and fill in credentials

step 3 : test out a hello world app

Create a file like hellomtgox.py, and put in these 4 lines of code

from settings import *
balance =...

0 0