jaggedsoft / php-binance-api

PHP Binance API is an asynchronous PHP library for the Binance API designed to be easy to use. https://github.com/binance-exchange/php-binance-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get candle info from LAST 3 minutes not from this 3 minutes?

CoinStacker opened this issue · comments

Hey guys, I'm using code i found on an old issue post here to fetch volume/price information for a coin:

`$api = new Binance\API();

$ticks = $api->candlesticks($coin . "USDT", "3m");
$last_update = array_pop($ticks);
//print_r($last_update);
$volume = $last_update['volume'];`

and this is working great. I'm then running this on a cronjob every 3 minutes to see if the volume is 3% greater than the current average volume. Again all this code is executing fine but it's causing issues as it's fetching the information for the start of the brand new 3 minute candle that just rolled over rather than the completed information from the previous candle (if you see what i mean by that).

Is there a way to specifically get the data for the PREVIOUS 3 minute candle rather than the current one??