Skip to content

Stable Release

Compare
Choose a tag to compare
@jaggedsoft jaggedsoft released this 10 Apr 21:20
· 283 commits to master since this release
0b7d96b

Added WebSocket kline function:

Get latest candlestick data only

$api->kline(["BTCUSDT", "EOSBTC"], "5m", function($api, $symbol, $chart) {
  //echo "{$symbol} ({$interval}) candlestick update\n";
	$interval = $chart->i;
	$tick = $chart->t;
	$open = $chart->o;
	$high = $chart->h;
	$low = $chart->l;
	$close = $chart->c;
	$volume = $chart->q; // +trades buyVolume assetVolume makerVolume
	echo "{$symbol} price: {$close}\t volume: {$volume}\n";
});

Add miniTicker() WebSocket example:

miniTicker return the latest candlestick information for every symbol

$api->miniTicker(function($api, $ticker) {
	print_r($ticker);
});
View Response
    [18] => Array
        (
            [symbol] => ONTBNB
            [close] => 0.37649000
            [open] => 0.30241000
            [high] => 0.38112000
            [low] => 0.29300000
            [volume] => 975240.72000000
            [quoteVolume] => 326908.77744250
            [eventTime] => 1523395389582
        )

    [19] => Array
        (
            [symbol] => WANBTC
            [close] => 0.00063657
            [open] => 0.00054151
            [high] => 0.00063900
            [low] => 0.00053900
            [volume] => 4443618.00000000
            [quoteVolume] => 2637.76413131
            [eventTime] => 1523395389551
        )