Repository navigation
v0.1.8
What's New
QuoteSync — Real-time Quote Snapshots
Subscribe to Shioaji streaming (Tick/BidAsk), maintain local Snapshot objects, and query locally — no repeated api.snapshots() calls.
from sj_sync import QuoteSync
qs = QuoteSync(api)
qs.subscribe(["2330", "2317"])
snaps = qs.snapshots(["2330"]) # zero API callsFeatures:
subscribe()with delta logic (only subscribes new QuoteTypes)unsubscribe()with partial support (e.g. remove BidAsk, keep Tick)snapshots()accepts bothList[Contract]andList[str]- User callback chaining for Tick/BidAsk (STK + FOP)
- Initial snapshot fetch via
api.snapshots()with batch support
Snapshot fields updated by subscription type:
| Subscription | Fields |
|---|---|
Tick |
close, open, high, low, volume, total_volume, amount, total_amount, tick_type, average_price, change_price, change_rate, change_type |
BidAsk |
buy_price, buy_volume, sell_price, sell_volume |
Full Changelog: v0.1.7...v0.1.8