hy nitrous!
what do you consider the best method to always get the last trade (every latest trade)?
i tried (python):
get the latest time
letztertid=str(int(time.time()*1000000));
fetch trades since that
x=req('BTCUSD/money/trades/fetch?since='+jetzt, {}, True)
take the latest trade from that result and repeat.
but its lagging 3-4 trades. if i try something like that
letztertid=str(int(time.time()*1000000-864000));
it shows one lates trade and then lags some trades and then shows another latest trade.
i also tried to start with time*1000000, take the tid of the latest trade and fetch all trades since that, but that doesnt return no data (i think on your website you describe this as beeing some kind of ddos protection).
what is the minimum x i can subtract from time?
thx!
I'm not quite sure what behaviour you're seeing...
Visiting BTCUSD/money/trades/fetch, the last few trades had the following tids:
1. 1389268906937622
2. 1389268907156855
3. 1389268907286795
4. 1389268919402914
5. 1389268919674069
Then going to fetch?since=1389268906937622, ie. the first one, gives:
2. 1389268907156855
3. 1389268907286795
4. 1389268919402914
5. 1389268919674069
6. 1389269081502565
7. 1389269099578993
8. 1389269100231335
9. 1389269128381212
It returned all trades after the tid I specified, as expected. If I subtract 1 (this should be the minimum you need to use for x) from tid#1, fetch?since=1389268906937621, then the results also include the first trade as well:
1. 1389268906937622
2. 1389268907156855
3. 1389268907286795
4. 1389268919402914
5. 1389268919674069
6. 1389269081502565
7. 1389269099578993
8. 1389269100231335
9. 1389269128381212
Also, you probably shouldn't use time.time() as it's very possible there won't be any trades that recent. On your first request, just call BTCUSD/money/trades/fetch instead, then start using the last trades from the last results set.
Anyway, I don't seem to be seeing your problem, all the results I got were exactly as I expected, what do you mean by lagging 3-4 trades?