hyperquant 0.51__tar.gz → 0.52__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.51 → hyperquant-0.52}/PKG-INFO +1 -1
- hyperquant-0.52/backtest_tmp.py +33 -0
- hyperquant-0.52/deals.json +33105 -0
- {hyperquant-0.51 → hyperquant-0.52}/pyproject.toml +1 -1
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/broker/models/ourbit.py +85 -63
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/core.py +3 -0
- hyperquant-0.52/tests/test_lbank.py +34 -0
- {hyperquant-0.51 → hyperquant-0.52}/tests/test_order_sync.py +18 -18
- hyperquant-0.52/tests/test_ourbit.py +76 -0
- {hyperquant-0.51 → hyperquant-0.52}/uv.lock +1 -1
- {hyperquant-0.51 → hyperquant-0.52}/.gitignore +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/.python-version +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/README.md +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/apis.json +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/data/alpine_smoke.log +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/data/logs/notikit.log +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/data/logs/test_order_sync.log +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/pub.sh +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/requirements-dev.lock +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/requirements.lock +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/__init__.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/broker/auth.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/broker/hyperliquid.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/broker/lib/hpstore.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/broker/lib/hyper_types.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/broker/models/hyperliquid.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/broker/ourbit.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/broker/ws.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/datavison/_util.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/datavison/binance.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/datavison/coinglass.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/datavison/okx.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/db.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/draw.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/logkit.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/src/hyperquant/notikit.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/tests/test.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/tests/test_store.py +0 -0
- {hyperquant-0.51 → hyperquant-0.52}/tests/tmp.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hyperquant
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.52
|
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
|
@@ -0,0 +1,33 @@
|
|
1
|
+
from hyperquant.core import Exchange
|
2
|
+
import json
|
3
|
+
import pandas as pd
|
4
|
+
|
5
|
+
data = json.load(open("deals.json", "r"))
|
6
|
+
|
7
|
+
data = data['data']['resultList']
|
8
|
+
|
9
|
+
data = data[::-1] # 时间正序
|
10
|
+
|
11
|
+
e = Exchange([], fee=0, initial_balance=100, recorded=True)
|
12
|
+
|
13
|
+
for d in data:
|
14
|
+
dir = 1 if d['tradeType'] == 'BUY' else -1
|
15
|
+
symbol = d['symbol']
|
16
|
+
time = pd.Timestamp(d['createTime'], unit='ms')
|
17
|
+
check_time = pd.Timestamp("2025-09-08 23:39:50")
|
18
|
+
if time < check_time:
|
19
|
+
continue
|
20
|
+
if symbol == 'OPEN_USDT':
|
21
|
+
continue
|
22
|
+
e.Trade(symbol, dir, float(d['price']), float(d['quantity']) , time = time)
|
23
|
+
|
24
|
+
print(e.stats)
|
25
|
+
# import pandas as pd
|
26
|
+
|
27
|
+
# df = pd.DataFrame(e.trades)
|
28
|
+
# # 过滤掉pos为0的行
|
29
|
+
# df = df[df['pos'] != 0]
|
30
|
+
# print(df)
|
31
|
+
# # 按照symbol分组,pos字段求和, pos_rate求平均
|
32
|
+
# summary = df.groupby('symbol').agg({'pos': 'sum', 'pos_rate': 'mean'}).reset_index()
|
33
|
+
# print(summary)
|