正在显示
1 个修改的文件
包含
13 行增加
和
3 行删除
| @@ -20,9 +20,11 @@ class WsDataTrade | @@ -20,9 +20,11 @@ class WsDataTrade | ||
| 20 | public float $quoteVol; //计价货币数量 成交额 | 20 | public float $quoteVol; //计价货币数量 成交额 |
| 21 | public int $ts; //时间戳 ms | 21 | public int $ts; //时间戳 ms |
| 22 | public string $tradeId; | 22 | public string $tradeId; |
| 23 | + public string $ordId; | ||
| 24 | + public string $cliOrdId; | ||
| 23 | public int $lever; | 25 | public int $lever; |
| 24 | 26 | ||
| 25 | - public function __construct($platform, $posSide, $symbol, $side, $price, $qty, $lot, $pnl, $fee, $quoteVol, $ts, $tradeId, $lever) | 27 | + public function __construct($platform, $posSide, $symbol, $side, $price, $qty, $lot, $pnl, $fee, $quoteVol, $ts, $tradeId, $ordId, $cliOrdId, $lever) |
| 26 | { | 28 | { |
| 27 | $this->platform = $platform; | 29 | $this->platform = $platform; |
| 28 | $this->posSide = $posSide; | 30 | $this->posSide = $posSide; |
| @@ -36,6 +38,8 @@ class WsDataTrade | @@ -36,6 +38,8 @@ class WsDataTrade | ||
| 36 | $this->quoteVol = $quoteVol; | 38 | $this->quoteVol = $quoteVol; |
| 37 | $this->ts = $ts; | 39 | $this->ts = $ts; |
| 38 | $this->tradeId = $tradeId; | 40 | $this->tradeId = $tradeId; |
| 41 | + $this->ordId = $ordId; | ||
| 42 | + $this->cliOrdId = $cliOrdId; | ||
| 39 | $this->lever = $lever; | 43 | $this->lever = $lever; |
| 40 | } | 44 | } |
| 41 | 45 | ||
| @@ -54,6 +58,8 @@ class WsDataTrade | @@ -54,6 +58,8 @@ class WsDataTrade | ||
| 54 | 'quoteVol' => $this->quoteVol, | 58 | 'quoteVol' => $this->quoteVol, |
| 55 | 'ts' => $this->ts, | 59 | 'ts' => $this->ts, |
| 56 | 'tradeId' => $this->tradeId, | 60 | 'tradeId' => $this->tradeId, |
| 61 | + 'ordId' => $this->ordId, | ||
| 62 | + 'cliOrdId' => $this->cliOrdId, | ||
| 57 | 'lever' => $this->lever, | 63 | 'lever' => $this->lever, |
| 58 | ]; | 64 | ]; |
| 59 | } | 65 | } |
| @@ -79,7 +85,9 @@ class WsDataTrade | @@ -79,7 +85,9 @@ class WsDataTrade | ||
| 79 | $ts = $data['uTime']; | 85 | $ts = $data['uTime']; |
| 80 | $tradeId = $data['tradeId']; | 86 | $tradeId = $data['tradeId']; |
| 81 | $lever = (int)$data['lever']; | 87 | $lever = (int)$data['lever']; |
| 82 | - return new WsDataTrade($platform, $posSide, $symbol, $side, $price, $qty, $lot, $pnl, $fee, $quoteVol, $ts, $tradeId, $lever); | 88 | + $ordId = $data['ordId']; |
| 89 | + $cliOrdId = $data['clOrdId']; | ||
| 90 | + return new WsDataTrade($platform, $posSide, $symbol, $side, $price, $qty, $lot, $pnl, $fee, $quoteVol, $ts, $tradeId, $ordId, $cliOrdId, $lever); | ||
| 83 | } | 91 | } |
| 84 | return null; | 92 | return null; |
| 85 | } | 93 | } |
| @@ -101,7 +109,9 @@ class WsDataTrade | @@ -101,7 +109,9 @@ class WsDataTrade | ||
| 101 | $quoteVol = $price * $qty; | 109 | $quoteVol = $price * $qty; |
| 102 | $ts = $order['T']; | 110 | $ts = $order['T']; |
| 103 | $tradeId = $order['t']; | 111 | $tradeId = $order['t']; |
| 112 | + $ordId = $order['i']; | ||
| 113 | + $cliOrdId = $order['c']; | ||
| 104 | $lever = 0; | 114 | $lever = 0; |
| 105 | - return new WsDataTrade($platform, $posSide, $symbol, $side, $price, $qty, $lot, $pnl, $fee, $quoteVol, $ts, $tradeId, $lever); | 115 | + return new WsDataTrade($platform, $posSide, $symbol, $side, $price, $qty, $lot, $pnl, $fee, $quoteVol, $ts, $tradeId, $ordId, $cliOrdId, $lever); |
| 106 | } | 116 | } |
| 107 | } | 117 | } |
-
请 注册 或 登录 后发表评论