joeldg / bowhead

PHP trading bot framework
Apache License 2.0
800 stars 288 forks source link

Bitfinex lag stoping stream #60

Closed vitoo closed 6 years ago

vitoo commented 6 years ago

In the getRecentData method we have

/** Check for missing periods **/
        if ($periodSize == '1m') {
           $variance = (int)75;
}

/// ...

if ((int)$periodcheck > (int)$variance) {
        echo 'YOU HAVE '.$validperiods.' PERIODS OF VALID PRICE DATA OUT OF '.$limit.'. '

If i echo $periodcheck :

periodcheck 70 periodcheck 67 periodcheck 30 periodcheck 69 periodcheck 88 <==== fail YOU HAVE 23 PERIODS OF VALID PRICE DATA OUT OF 55. Please ensure price sync is running and wait for additional data to be logged before trying again. Additionally you could use a smaller time period if available.

So bitfinex may lag sometime, and make the bot stop

I Will try bittrex maybe :cry:

vitoo commented 6 years ago

it's working on a 5 min range

dhensen commented 6 years ago

How are these variances calculated? Is this related to mathematical variance? I just wrote a poloniex websocket data importer... gonna issue a PR soon.

vitoo commented 6 years ago

Variance = in seconds

60 second + 15 second tolerance = 75 sec variance for 1 min range

dhensen commented 6 years ago

Oh now I see.. So it is just the period + 25% of the time. Is there some rationale behind the 25%?