水平参数我使用Github如何使用与coinbase和GDAX
以下库我需要从GDAX的订单。我这样做,通过执行以下操作:
$getOrderBook = $exchange->getOrderBook($exchangeProduct);
echo '<pre>';
print_r($getOrderBook);
echo '<pre>';
使用上面我只得到1级,其根据GDAX我去拿“只有最好的买入价和卖出”,输出是这样的:
Array
(
[sequence] => 2402392394
[bids] => Array
(
[0] => Array
(
[0] => 3857.13
[1] => 0.14
[2] => 1
)
)
[asks] => Array
(
[0] => Array
(
[0] => 3859.99
[1] => 0.0475099
[2] => 2
)
)
该文档指出:“默认情况下,只返回内部(即最佳)出价和要价,相当于书籍深度为1级,如果您希望看到更大的订单,请指定级别查询参数“。
文档状态还指出,级别2获得“前50名出价和询问(汇总)”,级别3获得“全订单(非汇总)”。
在GitHub上类包含下面的代码,涉及到我的查询:
public function getOrderBook($product = 'BTC-USD') {
//$this->validate('product', $product);
return $this->request('book', array('id' => $product));
}
和“书”:
public $endpoints = array(
'book' => array('method' => 'GET', 'uri' => '/products/%s/book'),
);
现在我想打电话给我的功能$getOrderBook = $exchange->getOrderBook($exchangeProduct)
2级或3.
如何在不修改从Github导入的代码的情况下执行此操作?
使用URL输出应该如下:
https://api.gdax.com/products/BTC-EUR/book?level=2
感谢。
只是为了澄清,你在谈论https://docs.gdax.com/?php#get-product-order-book,对吧? – WOUNDEDStevenJones
看起来像coinbase-exchange-php库可能没有实现层次(基于'$ endpoints'数组和'getOrderBook'方法没有'$ level'参数)。因此,如果不编辑github文件,我不确定它是否有可能,直到该库得到更新。 – WOUNDEDStevenJones
也许可以使用这个库:https://gitlab.com/mrteye/GDAX。它似乎支持书籍级别。 – Aknosis