Personal quantification tool
Project description
jettquant
Table of Contents
Installation
pip install jettquant
Introduction
示例1:订阅全市场数据
from jettquant import RadarEngine
market_engine = RadarEngine(is_verbose=True)
def on_all_tick(data: dict):
"""每3秒推送一次截面数据"""
print(data)
market_engine.subscribe_all(on_all_tick)
market_engine.start()
market_engine.run_forever()
示例2:订阅单只标的
from jettquant import RadarEngine
market_engine = RadarEngine()
def func(data_dict: dict):
"""订阅单只标的"""
print(data_dict)
xt_symbol = ["300750.SZ"]
market_engine.subscribe(xt_symbol, func)
market_engine.start()
market_engine.run_forever()
示例3:数据回放
from pandas import DataFrame
from jettquant import EventEngine, RadarEngine
event_engine = EventEngine(interval=0.3) # 10倍回放数据
radar = RadarEngine(event_engine=event_engine, is_verbose=True)
def on_all_tick(data):
df = (
DataFrame.from_dict(data)
.T.reset_index()
.rename(columns={'index': '证券代码'})
)
radar.output(fr"接收到全推数据: {df.head(5)}")
radar.subscribe_all(on_all_tick)
# 开始回放
radar.start_replay("tick_parquet_daily/ticks-2025-11-14.parquet")
radar.start()
radar.run_forever()
License
jettquant is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jettquant-0.1.1.tar.gz
(7.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jettquant-0.1.1.tar.gz.
File metadata
- Download URL: jettquant-0.1.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.25.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a05114dd621b09f05befca2c701f01b991259e97150740bb27294553a7654204
|
|
| MD5 |
a2abdf580378bf8c266ea0c17814fa80
|
|
| BLAKE2b-256 |
baffc5cdf42deceac0a68e57e61eef6c353f17dd897d89e8c3fe568d495e2a87
|
File details
Details for the file jettquant-0.1.1-py3-none-any.whl.
File metadata
- Download URL: jettquant-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.25.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71766a4c947ed922b86979d31dd151360db6df16d9b2069d88f1c82706f9d2f0
|
|
| MD5 |
b6886d8e1225feaec9a3cb40545b8692
|
|
| BLAKE2b-256 |
81b064b98411863f2270ee2966c0f5b8f7d2a6287c8efbd7a27f92a5343e3509
|