|
@@ -196,12 +196,12 @@ class CmBroker |
|
@@ -196,12 +196,12 @@ class CmBroker |
|
196
|
|
196
|
|
|
197
|
public function placeOrder(Order $order)
|
197
|
public function placeOrder(Order $order)
|
|
198
|
{
|
198
|
{
|
|
|
|
199
|
+ /** @var SymbolInfo $symbolInfo */
|
|
|
|
200
|
+ $symbolInfo = $this->symbolInfos[$order->symbol];
|
|
199
|
if ($this->plat == self::PLAT_OKX) {
|
201
|
if ($this->plat == self::PLAT_OKX) {
|
|
200
|
$orderOri = $order->toOkxOrder($this->symbolInfos, function ($symbol) {
|
202
|
$orderOri = $order->toOkxOrder($this->symbolInfos, function ($symbol) {
|
|
201
|
return $this->getSymbolOri($symbol, $this->plat);
|
203
|
return $this->getSymbolOri($symbol, $this->plat);
|
|
202
|
});
|
204
|
});
|
|
203
|
- /** @var SymbolInfo $symbolInfo */
|
|
|
|
204
|
- $symbolInfo = $this->symbolInfos[$order->symbol];
|
|
|
|
205
|
$this->msg("下单", $orderOri);
|
205
|
$this->msg("下单", $orderOri);
|
|
206
|
if ($orderOri['sz'] == 0) {
|
206
|
if ($orderOri['sz'] == 0) {
|
|
207
|
$msg = "当前下单数量为{$order->qty},最小下单数量为{$symbolInfo->minQty},不下单";
|
207
|
$msg = "当前下单数量为{$order->qty},最小下单数量为{$symbolInfo->minQty},不下单";
|
|
@@ -212,6 +212,20 @@ class CmBroker |
|
@@ -212,6 +212,20 @@ class CmBroker |
|
212
|
$this->msg("下单结果", $res);
|
212
|
$this->msg("下单结果", $res);
|
|
213
|
return $res;
|
213
|
return $res;
|
|
214
|
}
|
214
|
}
|
|
|
|
215
|
+ if ($this->plat == self::PLAT_BINANCE) {
|
|
|
|
216
|
+ $orderOri = $order->toBinanceOrder($this->symbolInfos, function ($symbol) {
|
|
|
|
217
|
+ return $this->getSymbolOri($symbol, $this->plat);
|
|
|
|
218
|
+ });
|
|
|
|
219
|
+ $this->msg("下单", $orderOri);
|
|
|
|
220
|
+ if ($orderOri['quantity'] == 0) {
|
|
|
|
221
|
+ $msg = "当前下单数量为{$order->qty},最小下单数量为{$symbolInfo->minQty},不下单";
|
|
|
|
222
|
+ $this->msg($msg, $orderOri);
|
|
|
|
223
|
+ return ["code" => 2, "msg" => $msg];
|
|
|
|
224
|
+ }
|
|
|
|
225
|
+ $res = $this->exBroker->placeOrder($orderOri);
|
|
|
|
226
|
+ $this->msg("下单结果", $res);
|
|
|
|
227
|
+ return $res;
|
|
|
|
228
|
+ }
|
|
215
|
}
|
229
|
}
|
|
216
|
|
230
|
|
|
217
|
public function msg()
|
231
|
public function msg()
|