hyperquant 0.52__py3-none-any.whl → 0.54__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.
@@ -55,7 +55,7 @@ class Book(DataStore):
55
55
  self._find_and_delete({"s": symbol})
56
56
 
57
57
  # 处理买卖盘数据
58
- for side_id, levels in (("B", bids), ("A", asks)):
58
+ for side_id, levels in (("b", bids), ("a", asks)):
59
59
  for i, level in enumerate(levels):
60
60
  # level格式: [price, size, count]
61
61
  if len(level) >= 3:
@@ -65,7 +65,7 @@ class Book(DataStore):
65
65
  "s": symbol,
66
66
  "S": side_id,
67
67
  "p": str(price),
68
- "sz": str(size),
68
+ "q": str(size),
69
69
  "ct": count,
70
70
  "i": i
71
71
  }
@@ -84,24 +84,7 @@ class Book(DataStore):
84
84
  def sorted(
85
85
  self, query: Item | None = None, limit: int | None = None
86
86
  ) -> dict[str, list[Item]]:
87
- """获取排序后的订单簿数据
88
87
 
89
- Returns:
90
- 返回按价格排序的买卖盘数据,卖盘升序,买盘降序
91
-
92
- .. code-block:: python
93
-
94
- {
95
- "asks": [
96
- {"symbol": "BTC_USDT", "side": "A", "px": "110152.5", "sz": "53539", "count": 1},
97
- {"symbol": "BTC_USDT", "side": "A", "px": "110152.6", "sz": "95513", "count": 2}
98
- ],
99
- "bids": [
100
- {"symbol": "BTC_USDT", "side": "B", "px": "110152.4", "sz": "76311", "count": 1},
101
- {"symbol": "BTC_USDT", "side": "B", "px": "110152.3", "sz": "104688", "count": 2}
102
- ]
103
- }
104
- """
105
88
  return self._sorted(
106
89
  item_key="S",
107
90
  item_asc_key="a", # asks 升序
@@ -430,32 +413,37 @@ class OurbitSwapDataStore(DataStoreCollection):
430
413
  @property
431
414
  def book(self) -> Book:
432
415
  """订单簿深度数据流
433
-
416
+
417
+ 提供实时订单簿深度数据,包含买卖双方价格和数量信息
418
+
434
419
  Data type: Mutable
435
-
436
- Keys: ("symbol", "side", "px")
420
+
421
+ Keys: ("s", "S", "p")
422
+ - s: 交易对符号,如 "BTC_USDT"
423
+ - S: 买卖方向,"a" 表示卖单(ask),"b" 表示买单(bid)
424
+ - p: 价格
437
425
 
438
426
  Data structure:
439
427
 
440
428
  .. code:: python
441
429
 
442
430
  [
443
- {
444
- "symbol": "BTC_USDT", # 交易对
445
- "side": "A", # 卖出方向
446
- "px": "110152.5", # 价格
447
- "sz": "53539", # 数量
448
- "count": 1 # 订单数量
449
- "i" 0 # 价格档位索引
450
- },
451
- {
452
- "symbol": "BTC_USDT", # 交易对
453
- "side": "B", # 买入方向
454
- "px": "110152.4", # 价格
455
- "sz": "76311", # 数量
456
- "count": 1 # 订单数量
457
- "i" 0 # 价格档位索引
458
- }
431
+ {
432
+ "s": "BTC_USDT", # 交易对符号
433
+ "S": "a", # 卖单方向(ask)
434
+ "p": "110152.5", # 价格
435
+ "q": "53539", # 数量
436
+ "ct": 1, # 该价格的订单数量
437
+ "i": 0 # 价格档位索引(从0开始)
438
+ },
439
+ {
440
+ "s": "BTC_USDT", # 交易对符号
441
+ "S": "b", # 买单方向(bid)
442
+ "p": "110152.4", # 价格
443
+ "q": "76311", # 数量
444
+ "ct": 1, # 该价格的订单数量
445
+ "i": 0 # 价格档位索引(从0开始)
446
+ }
459
447
  ]
460
448
  """
461
449
  return self._get("book", Book)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperquant
3
- Version: 0.52
3
+ Version: 0.54
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
@@ -11,11 +11,11 @@ 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=ID_uOojyqfKiLNcIhT_3X3-IDFGsVud27kArut3mCMo,42299
14
+ hyperquant/broker/models/ourbit.py,sha256=ea4URVokQoUmy6xSiQEAXo32eE1KR2VNXtjUBUIHGWE,41799
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.52.dist-info/METADATA,sha256=SrzDREIrGQtsDdXOSsg-sYdut4mhtvcccsUkmIP-kSM,4317
20
- hyperquant-0.52.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
21
- hyperquant-0.52.dist-info/RECORD,,
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,,