hyperquant 0.5__tar.gz → 0.6__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.5 → hyperquant-0.6}/PKG-INFO +1 -1
- hyperquant-0.6/apis.json +5 -0
- hyperquant-0.6/backtest_tmp.py +33 -0
- hyperquant-0.6/data/records_swap.csv +38 -0
- hyperquant-0.6/data/records_swapc.csv +50 -0
- hyperquant-0.6/deals.json +33105 -0
- {hyperquant-0.5 → hyperquant-0.6}/pyproject.toml +1 -1
- hyperquant-0.6/src/hyperquant/broker/edgex.py +183 -0
- hyperquant-0.6/src/hyperquant/broker/models/edgex.py +513 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/broker/models/ourbit.py +184 -135
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/broker/ourbit.py +16 -5
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/core.py +3 -0
- hyperquant-0.6/tests/test_draw.py +29 -0
- hyperquant-0.6/tests/test_edgex.py +26 -0
- hyperquant-0.6/tests/test_lbank.py +34 -0
- hyperquant-0.6/tests/test_ourbit.py +224 -0
- {hyperquant-0.5 → hyperquant-0.6}/uv.lock +1 -1
- hyperquant-0.5/apis.json +0 -5
- hyperquant-0.5/tests/test.py +0 -183
- hyperquant-0.5/tests/test_order_sync.py +0 -107
- hyperquant-0.5/tests/test_store.py +0 -16
- {hyperquant-0.5 → hyperquant-0.6}/.gitignore +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/.python-version +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/README.md +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/data/alpine_smoke.log +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/data/logs/notikit.log +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/data/logs/test_order_sync.log +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/pub.sh +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/requirements-dev.lock +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/requirements.lock +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/__init__.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/broker/auth.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/broker/hyperliquid.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/broker/lib/hpstore.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/broker/lib/hyper_types.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/broker/models/hyperliquid.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/broker/ws.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/datavison/_util.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/datavison/binance.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/datavison/coinglass.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/datavison/okx.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/db.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/draw.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/logkit.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/src/hyperquant/notikit.py +0 -0
- {hyperquant-0.5 → hyperquant-0.6}/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.6
|
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
|
hyperquant-0.6/apis.json
ADDED
@@ -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)
|
@@ -0,0 +1,38 @@
|
|
1
|
+
timestamp,symbol,direction,entry_price,entry_contracts,contract_sz,exit_price,exit_contracts,reason
|
2
|
+
1758131354316,DOLO_USDT,long,0.1592,75.0,1.0,0.15975,75.0,TIME HIT
|
3
|
+
1758131800371,RESOLV_USDT,short,0.1479,81.0,1.0,0.1476,81.0,TP HIT
|
4
|
+
1758132024899,COOKIE_USDT,short,0.1273,94.0,1.0,0.1286,94.0,TP HIT
|
5
|
+
1758132051084,HUMA_USDT,short,0.02573,46.0,10.0,0.02571,46.0,TP HIT
|
6
|
+
1758132059956,VET_USDT,long,0.02427,49.0,10.0,0.02427,49.0,TP HIT
|
7
|
+
1758132085989,DOLO_USDT,long,0.15892,75.0,1.0,0.1589,75.0,TP HIT
|
8
|
+
1758132091568,PROVE_USDT,long,0.8824,13.0,1.0,0.8826,13.0,TP HIT
|
9
|
+
1758132094699,INIT_USDT,long,0.3576,33.0,1.0,0.3585,33.0,TP HIT
|
10
|
+
1758132103982,ACX_USDT,long,0.1328,90.0,1.0,0.1331,90.0,TP HIT
|
11
|
+
1758132793877,LA_USDT,long,0.3609,33.0,1.0,0.3611,33.0,TP HIT
|
12
|
+
1758136338252,KERNEL_USDT,long,0.1921,62.0,1.0,0.1915,62.0,TIME HIT
|
13
|
+
1758136553105,KERNEL_USDT,long,0.1919,62.0,1.0,0.1929,62.0,TIME HIT
|
14
|
+
1758136741317,KERNEL_USDT,long,0.1932,62.0,1.0,0.1927,62.0,TIME HIT
|
15
|
+
1758136924406,KERNEL_USDT,long,0.1928,62.0,1.0,0.1926,62.0,TIME HIT
|
16
|
+
1758137111075,KERNEL_USDT,long,0.1928,62.0,1.0,0.1927,62.0,TIME HIT
|
17
|
+
1758137300837,KERNEL_USDT,long,0.193,62.0,1.0,0.194,62.0,TIME HIT
|
18
|
+
1758137529786,KERNEL_USDT,long,0.1943,61.0,1.0,0.1941,61.0,TIME HIT
|
19
|
+
1758138156477,KERNEL_USDT,long,0.1947,61.0,1.0,0.1947,61.0,TIME HIT
|
20
|
+
1758138395870,KERNEL_USDT,long,0.1949,61.0,1.0,0.1952,61.0,TIME HIT
|
21
|
+
1758138421445,KERNEL_USDT,long,0.1955,61.0,1.0,0.1961,61.0,SL HIT
|
22
|
+
1758138603263,KERNEL_USDT,long,0.1961,61.0,1.0,0.1969,61.0,TIME HIT
|
23
|
+
1758138789727,KERNEL_USDT,long,0.1966,61.0,1.0,0.1972,61.0,TIME HIT
|
24
|
+
1758138830481,KERNEL_USDT,long,0.1972,60.0,1.0,0.1977,60.0,SL HIT
|
25
|
+
1758138856972,KERNEL_USDT,long,0.1981,60.0,1.0,0.1982,60.0,SL HIT
|
26
|
+
1758139103876,KERNEL_USDT,long,0.198,60.0,1.0,0.1972,60.0,TIME HIT
|
27
|
+
1758139288089,KERNEL_USDT,long,0.1973,60.0,1.0,0.1987,60.0,TIME HIT
|
28
|
+
1758139478785,KERNEL_USDT,long,0.1987,60.0,1.0,0.1981,60.0,TIME HIT
|
29
|
+
1758139666469,KERNEL_USDT,long,0.1982,60.0,1.0,0.1992,60.0,TIME HIT
|
30
|
+
1758139889864,KERNEL_USDT,long,0.1994,60.0,1.0,0.2021,60.0,TIME HIT
|
31
|
+
1758140079535,KERNEL_USDT,long,0.2015,59.0,1.0,0.2025,59.0,TIME HIT
|
32
|
+
1758140272352,KERNEL_USDT,long,0.2025,59.0,1.0,0.2026,59.0,TIME HIT
|
33
|
+
1758140456287,KERNEL_USDT,long,0.2026,59.0,1.0,0.2025,59.0,TIME HIT
|
34
|
+
1758140640717,KERNEL_USDT,long,0.2025,59.0,1.0,0.2033,59.0,TIME HIT
|
35
|
+
1758140816822,KERNEL_USDT,long,0.2037,58.0,1.0,0.2059,58.0,SL HIT
|
36
|
+
1758140994381,KERNEL_USDT,long,0.206,58.0,1.0,0.2075,58.0,SL HIT
|
37
|
+
1758141770128,KERNEL_USDT,long,0.2022,59.0,1.0,0.2027,59.0,TP HIT
|
38
|
+
1758152737076,VET_USDT,short,0.02517,47.0,10.0,0.02515,47.0,TP HIT
|
@@ -0,0 +1,50 @@
|
|
1
|
+
timestamp,symbol,direction,entry_price,entry_contracts,contract_sz,exit_price,exit_contracts,reason
|
2
|
+
1758127742300,F_USDT,long,0.01867,64.0,10.0,0.01864,64.0,TP HIT
|
3
|
+
1758128281143,F_USDT,long,0.01842,65.0,10.0,0.01843,65.0,TP HIT
|
4
|
+
1758130842628,RESOLV_USDT,long,0.1474,81.0,1.0,0.1475,81.0,TP HIT
|
5
|
+
1758131030061,DOOD_USDT,short,0.004297,27.0,100.0,0.004291,27.0,TP HIT
|
6
|
+
1758132065200,AGT_USDT,short,0.006175,195.0,10.0,0.006189,195.0,TP HIT
|
7
|
+
1758132082858,BIO_USDT,short,0.15953,75.0,1.0,0.15876,75.0,TP HIT
|
8
|
+
1758132091939,XLM_USDT,long,0.38544,3.0,10.0,0.38631,3.0,TP HIT
|
9
|
+
1758132105929,YALA_USDT,short,0.148,81.0,1.0,0.1478,81.0,TP HIT
|
10
|
+
1758132112073,PLUME_USDT,long,0.11831,101.0,1.0,0.11904,101.0,TP HIT
|
11
|
+
1758132135460,IN_USDT,short,0.06489,18.0,10.0,0.0649,18.0,TP HIT
|
12
|
+
1758132140351,GUN_USDT,short,0.02599,46.0,10.0,0.02601,46.0,TP HIT
|
13
|
+
1758132165560,AI16Z_USDT,short,0.1123,106.0,1.0,0.1125,106.0,TP HIT
|
14
|
+
1758132174202,INIT_USDT,short,0.3592,33.0,1.0,0.3605,33.0,TP HIT
|
15
|
+
1758132177220,MOVE_USDT,long,0.1252,95.0,1.0,0.1258,95.0,TP HIT
|
16
|
+
1758132179041,ARC_USDT,short,0.02076,57.0,10.0,0.02076,57.0,SL HIT
|
17
|
+
1758132199046,USELESS_USDT,short,0.2187,54.0,1.0,0.2194,54.0,TP HIT
|
18
|
+
1758132240915,TA_USDT,long,0.11113,107.0,1.0,0.11095,107.0,TP HIT
|
19
|
+
1758132957868,USELESS_USDT,short,0.216,55.0,1.0,0.2161,55.0,TP HIT
|
20
|
+
1758133517302,LAUNCHCOIN_USDT,short,0.08501,14.0,10.0,0.08483,14.0,TP HIT
|
21
|
+
1758134779244,LAUNCHCOIN_USDT,long,0.08271,14.0,10.0,0.083,14.0,TP HIT
|
22
|
+
1758134949732,LAUNCHCOIN_USDT,short,0.08468,14.0,10.0,0.08447,14.0,TP HIT
|
23
|
+
1758135085694,USELESS_USDT,short,0.2173,55.0,1.0,0.217,55.0,TP HIT
|
24
|
+
1758135912414,KERNEL_USDT,short,0.1908,63.0,1.0,0.1906,63.0,TP HIT
|
25
|
+
1758137511945,DOOD_USDT,short,0.004411,27.0,100.0,0.004398,27.0,TP HIT
|
26
|
+
1758137855380,DOOD_USDT,long,0.004334,27.0,100.0,0.00435,27.0,TP HIT
|
27
|
+
1758140785015,DOOD_USDT,short,0.004376,27.0,100.0,0.004374,27.0,TP HIT
|
28
|
+
1758140871891,KERNEL_USDT,long,0.2083,57.0,1.0,0.2082,57.0,TP HIT
|
29
|
+
1758141156431,DOOD_USDT,short,0.004349,27.0,100.0,0.004338,27.0,TP HIT
|
30
|
+
1758141205990,DOOD_USDT,short,0.004329,27.0,100.0,0.004328,27.0,TP HIT
|
31
|
+
1758143858528,USELESS_USDT,long,0.2244,53.0,1.0,0.2251,53.0,TP HIT
|
32
|
+
1758145026924,LAUNCHCOIN_USDT,long,0.08684,13.0,10.0,0.08734,13.0,TP HIT
|
33
|
+
1758145705087,LAUNCHCOIN_USDT,short,0.08849,13.0,10.0,0.08817,13.0,TP HIT
|
34
|
+
1758145766769,DOOD_USDT,short,0.004341,27.0,100.0,0.004332,27.0,TP HIT
|
35
|
+
1758146013089,DOOD_USDT,long,0.004299,27.0,100.0,0.004313,27.0,TP HIT
|
36
|
+
1758147347733,DOOD_USDT,short,0.004336,27.0,100.0,0.004329,27.0,TP HIT
|
37
|
+
1758147802824,LAUNCHCOIN_USDT,long,0.09033,13.0,10.0,0.09067,13.0,TP HIT
|
38
|
+
1758148938162,DOOD_USDT,short,0.004359,27.0,100.0,0.004346,27.0,TP HIT
|
39
|
+
1758149565888,LAUNCHCOIN_USDT,short,0.09038,13.0,10.0,0.09043,13.0,TP HIT
|
40
|
+
1758149685658,DOOD_USDT,long,0.004368,27.0,100.0,0.004366,27.0,TP HIT
|
41
|
+
1758150463215,LAUNCHCOIN_USDT,short,0.09008,13.0,10.0,0.08968,13.0,TP HIT
|
42
|
+
1758150552216,LAUNCHCOIN_USDT,long,0.08895,13.0,10.0,0.08953,13.0,TP HIT
|
43
|
+
1758153615507,USELESS_USDT,long,0.232,51.0,1.0,0.2319,51.0,TP HIT
|
44
|
+
1758153790450,VINE_USDT,short,0.08327,14.0,10.0,0.08306,14.0,TP HIT
|
45
|
+
1758153891658,USELESS_USDT,long,0.2309,51.0,1.0,0.2309,51.0,TP HIT
|
46
|
+
1758153973913,NAORIS_USDT,short,0.05876,20.0,10.0,0.05878,20.0,TP HIT
|
47
|
+
1758154206740,VINE_USDT,long,0.0846,14.0,10.0,0.08456,14.0,TP HIT
|
48
|
+
1758154703995,VINE_USDT,short,0.08754,13.0,10.0,0.08665,13.0,TP HIT
|
49
|
+
1758156424415,VINE_USDT,long,0.08401,14.0,10.0,0.08404,14.0,TP HIT
|
50
|
+
1758157213849,VINE_USDT,long,0.08408,14.0,10.0,0.08405,14.0,TP HIT
|