hyperquant 0.76__tar.gz → 0.77__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.76 → hyperquant-0.77}/PKG-INFO +1 -1
- {hyperquant-0.76 → hyperquant-0.77}/apis.json +1 -1
- {hyperquant-0.76 → hyperquant-0.77}/pyproject.toml +1 -1
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/models/lbank.py +3 -1
- {hyperquant-0.76 → hyperquant-0.77}/tests/test_lbank.py +17 -15
- {hyperquant-0.76 → hyperquant-0.77}/.gitignore +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/.python-version +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/README.md +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/data/alpine_smoke.log +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/data/logs/notikit.log +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/data/logs/test_order_sync.log +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/data/records_swap.csv +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/data/records_swapc.csv +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/doc/lbank.md +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/pub.sh +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/requirements-dev.lock +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/requirements.lock +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/__init__.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/auth.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/bitget.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/edgex.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/hyperliquid.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/lbank.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/lib/edgex_sign.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/lib/hpstore.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/lib/hyper_types.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/lib/util.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/models/bitget.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/models/edgex.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/models/hyperliquid.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/models/ourbit.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/ourbit.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/broker/ws.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/core.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/datavison/_util.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/datavison/binance.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/datavison/coinglass.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/datavison/okx.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/db.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/draw.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/logkit.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/src/hyperquant/notikit.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/tests/test_bitget.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/tests/test_draw.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/tests/test_edgex.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/tests/test_ourbit.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/tests/tmp.py +0 -0
- {hyperquant-0.76 → hyperquant-0.77}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hyperquant
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.77
|
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
|
@@ -298,6 +298,7 @@ class Position(DataStore):
|
|
298
298
|
"realized_pnl": entry.get("CloseProfit"),
|
299
299
|
"update_time": entry.get("UpdateTime"),
|
300
300
|
"insert_time": entry.get("InsertTime"),
|
301
|
+
"begin_time": entry.get("BeginTime")
|
301
302
|
}
|
302
303
|
|
303
304
|
def _onresponse(self, data: dict[str, Any] | None) -> None:
|
@@ -492,7 +493,8 @@ class LbankDataStore(DataStoreCollection):
|
|
492
493
|
"unrealized_pnl": <未实现盈亏>,
|
493
494
|
"realized_pnl": <已实现盈亏>,
|
494
495
|
"update_time": <更新时间>,
|
495
|
-
"insert_time":
|
496
|
+
"insert_time": <插入时间>,
|
497
|
+
"begin_time": <持仓开始时间>
|
496
498
|
},
|
497
499
|
...
|
498
500
|
]
|
@@ -169,6 +169,7 @@ async def order_sync_polling(
|
|
169
169
|
)
|
170
170
|
|
171
171
|
latency = int(time.time() * 1000) - started
|
172
|
+
print(resp)
|
172
173
|
|
173
174
|
order_id = resp.get("orderSysID")
|
174
175
|
# print(f"下单延迟 {latency} ms, 订单号: {order_id}")
|
@@ -188,7 +189,7 @@ async def order_sync_polling(
|
|
188
189
|
"order_id": order_id,
|
189
190
|
"trade_count": 1,
|
190
191
|
"volume": volume,
|
191
|
-
"avg_price": float(resp.get('
|
192
|
+
"avg_price": float(resp.get('tradePrice', 0)),
|
192
193
|
"turnover": float(resp.get('turnover', 0)),
|
193
194
|
"fee": float(resp.get('fee', 0)),
|
194
195
|
"position_id": position_id,
|
@@ -251,7 +252,7 @@ async def test_order_sync_polling():
|
|
251
252
|
snapshot = await order_sync_polling(
|
252
253
|
lb,
|
253
254
|
symbol="SOLUSDT",
|
254
|
-
direction="
|
255
|
+
direction="sell",
|
255
256
|
order_type="market",
|
256
257
|
price=bid0,
|
257
258
|
volume=0.03,
|
@@ -259,26 +260,27 @@ async def test_order_sync_polling():
|
|
259
260
|
grace_sec=1,
|
260
261
|
poll_interval=1
|
261
262
|
)
|
263
|
+
print(snapshot)
|
262
264
|
|
263
|
-
position_id = snapshot.get("position_id")
|
264
|
-
if not position_id:
|
265
|
-
|
265
|
+
# position_id = snapshot.get("position_id")
|
266
|
+
# if not position_id:
|
267
|
+
# print('没有 position_id')
|
266
268
|
|
267
|
-
position = None
|
268
|
-
for _ in range(5):
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
269
|
+
# position = None
|
270
|
+
# for _ in range(5):
|
271
|
+
# await lb.update("position")
|
272
|
+
# position = lb.store.position.get({"position_id": position_id})
|
273
|
+
# if position:
|
274
|
+
# break
|
275
|
+
# await asyncio.sleep(0.1)
|
274
276
|
|
275
|
-
print(position)
|
277
|
+
# print(position)
|
276
278
|
|
277
279
|
async def test_query_order():
|
278
280
|
async with pybotters.Client(apis='./apis.json') as client:
|
279
281
|
async with Lbank(client) as lb:
|
280
|
-
res = await lb.query_order("
|
282
|
+
res = await lb.query_order("1000633355403954")
|
281
283
|
print(res)
|
282
284
|
|
283
285
|
if __name__ == "__main__":
|
284
|
-
asyncio.run(
|
286
|
+
asyncio.run(test_order_sync_polling())
|
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
|