|
...
|
...
|
@@ -196,12 +196,12 @@ class CmBroker |
|
|
|
|
|
|
|
public function placeOrder(Order $order)
|
|
|
|
{
|
|
|
|
/** @var SymbolInfo $symbolInfo */
|
|
|
|
$symbolInfo = $this->symbolInfos[$order->symbol];
|
|
|
|
if ($this->plat == self::PLAT_OKX) {
|
|
|
|
$orderOri = $order->toOkxOrder($this->symbolInfos, function ($symbol) {
|
|
|
|
return $this->getSymbolOri($symbol, $this->plat);
|
|
|
|
});
|
|
|
|
/** @var SymbolInfo $symbolInfo */
|
|
|
|
$symbolInfo = $this->symbolInfos[$order->symbol];
|
|
|
|
$this->msg("下单", $orderOri);
|
|
|
|
if ($orderOri['sz'] == 0) {
|
|
|
|
$msg = "当前下单数量为{$order->qty},最小下单数量为{$symbolInfo->minQty},不下单";
|
|
...
|
...
|
@@ -212,6 +212,20 @@ class CmBroker |
|
|
|
$this->msg("下单结果", $res);
|
|
|
|
return $res;
|
|
|
|
}
|
|
|
|
if ($this->plat == self::PLAT_BINANCE) {
|
|
|
|
$orderOri = $order->toBinanceOrder($this->symbolInfos, function ($symbol) {
|
|
|
|
return $this->getSymbolOri($symbol, $this->plat);
|
|
|
|
});
|
|
|
|
$this->msg("下单", $orderOri);
|
|
|
|
if ($orderOri['quantity'] == 0) {
|
|
|
|
$msg = "当前下单数量为{$order->qty},最小下单数量为{$symbolInfo->minQty},不下单";
|
|
|
|
$this->msg($msg, $orderOri);
|
|
|
|
return ["code" => 2, "msg" => $msg];
|
|
|
|
}
|
|
|
|
$res = $this->exBroker->placeOrder($orderOri);
|
|
|
|
$this->msg("下单结果", $res);
|
|
|
|
return $res;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function msg()
|
...
|
...
|
|