Skip to content

v0.1.8

Choose a tag to compare

@Yvictor Yvictor released this 11 Mar 04:22
· 42 commits to master since this release
322a02a

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 calls

Features:

  • subscribe() with delta logic (only subscribes new QuoteTypes)
  • unsubscribe() with partial support (e.g. remove BidAsk, keep Tick)
  • snapshots() accepts both List[Contract] and List[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