Skip to content

Commit 60b7074

Browse files
author
Jon Eyrick
authored
Add limit to chart function
1 parent 0a225ba commit 60b7074

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

php-binance-api.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,10 +1879,11 @@ public function ticker($symbol, callable $callback)
18791879
* @param $symbols string required symbols
18801880
* @param $interval string time inteval
18811881
* @param $callback callable closure
1882+
* @param $limit int default 500, maximum 1000
18821883
* @return null
18831884
* @throws \Exception
18841885
*/
1885-
public function chart($symbols, string $interval = "30m", callable $callback)
1886+
public function chart($symbols, string $interval = "30m", callable $callback, $limit = 500)
18861887
{
18871888
if (!is_array($symbols)) {
18881889
$symbols = [
@@ -1939,7 +1940,7 @@ public function chart($symbols, string $interval = "30m", callable $callback)
19391940
echo "chart({$symbol},{$interval})) Could not connect: {$e->getMessage()}" . PHP_EOL;
19401941
$loop->stop();
19411942
});
1942-
$this->candlesticks($symbol, $interval);
1943+
$this->candlesticks($symbol, $interval, $limit);
19431944
foreach ($this->chartQueue[$symbol][$interval] as $json) {
19441945
$this->chartHandler($symbol, $interval, $json);
19451946
}

0 commit comments

Comments
 (0)