hyperquant 0.99__tar.gz → 1.0__tar.gz
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.
- {hyperquant-0.99 → hyperquant-1.0}/PKG-INFO +1 -1
- {hyperquant-0.99 → hyperquant-1.0}/apis.json +2 -2
- {hyperquant-0.99 → hyperquant-1.0}/pyproject.toml +1 -1
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/bitmart.py +5 -8
- {hyperquant-0.99 → hyperquant-1.0}/tests/test_bitmart.py +10 -10
- {hyperquant-0.99 → hyperquant-1.0}/uv.lock +1 -1
- {hyperquant-0.99 → hyperquant-1.0}/.gitignore +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/.python-version +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/README.md +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/data/alpine_smoke.log +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/data/logs/notikit.log +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/data/logs/test_order_sync.log +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/data/records_swap.csv +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/data/records_swapc.csv +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/doc/bitmart.md +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/doc/coinup.md +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/doc/lbank.md +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/pub.sh +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/requirements-dev.lock +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/requirements.lock +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/__init__.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/auth.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/bitget.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/coinup.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/coinw.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/edgex.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/hyperliquid.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/lbank.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/lib/edgex_sign.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/lib/hpstore.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/lib/hyper_types.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/lib/util.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/lighter.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/models/bitget.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/models/bitmart.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/models/coinup.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/models/coinw.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/models/edgex.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/models/hyperliquid.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/models/lbank.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/models/lighter.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/models/ourbit.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/ourbit.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/broker/ws.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/core.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/datavison/_util.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/datavison/binance.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/datavison/coinglass.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/datavison/okx.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/db.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/draw.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/logkit.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/src/hyperquant/notikit.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/tests/test_bitget.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/tests/test_coinup.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/tests/test_coinw.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/tests/test_draw.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/tests/test_edgex.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/tests/test_lbank.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/tests/test_lighter.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/tests/test_ourbit.py +0 -0
- {hyperquant-0.99 → hyperquant-1.0}/tests/tmp.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyperquant
|
|
3
|
-
Version: 0
|
|
3
|
+
Version: 1.0
|
|
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
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"41933ec0f5dace5eee47628ea2e2cb40a491f7fd20f983b385f8bdc5eea3d3ad4a47bd745f70fc2a"
|
|
25
25
|
],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,
|
|
335
335
|
category: Literal[1,2,"limit","market"] = "limit",
|
|
336
336
|
price: float,
|
|
337
|
-
qty: float,
|
|
337
|
+
qty: Optional[float] = None,
|
|
338
338
|
qty_contract: Optional[int] = None,
|
|
339
339
|
side: Literal[1, 2, 3, 4, "open_long", "close_short", "close_long", "open_short", "buy", "sell"] = "open_long",
|
|
340
340
|
mode: Literal[1, 2, 3, 4, "gtc", "ioc", "fok", "maker_only", "maker-only", "post_only"] = "gtc",
|
|
@@ -348,6 +348,8 @@ class Bitmart:
|
|
|
348
348
|
"""Submit an order via ``submitOrder``.
|
|
349
349
|
返回值: order_id (int)
|
|
350
350
|
"""
|
|
351
|
+
if qty is None and qty_contract is None:
|
|
352
|
+
raise ValueError("Either qty or qty_contract must be provided.")
|
|
351
353
|
|
|
352
354
|
contract_id = self.get_contract_id(symbol)
|
|
353
355
|
if contract_id is None:
|
|
@@ -361,8 +363,7 @@ class Bitmart:
|
|
|
361
363
|
if detail is None:
|
|
362
364
|
raise ValueError(f"Market metadata unavailable for symbol: {symbol}")
|
|
363
365
|
|
|
364
|
-
|
|
365
|
-
if qty_contract is not None:
|
|
366
|
+
if qty_contract is None:
|
|
366
367
|
|
|
367
368
|
contract_size_str = detail.get("contract_size") or detail.get("vol_unit") or "1"
|
|
368
369
|
try:
|
|
@@ -378,11 +379,7 @@ class Bitmart:
|
|
|
378
379
|
raise ValueError(
|
|
379
380
|
f"Volume too small for contract size ({contract_size_val}): volume={qty}"
|
|
380
381
|
)
|
|
381
|
-
|
|
382
|
-
raise ValueError(
|
|
383
|
-
f"Volume must be a multiple of contract_size ({contract_size_val}). "
|
|
384
|
-
f"Received volume={qty} -> {contracts_float} contracts."
|
|
385
|
-
)
|
|
382
|
+
|
|
386
383
|
else:
|
|
387
384
|
contracts_int = int(qty)
|
|
388
385
|
if contracts_int <= 0:
|
|
@@ -30,23 +30,23 @@ async def test_update():
|
|
|
30
30
|
async def test_place():
|
|
31
31
|
async with pybotters.Client(apis='./apis.json') as client:
|
|
32
32
|
async with Bitmart(client=client) as broker:
|
|
33
|
-
|
|
33
|
+
# [2025-10-31 17:34:15] 🔵 准备建仓: VIRTUAL_USDT entry=short qty=20.498804 lag_px=1.4635 lead=binance
|
|
34
34
|
oid = await broker.place_order(
|
|
35
|
-
symbol='
|
|
35
|
+
symbol='VIRTUALUSDT',
|
|
36
36
|
side='sell',
|
|
37
37
|
category='limit',
|
|
38
|
-
price=
|
|
39
|
-
qty=
|
|
38
|
+
price=1.4635,
|
|
39
|
+
qty=20.49880423641954,
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
print(f"Placed order ID: {oid}")
|
|
43
43
|
|
|
44
|
-
resp = await broker.cancel_order(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)
|
|
44
|
+
# resp = await broker.cancel_order(
|
|
45
|
+
# symbol='ONDOUSDT',
|
|
46
|
+
# order_ids=[oid],
|
|
47
|
+
# )
|
|
48
48
|
|
|
49
|
-
print(f"Cancel response: {resp}")
|
|
49
|
+
# print(f"Cancel response: {resp}")
|
|
50
50
|
|
|
51
51
|
@dataclass
|
|
52
52
|
class OrderSyncResult:
|
|
@@ -153,4 +153,4 @@ async def test_sync_place():
|
|
|
153
153
|
logger.info(f"Order Sync Result: {result}")
|
|
154
154
|
|
|
155
155
|
if __name__ == "__main__":
|
|
156
|
-
asyncio.run(
|
|
156
|
+
asyncio.run(test_place())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|