Add WebSocket real-time quote subscription support#2
Draft
Conversation
- Create subscription manager for WebSocket-based quote push - Add subscribe/unsubscribe directories for file-based subscription control - Integrate subscription processing into controller main loop - Update README with WebSocket subscription documentation Co-authored-by: JetSquirrel <20291255+JetSquirrel@users.noreply.github.com>
JetSquirrel
reviewed
Feb 13, 2026
|
|
||
| 通过 WebSocket 订阅后,行情数据会自动实时更新,无需手动触发: | ||
|
|
||
| ```bash |
Owner
There was a problem hiding this comment.
如果文件中堆积了很多数据,模型在查看的时候,会全部 stdout 出来,然后把上下文窗口占满
应该是由分页机制,cat 设置数据长度 limit,可以通过参数查看下一页
Contributor
Author
There was a problem hiding this comment.
Added pagination examples throughout the documentation to prevent context overflow:
- K-line data:
jq '.[0:10]' file.jsonfor slicing arrays - Beancount ledger:
tail -50,head -50,sed -n '100,150p'for viewing ranges - PnL/Portfolio:
jq '.positions[0:5]'when many holdings
Small files like overview.json are noted as safe for direct cat viewing.
Commit: 9d894ab
JetSquirrel
approved these changes
Feb 13, 2026
Owner
- Add jq slicing examples for K-line and historical data - Add tail/head/sed examples for beancount.txt ledger - Add pagination for pnl.json and portfolio.json when many positions - Clarify which files are small vs large to guide appropriate viewing methods Co-authored-by: JetSquirrel <20291255+JetSquirrel@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements WebSocket-based quote subscriptions for efficient real-time market data updates, as an alternative to the existing poll-based track file approach.
Changes
New subscription manager (
internal/market/subscribe.go)QuoteContext.Subscribe()OnQuote()handleroverview.jsonandoverview.txton price changesFile-based subscription interface
quote/subscribe/- Create files to subscribe (e.g.,touch quote/subscribe/AAPL.US)quote/unsubscribe/- Create files to unsubscribeController integration
Documentation improvements
jqslicing for K-line arrays,tail/head/sedfor beancount ledgercat) vs large (require pagination)Usage
WebSocket subscription provides low-latency real-time updates for monitoring positions and watchlists, while track files remain available for one-shot fetches of historical data (K-lines, intraday).