|
...
|
...
|
@@ -198,6 +198,10 @@ class CmBroker |
|
|
|
});
|
|
|
|
if ($wsDataPos) {
|
|
|
|
$pos = Pos::transferWsDataPos($wsDataPos);
|
|
|
|
if ($this->posMode != self::MODE_ONE_SIDE) {
|
|
|
|
$pos->qty = abs($pos->qty); // 统一为正
|
|
|
|
$pos->lot = abs($pos->lot); // 统一为正
|
|
|
|
}
|
|
|
|
$positions[$wsDataPos->symbol . "_" . $wsDataPos->posSide] = $pos;
|
|
|
|
$wsData = new WsData($this->plat, 'pos', $trade = null, $pos = $wsDataPos);
|
|
|
|
$onData($wsData);
|
|
...
|
...
|
@@ -650,12 +654,20 @@ class CmBroker |
|
|
|
$item = Pos::transferOkxPos($value, $this->symbolInfos, function ($symbol) {
|
|
|
|
return $this->getSymbolSt($symbol);
|
|
|
|
});
|
|
|
|
if ($this->posMode != self::MODE_ONE_SIDE) {
|
|
|
|
$item->qty = abs($item->qty);
|
|
|
|
$item->lot = abs($item->lot);
|
|
|
|
}
|
|
|
|
$newPositions[$item->symbol . "_" . $item->posSide] = $item;
|
|
|
|
}
|
|
|
|
if ($this->plat == self::PLAT_BINANCE) {
|
|
|
|
$item = Pos::transferBinancePos($value, $this->symbolInfos, function ($symbol) {
|
|
|
|
return $this->getSymbolSt($symbol);
|
|
|
|
});
|
|
|
|
if ($this->posMode != self::MODE_ONE_SIDE) {
|
|
|
|
$item->qty = abs($item->qty);
|
|
|
|
$item->lot = abs($item->lot);
|
|
|
|
}
|
|
|
|
$newPositions[$item->symbol . "_" . $item->posSide] = $item;
|
|
|
|
}
|
|
|
|
}
|
...
|
...
|
|