Author

Topic: Re: Discussion for MtGox trade data downloader (Read 401 times)

newbie
Activity: 13
Merit: 0
August 26, 2013, 06:03:11 PM
#1
this is some comment to following post https://bitcointalksearch.org/topic/m.2945085

unfortunately I am only allowed to post in the newbie secton right now - however :

nitrous posted :
Quote
For other less popular currencies, however, I have found that there are many gaps, some quite long, and so without regular bq updates this is liable to break a script. Of course if you have an up to date database and can run your script regularly, at least once per day, this will not be a problem as you will catch all trades as they come in. Alternatively, you could manually advance the last_id if you haven't caught up to the current time yet, but you need to confirm the limit is indeed 86400s first.

The (very good and appreciated) "Unofficial Documentation for MtGox's HTTP API v2" has some glitches in the description for the API function money/trades/fetch :

(see https://bitbucket.org/nitrous/mtgox-api#markdown-header-moneytradesfetch)

there are not really "gaps" (except the one big gap for USD when they switch from a counter to microtimestamp)

the mtGox API function money/trades/fetch simply works as follows :

- it will return maximum 1000 records if a microtimestamp is transfered as parameter.
- and it will return maximum the trades that happend 86400 seconds after the given microtimestamp

if You dont pass a microtimestamp to the function You will receive the tradedate for a given currencypair within the last 86400 seconds (24 hours).
In that case the "1000 record" limit does not apply.

If no trades happened within the timespan of 86400 seconds for a given currencypair, You will not get back any datarows - what will only happen for some rarely traded currencypairs

so - if there were simply no trades within 24 hours, You will not receive any datarows back.
In that case You will need to add 86400 seconds to the timestamp (respectively 86400 * 1E6 microseconds) and query again for the next day.

As nitrox pointed out in some other posts, I would not recommend that every user should download the full trade history from mtgox because of serverload issues, etc ...

however - since the bq database is not updated until now, I will provide the full dumps until up-to-date in the next couple of days. (what will be updated daily or hourly - I wait for user requests on that issue)

I would love to post that on the forum that matters, not just in that newbie ......
Jump to: