|
...
|
...
|
@@ -73,7 +73,7 @@ class Order |
|
|
|
}
|
|
|
|
return $order;
|
|
|
|
}
|
|
|
|
function toBinanceOrder(array $symbolInfos, callable $toSymbolOri)
|
|
|
|
public function toBinanceOrder(array $symbolInfos, callable $toSymbolOri)
|
|
|
|
{
|
|
|
|
$symbol = call_user_func($toSymbolOri, $this->symbol);
|
|
|
|
/** @var SymbolInfo $symbolInfo */
|
|
...
|
...
|
@@ -102,7 +102,7 @@ class Order |
|
|
|
}
|
|
|
|
return $order;
|
|
|
|
}
|
|
|
|
function toBybitOrder(array $symbolInfos, callable $toSymbolOri)
|
|
|
|
public function toBybitOrder(array $symbolInfos, callable $toSymbolOri)
|
|
|
|
{
|
|
|
|
$symbol = call_user_func($toSymbolOri, $this->symbol);
|
|
|
|
/** @var SymbolInfo $symbolInfo */
|
|
...
|
...
|
@@ -140,4 +140,37 @@ class Order |
|
|
|
}
|
|
|
|
return $order;
|
|
|
|
}
|
|
|
|
public function toBitgetOrder(array $symbolInfos, callable $toSymbolOri)
|
|
|
|
{
|
|
|
|
$symbol = call_user_func($toSymbolOri, $this->symbol);
|
|
|
|
/** @var SymbolInfo $symbolInfo */
|
|
|
|
$symbolInfo = $symbolInfos[$this->symbol];
|
|
|
|
$tradeSide = "open";
|
|
|
|
if (($this->posSide == "SHORT" && $this->side == "BUY") || ($this->posSide == "LONG" && $this->side == "SELL")) {
|
|
|
|
$tradeSide = "close";
|
|
|
|
}
|
|
|
|
$timeInForce = "GTC";
|
|
|
|
if ($this->ordType == "IOC") {
|
|
|
|
$timeInForce = "IOC";
|
|
|
|
$ordType = "LIMIT";
|
|
|
|
}
|
|
|
|
if ($this->ordType == "FOK") {
|
|
|
|
$timeInForce = "FOK";
|
|
|
|
$ordType = "LIMIT";
|
|
|
|
}
|
|
|
|
$order = [
|
|
|
|
'productType' => 'USDT-FUTURES',
|
|
|
|
'marginMode' => 'crossed',
|
|
|
|
'marginCoin' => 'USDT',
|
|
|
|
'symbol' => $symbol,
|
|
|
|
'side' => strtolower($this->side),
|
|
|
|
'orderType' => strtolower($this->ordType),
|
|
|
|
'price' => (string)round($this->price, $symbolInfo->pricePrec),
|
|
|
|
'size' => (string)round($this->qty, $symbolInfo->qtyPrec),
|
|
|
|
'tradeSide' => $tradeSide,
|
|
|
|
'force' => $timeInForce,
|
|
|
|
'clientOid' => $this->cliOrdId,
|
|
|
|
];
|
|
|
|
return $order;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|