hyperquant 0.54__py3-none-any.whl → 0.56__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -134,6 +134,7 @@ class Orders(DataStore):
134
134
  def _fmt(self, order:dict):
135
135
  return {
136
136
  "order_id": order.get("orderId"),
137
+ "position_id": order.get("positionId"),
137
138
  "symbol": order.get("symbol"),
138
139
  "price": order.get("price"),
139
140
  "vol": order.get("vol"),
@@ -185,7 +186,7 @@ class Orders(DataStore):
185
186
  })
186
187
  else:
187
188
  order = self._fmt(data)
188
- order["state"] = "unknown"
189
+ order["state"] = f"unknown_{state}"
189
190
  self._update([order])
190
191
  self._find_and_delete({
191
192
  "order_id": order.get("order_id")
@@ -83,11 +83,12 @@ class OurbitSwap:
83
83
  )
84
84
 
85
85
  async def sub_personal(self):
86
- self.client.ws_connect(
86
+ wsapp = self.client.ws_connect(
87
87
  self.ws_url,
88
88
  send_json={"method": "sub.personal.user.preference"},
89
89
  hdlr_json=self.store.onmessage,
90
90
  )
91
+ await wsapp._event.wait()
91
92
 
92
93
  def ret_content(self, res: pybotters.FetchResult):
93
94
  match res.data:
@@ -115,6 +116,7 @@ class OurbitSwap:
115
116
  usdt_amount: Optional[float] = None,
116
117
  leverage: Optional[int] = 20,
117
118
  position_id: Optional[int] = None,
119
+ quantity: float = None, # 兼容参数,不使用
118
120
  ):
119
121
  """
120
122
  size为合约张数, openType 1 为逐仓, 2为全仓
@@ -167,12 +169,18 @@ class OurbitSwap:
167
169
  if position_id is None:
168
170
  raise ValueError("position_id is required for closing position")
169
171
  data["positionId"] = position_id
170
- # import time
171
- # print(time.time(), '下单')
172
+
172
173
  res = await self.client.fetch(
173
174
  "POST", f"{self.api_url}/api/v1/private/order/create", data=data
174
175
  )
175
- return self.ret_content(res)
176
+ # 'orderId' =
177
+ # '226474723700166962'
178
+ # 'ts' =
179
+ # 1758034181833
180
+ print(res.data)
181
+ ret_c = self.ret_content(res)
182
+ # 只返回 orderId
183
+ return ret_c["orderId"]
176
184
 
177
185
  async def place_tpsl(
178
186
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperquant
3
- Version: 0.54
3
+ Version: 0.56
4
4
  Summary: A minimal yet hyper-efficient backtesting framework for quantitative trading
5
5
  Project-URL: Homepage, https://github.com/yourusername/hyperquant
6
6
  Project-URL: Issues, https://github.com/yourusername/hyperquant/issues
@@ -6,16 +6,16 @@ hyperquant/logkit.py,sha256=nUo7nx5eONvK39GOhWwS41zNRL756P2J7-5xGzwXnTY,8462
6
6
  hyperquant/notikit.py,sha256=x5yAZ_tAvLQRXcRbcg-VabCaN45LUhvlTZnUqkIqfAA,3596
7
7
  hyperquant/broker/auth.py,sha256=oA9Yw1I59-u0Tnoj2e4wUup5q8V5T2qpga5RKbiAiZI,2614
8
8
  hyperquant/broker/hyperliquid.py,sha256=7MxbI9OyIBcImDelPJu-8Nd53WXjxPB5TwE6gsjHbto,23252
9
- hyperquant/broker/ourbit.py,sha256=Fza_nhfoSCf1Ulm7UHOlt969Wm37bKja9P5xpN93XqY,17902
9
+ hyperquant/broker/ourbit.py,sha256=FAOy090kisBjtSxtwt6-FuCDRA7JctbNW4u17yecV3k,18123
10
10
  hyperquant/broker/ws.py,sha256=umRzxwCaZaRIgIq4YY-AuA0wCXFT0uOBmQbIXFY8CK0,1555
11
11
  hyperquant/broker/lib/hpstore.py,sha256=LnLK2zmnwVvhEbLzYI-jz_SfYpO1Dv2u2cJaRAb84D8,8296
12
12
  hyperquant/broker/lib/hyper_types.py,sha256=HqjjzjUekldjEeVn6hxiWA8nevAViC2xHADOzDz9qyw,991
13
13
  hyperquant/broker/models/hyperliquid.py,sha256=c4r5739ibZfnk69RxPjQl902AVuUOwT8RNvKsMtwXBY,9459
14
- hyperquant/broker/models/ourbit.py,sha256=ea4URVokQoUmy6xSiQEAXo32eE1KR2VNXtjUBUIHGWE,41799
14
+ hyperquant/broker/models/ourbit.py,sha256=-X8u3gS9jMFlYH6mg-h6mojqGnYTN5m8HNkVqpori-A,41860
15
15
  hyperquant/datavison/_util.py,sha256=92qk4vO856RqycO0YqEIHJlEg-W9XKapDVqAMxe6rbw,533
16
16
  hyperquant/datavison/binance.py,sha256=3yNKTqvt_vUQcxzeX4ocMsI5k6Q6gLZrvgXxAEad6Kc,5001
17
17
  hyperquant/datavison/coinglass.py,sha256=PEjdjISP9QUKD_xzXNzhJ9WFDTlkBrRQlVL-5pxD5mo,10482
18
18
  hyperquant/datavison/okx.py,sha256=yg8WrdQ7wgWHNAInIgsWPM47N3Wkfr253169IPAycAY,6898
19
- hyperquant-0.54.dist-info/METADATA,sha256=SEuuszxmTn2lkRNpkZWiay4XKtih10Do-m9P85ciHhE,4317
20
- hyperquant-0.54.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
21
- hyperquant-0.54.dist-info/RECORD,,
19
+ hyperquant-0.56.dist-info/METADATA,sha256=CDXfrCBO-5jKkRUDjGOWOS_5yF9_xFMIch44UdA-Nec,4317
20
+ hyperquant-0.56.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
21
+ hyperquant-0.56.dist-info/RECORD,,