|
@@ -256,4 +256,17 @@ class CmBroker |
|
@@ -256,4 +256,17 @@ class CmBroker |
|
256
|
$symbol = $this->getSymbolOri($symbol, $this->plat);
|
256
|
$symbol = $this->getSymbolOri($symbol, $this->plat);
|
|
257
|
$this->exBroker->setLever($symbol, $lever);
|
257
|
$this->exBroker->setLever($symbol, $lever);
|
|
258
|
}
|
258
|
}
|
|
|
|
259
|
+ //查询获取全部持仓
|
|
|
|
260
|
+ public function getAllPos(): array
|
|
|
|
261
|
+ {
|
|
|
|
262
|
+ $positions = $this->exBroker->getAllPos();
|
|
|
|
263
|
+ $newPositions = [];
|
|
|
|
264
|
+ foreach ($positions as $key => $value) {
|
|
|
|
265
|
+ $item = Pos::transferOkxPos($value, $this->symbolInfos, function ($symbol) {
|
|
|
|
266
|
+ return $this->getSymbolSt($symbol);
|
|
|
|
267
|
+ });
|
|
|
|
268
|
+ $newPositions[$item->symbol . "_" . $item->posSide] = $item;
|
|
|
|
269
|
+ }
|
|
|
|
270
|
+ return $newPositions;
|
|
|
|
271
|
+ }
|
|
259
|
} |
272
|
} |