@dsh-ft/dsh-fft-paper-trading 0.6.0 → 0.6.2
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.
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/lib/agent/format.d.ts.map +1 -1
- package/lib/agent/format.js +4 -0
- package/lib/agent/format.js.map +1 -1
- package/lib/agent/tools.d.ts.map +1 -1
- package/lib/agent/tools.js +5 -3
- package/lib/agent/tools.js.map +1 -1
- package/lib/client.js +76 -13
- package/lib/contract.d.ts.map +1 -1
- package/lib/contract.js +3 -1
- package/lib/contract.js.map +1 -1
- package/lib/core/risk.d.ts.map +1 -1
- package/lib/core/risk.js +10 -2
- package/lib/core/risk.js.map +1 -1
- package/lib/core/views.js +2 -2
- package/lib/core/views.js.map +1 -1
- package/lib/data/ftshare-trading-calendar.d.ts +47 -12
- package/lib/data/ftshare-trading-calendar.d.ts.map +1 -1
- package/lib/data/ftshare-trading-calendar.js +156 -44
- package/lib/data/ftshare-trading-calendar.js.map +1 -1
- package/lib/service/paper-service.d.ts +1 -1
- package/lib/service/paper-service.d.ts.map +1 -1
- package/lib/service/paper-service.js +24 -12
- package/lib/service/paper-service.js.map +1 -1
- package/lib/service/rpc.d.ts.map +1 -1
- package/lib/service/rpc.js +12 -1
- package/lib/service/rpc.js.map +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/CHANGELOG.md +98 -0
- package/node_modules/@ftshare-lab/dsh-kline/README.en.md +116 -26
- package/node_modules/@ftshare-lab/dsh-kline/README.md +125 -25
- package/node_modules/@ftshare-lab/dsh-kline/chart_service.py +38 -0
- package/node_modules/@ftshare-lab/dsh-kline/cordis.patch.yml +3 -9
- package/node_modules/@ftshare-lab/dsh-kline/core/calc.py +63 -269
- package/node_modules/@ftshare-lab/dsh-kline/core/rows.py +15 -3
- package/node_modules/@ftshare-lab/dsh-kline/core/ta_engine.py +99 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/candle-sequence.js +15 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/chart-annotations.js +33 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/chart-applications.js +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/chart-context.js +12 -3
- package/node_modules/@ftshare-lab/dsh-kline/lib/chart-observation.js +91 -2
- package/node_modules/@ftshare-lab/dsh-kline/lib/chart-sources.js +64 -13
- package/node_modules/@ftshare-lab/dsh-kline/lib/client.js +3356 -787
- package/node_modules/@ftshare-lab/dsh-kline/lib/drawing-feedback.js +96 -19
- package/node_modules/@ftshare-lab/dsh-kline/lib/fibonacci.js +18 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/index.js +19 -2
- package/node_modules/@ftshare-lab/dsh-kline/lib/labeled-polyline.js +17 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/price-bands.js +55 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/price-series.js +47 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/price-sticks.js +32 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/candle-sequence.d.ts +2 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-annotations.d.ts +4 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-context.d.ts +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-observation.d.ts +2 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/BetterSidebarTab.d.ts +3 -2
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/ClassicShell.d.ts +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/chart-context.d.ts +1 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/client-context.d.ts +14 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/conversation.d.ts +11 -3
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/embed.d.ts +2 -2
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/generated-view.d.ts +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/host-services.d.ts +0 -36
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/index.d.ts +2 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar-contract.d.ts +35 -4
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar-register.d.ts +46 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar-services.d.ts +45 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar.d.ts +21 -36
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/fibonacci.d.ts +5 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/labeled-polyline.d.ts +11 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/price-bands.d.ts +3 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/price-series.d.ts +5 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/price-sticks.d.ts +3 -0
- package/node_modules/@ftshare-lab/dsh-kline/package.json +27 -5
- package/node_modules/@ftshare-lab/dsh-kline/requirements.txt +2 -0
- package/node_modules/@ftshare-lab/dsh-kline/scripts/dsh-mcp-plugin.mjs +27 -0
- package/node_modules/@ftshare-lab/dsh-kline/scripts/run-dsh-kline.mjs +180 -49
- package/node_modules/@ftshare-lab/dsh-kline/server.py +300 -34
- package/node_modules/@ftshare-lab/dsh-kline/tools/annotations.py +119 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/baostock_source.py +176 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/channel_candidates.py +260 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/chart_applications.py +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/tools/chart_context.py +22 -3
- package/node_modules/@ftshare-lab/dsh-kline/tools/chart_edits.py +141 -16
- package/node_modules/@ftshare-lab/dsh-kline/tools/chart_functions.py +466 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/chart_indicators.py +63 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/draw.py +3 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/drawing_feedback.py +13 -7
- package/node_modules/@ftshare-lab/dsh-kline/tools/drawing_interaction.py +117 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/drawing_verification.py +58 -3
- package/node_modules/@ftshare-lab/dsh-kline/tools/fetch.py +164 -40
- package/node_modules/@ftshare-lab/dsh-kline/tools/fibonacci.py +83 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/free_sources.py +78 -21
- package/node_modules/@ftshare-lab/dsh-kline/tools/pivots.py +60 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/polylines.py +125 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/price_bands.py +165 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/price_series.py +162 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/price_sticks.py +114 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/range_candidates.py +170 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/regression_channels.py +87 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/ta_functions.py +228 -0
- package/package.json +3 -3
- package/src/agent/format.ts +3 -0
- package/src/agent/tools.ts +5 -3
- package/src/client/index.js +75 -12
- package/src/contract.ts +3 -1
- package/src/core/risk.ts +10 -2
- package/src/core/views.ts +2 -2
- package/src/data/ftshare-trading-calendar.ts +184 -45
- package/src/service/paper-service.ts +22 -19
- package/src/service/rpc.ts +12 -1
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Nonconvex K-Line Assistant / FT K-Line
|
|
2
2
|
|
|
3
3
|
[简体中文](README.md) | English
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://github.com/FTShare-Lab/dsh_kline/actions/workflows/install.yml) [](https://github.com/FTShare-Lab/dsh_kline/releases) [](#get-started-with-dsh) [](LICENSE)
|
|
6
|
+
|
|
7
|
+
**Supports DeepSeek Harness and Codex.** The DSH plugin is `dsh_kline`; the Codex plugin is `ft-kline`. Both support natural-language K-line analysis and guarded drawing in their desktop chart. Codex in the desktop app has an interactive chart; Codex CLI returns market data, indicators, and structured analysis without an interactive chart.
|
|
6
8
|
|
|
7
9
|
> Quotes and technical analysis are for research and education only, not investment advice.
|
|
8
10
|
|
|
11
|
+
[Features](#what-it-helps-you-do) · [Use with Codex](#use-with-codex) · [Install DSH](#get-started-with-dsh) · [Drawing preview](#preview) · [Drawing tools](#drawing-through-chat-and-the-workbench) · [Data sources](#quotes-and-data-sources)
|
|
12
|
+
|
|
13
|
+
| Environment | Chart and manual drawing | Natural-language drawing | Market data, indicators, analysis |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| DeepSeek Harness Web | Yes | Yes | Yes |
|
|
16
|
+
| Codex desktop | Yes, in an app card | Yes, after opening the current chart session | Yes |
|
|
17
|
+
| Codex CLI | No interactive chart | No chart drawing | Yes, as structured results |
|
|
18
|
+
|
|
19
|
+
The Codex plugin is currently **v0.6.4**, available through this repository's public **FTShare GitHub marketplace**. It is not listed in the official public plugin directory. DSH retains its existing installation path. The DSH screenshots and persistent-watchlist description below apply to DSH Web; see [Codex setup and differences](#use-with-codex) for the separate plugin.
|
|
20
|
+
|
|
9
21
|
## What it helps you do
|
|
10
22
|
|
|
11
23
|
- **Start with a sentence**: ask for a chart, a trend read, or an indicator analysis in natural language.
|
|
12
24
|
- **Explore on your own**: open the K-line workspace, search a name or ticker, and switch among daily, weekly, monthly, quarterly, yearly, and available intraday views.
|
|
13
25
|
- **Read trend and momentum**: use MA, volume, MACD, KDJ, RSI, BOLL, ATR, and VWAP.
|
|
26
|
+
- **Put your analysis on the chart**: create horizontal/trend lines, parallel channels, range boxes, Fibonacci retracements, and ABC polylines by chat or point selection. Preview first; save only when the result looks right.
|
|
27
|
+
- **Explore TA-Lib**: search and run all 201 TA-Lib 0.8.2 functions read-only on the loaded chart. Only selected SMA, EMA, and BBANDS results are directly drawable in this release; the other functions are not advertised as chart objects.
|
|
14
28
|
- **Find price areas**: identify support and resistance, or draw and save your own levels and notes.
|
|
15
29
|
- **Compare and review**: overlay indices or symbols, then select a period to inspect return, range, drawdown, and activity.
|
|
16
30
|
- **Add context**: use Market, Sectors, News, Company, and Dragon & Tiger List views for indices, sector rankings, capital-flow events, news, company profiles, fundamentals, and ownership data.
|
|
@@ -18,15 +32,80 @@ Explore markets, read charts, and find key price levels inside DeepSeek Harness.
|
|
|
18
32
|
|
|
19
33
|
## Preview
|
|
20
34
|
|
|
21
|
-
|
|
35
|
+
Live natural-language example: DeepSeek screened the watchlist for an ABC **candidate** in Wolong Electric, checked the four 0/A/B/C anchors against candles, and used the plugin to draw them. This unedited full-page capture shows the conversation, application result, and visible chart together. The host interprets the pattern; a rules-based candidate is not a verified Elliott-wave conclusion.
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
In the same chart, a follow-up natural-language request adds a descending channel. DeepSeek checks its three-anchor geometry and price deviations; the plugin applies it as a separate object while preserving the ABC labels. The lines are visible, but their trading relevance still requires independent judgment.
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
## Use with Codex
|
|
44
|
+
|
|
45
|
+
The Codex plugin is `ft-kline`, available from the **FTShare** marketplace (`ftshare`). Add the GitHub source once, install the plugin, and use the same source for updates. No ZIP download or source build is required. This is a project-maintained marketplace, not a listing in OpenAI's official public plugin directory.
|
|
46
|
+
|
|
47
|
+
### Install and verify
|
|
48
|
+
|
|
49
|
+
1. Install Git, Node.js **22.19+**, Python **3.11+**, and a Codex client supporting plugins. Enable Python Launcher on Windows; Git Bash and WSL are unnecessary.
|
|
50
|
+
2. Run these commands. The first adds the source and follows CI-validated `main`; the second installs and enables the plugin:
|
|
22
51
|
|
|
23
|
-
|
|
52
|
+
```bash
|
|
53
|
+
codex plugin marketplace add FTShare-Lab/dsh_kline --ref main
|
|
54
|
+
codex plugin add ft-kline@ftshare
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
3. Reopen Codex and ask for a daily chart and its data source. During first-time preparation, ask to check FT K-Line runtime status. Desktop users can expand the chart card, search symbols and use the drawing workbench; CLI returns data and analysis.
|
|
24
58
|
|
|
25
|
-
|
|
59
|
+
After adding the source, you can also reopen the desktop app and select **FTShare → FT K-Line** in the Plugins page. Inspect the source and available plugins with:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
codex plugin marketplace list
|
|
63
|
+
codex plugin list --marketplace ftshare --available --json
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Updates and migration
|
|
67
|
+
|
|
68
|
+
Refresh the existing source, install its current plugin version, then reopen Codex:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
codex plugin marketplace upgrade ftshare
|
|
72
|
+
codex plugin add ft-kline@ftshare
|
|
73
|
+
```
|
|
26
74
|
|
|
27
|
-
|
|
75
|
+
If you previously installed `ft-kline@ftshare-local` from a ZIP, disable that old installation in the Plugins page before enabling `ft-kline@ftshare`, so two sources do not expose duplicate tools. The GitHub source needs access to GitHub; first launch also downloads Python dependencies.
|
|
28
76
|
|
|
29
|
-
|
|
77
|
+
### Install a fixed release ZIP
|
|
78
|
+
|
|
79
|
+
To stay on a fixed release, download `ft-kline-v0.6.4.zip` and its SHA-256 from the [v0.6.4 release](https://github.com/FTShare-Lab/dsh_kline/releases/tag/v0.6.4), verify the hash, and extract to a permanent folder. Replace the quoted path below with that absolute folder path:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
codex plugin marketplace add "/absolute/path/ft-kline-v0.6.4"
|
|
83
|
+
codex plugin add ft-kline@ftshare-local
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Reopen Codex to use it. The ZIP source is `ftshare-local`, separate from the public GitHub source `ftshare`. DSH retains its `dsh-kline-v0.6.4.tgz` package and the installation method below.
|
|
87
|
+
|
|
88
|
+
### First launch and runtime modes
|
|
89
|
+
|
|
90
|
+
First use finds Python and installs dependencies automatically, which can take several minutes. The Node entry completes the handshake and exposes the **complete catalog on the first tools/list**, plus preloadable chart resources. It does not depend on catalog-change notifications. Check `ft_kline_runtime_status` while preparing. Ordinary calls wait briefly, then return `runtime_preparing` if necessary; rejected edits never execute later. Once ready, retry the original request without refreshing tools or reopening the chat. Logs are in `~/.cache/ft-kline/bootstrap.log` or `%LOCALAPPDATA%\ft-kline\bootstrap.log` on Windows.
|
|
91
|
+
|
|
92
|
+
Restart Codex once after upgrading from v0.6.1 to replace its previous status-only startup snapshot. Then request a daily chart directly. Runtime readiness, data delivery and a visibly rendered native chart are separate acceptance checks; a fallback visualization does not satisfy native-plugin acceptance.
|
|
93
|
+
|
|
94
|
+
Default `auto` mode checks the host's declared MCP Apps HTML capability. Supporting hosts get interactive charts and guarded edits; other hosts, including CLI, get structured data and analysis without chart resources or drawing writes. Advanced integrations can explicitly set `FT_KLINE_CLIENT=desktop` or `cli`.
|
|
95
|
+
|
|
96
|
+
Chart edits follow `get_chart_context → prepare_chart_edit → apply_chart_edit → get_chart_edit_status`. Server commits, UI receipts and visual verification remain separate.
|
|
97
|
+
|
|
98
|
+
### Reuse an FTShare key
|
|
99
|
+
|
|
100
|
+
Credential priority is: **plugin-process `FTSHARE_API_KEY` → explicitly configured `FTSHARE_API_KEY_FILE` → temporary App-session key**. An export in an unrelated terminal is not automatically visible to the desktop app.
|
|
101
|
+
|
|
102
|
+
The selected file is reread before provider requests and is never modified or deleted by the plugin. Use JSON `{"version":1,"api_key":"your key"}`. macOS/Linux require owner-only permissions (`chmod 600`); symbolic links are rejected. Status reports only `environment`, `external_file`, `session` or `none`, never the key or path. Codex does not discover DSH credentials or scan `.env`, shell profiles, keychains or other apps; sharing a file requires explicitly configuring its path.
|
|
103
|
+
|
|
104
|
+
Without a key, supported A-share daily-history and index fallbacks remain available. Chart state, results, watchlists and App-entered keys stay in connection memory until the last view closes, disconnect, or 30 idle minutes. User-managed environment/file credentials are not deleted when a chart closes. DSH persistent watchlists are not inherited.
|
|
105
|
+
|
|
106
|
+
See the [v0.6.4 release notes](docs/release-notes-v0.6.4.md) and [acceptance checklist](docs/release-acceptance-v0.6.4.md) for verification and remaining manual desktop checks.
|
|
107
|
+
|
|
108
|
+
## Get started with DSH
|
|
30
109
|
|
|
31
110
|
### 1. Install and enable
|
|
32
111
|
|
|
@@ -38,7 +117,7 @@ dsh plugin --profile web add github:FTShare-Lab/dsh_kline
|
|
|
38
117
|
|
|
39
118
|
The first launch prepares its runtime automatically. Later, update from the marketplace or Settings when a new version is available.
|
|
40
119
|
|
|
41
|
-
The plugin supports macOS, Linux, and native Windows. Install a working DSH Web host and Python 3.
|
|
120
|
+
The plugin supports macOS, Linux, and native Windows. Install a working DSH Web host and Python 3.11 or newer first. On Windows, use the [python.org installer](https://www.python.org/downloads/windows/) with the Python Launcher enabled. Git Bash and WSL are not required. First-launch details are stored in `dsh_kline/bootstrap.log` under the user cache directory; the Windows default is `%LOCALAPPDATA%\dsh_kline\bootstrap.log`.
|
|
42
121
|
|
|
43
122
|

|
|
44
123
|
|
|
@@ -50,22 +129,29 @@ The plugin supports macOS, Linux, and native Windows. Install a working DSH Web
|
|
|
50
129
|
- `Show Tencent's daily chart and mark support and resistance`
|
|
51
130
|
- `Analyze NVIDIA's volume, MACD, and RSI over the past month`
|
|
52
131
|
- `What recent news and fundamentals should I know about this company?`
|
|
132
|
+
- `Draw a blue level at 1300 on the current chart, then change that object to green`
|
|
133
|
+
- `Propose three anchors for a descending channel; explain the deviation and wait for my confirmation`
|
|
134
|
+
- `Screen my watchlist for ABC candidates; verify one symbol's 0/A/B/C pivots on its daily chart before drawing, and tell me whether C is confirmed`
|
|
53
135
|
|
|
54
136
|
**Open the workspace directly**: click the K button on the right, or choose **非凸 K 线助手 / dsh_kline** from the `+` menu where workspace Tabs are available. Search by name or ticker; exchange suffixes are not required.
|
|
55
137
|
|
|
56
|
-
Both entry points
|
|
138
|
+
Both entry points can operate on the same new drawing objects in the active chart. In the chart toolbar, **Draw** opens the drawing workbench: choose a tool, click candles or enter parameters, preview, then confirm. Conversations retain separate chart states; watchlists remain user-level data.
|
|
57
139
|
|
|
58
140
|
## Using the chart
|
|
59
141
|
|
|
60
142
|
1. Search for a company or ticker at the top.
|
|
61
143
|
2. Pick a time range and candle timeframe. Intraday availability depends on the market and data entitlement.
|
|
62
144
|
3. Enable the indicators you need, then pan, zoom, or use the crosshair for detail.
|
|
63
|
-
4. Select **Key levels** for
|
|
145
|
+
4. Select **Key levels** for support and resistance, or **Draw** to choose a drawing tool, pick anchors or enter parameters, and save the preview. Manage your own price lines under **Levels**.
|
|
64
146
|
5. Click two candles in sequence to review return, range, drawdown, and trading activity for that interval.
|
|
65
147
|
6. Select the star beside a symbol to add it to a watchlist.
|
|
66
148
|
|
|
67
149
|
Where a **UI** menu is available, choose Automatic, Classic sidebar, or workspace Tab. Automatic uses the best interface your current Harness supports; when Tabs are unavailable, the regular K-line sidebar continues to work.
|
|
68
150
|
|
|
151
|
+
### Sidebar compatibility
|
|
152
|
+
|
|
153
|
+
DeepSeek Harness provides its own right sidebar, so **Better Sidebar is not required** to open the K-line sidebar. When a compatible Better Sidebar is installed, the plugin can also open the chart as a workspace Tab. This is an optional UI integration, not a requirement for quotes, indicators, or drawing. Use **UI** to choose Automatic, sidebar, or Tab; Automatic selects from the interface capabilities exposed by the current host. Installing Better Sidebar alone does not mean every version and layout has been validated.
|
|
154
|
+
|
|
69
155
|
## Quotes and data sources
|
|
70
156
|
|
|
71
157
|
FTShare is the default optional source. After you configure an API key, the plugin exposes the quote, intraday, news, and company-data capabilities available to your account. Availability differs by market and plan.
|
|
@@ -81,16 +167,16 @@ For safety, the plugin never scans `.env` files, shell configuration, keychains,
|
|
|
81
167
|
|
|
82
168
|
Theme and language follow the DSH host by default. **Settings → Theme/Language** also offers manual choices and a way back to **Follow host (default)**.
|
|
83
169
|
|
|
84
|
-
Without a key, some
|
|
170
|
+
[FTShare's free-plan endpoints](https://market.ft.tech/gateway/doc/p/pb8eizu3) still require a registered API key. Without a key, some historical daily A-share bars can use BaoStock and selected broad-market indices have another free fallback; intraday bars, other markets, and news still depend on source coverage and permissions. Existing valid OHLCV data, including rows supplied by the host, can still drive local indicators and drawing. The UI reports the applicable source or error when data is rate-limited, unavailable, or outside the account's entitlement.
|
|
85
171
|
|
|
86
172
|
## Frequently asked questions
|
|
87
173
|
|
|
88
174
|
**Why is an intraday chart unavailable?**
|
|
89
|
-
Intraday access depends on the symbol's market, your account plan, and the source's currently supported coverage. Test the connection in Data source first
|
|
175
|
+
Intraday access depends on the symbol's market, your account plan, and the source's currently supported coverage. Test the connection in Data source first. Daily, weekly, and monthly views do not require the intraday entitlement, but individual-stock candles still need a working data source; FTShare's free plan requires an API key too.
|
|
90
176
|
|
|
91
177
|
**What if the first launch fails on Windows?**
|
|
92
178
|
|
|
93
|
-
|
|
179
|
+
Inspect `%LOCALAPPDATA%\dsh_kline\bootstrap.log`. From v0.6.4, dependency upgrades reuse a working venv; rebuilding also tries its recorded base interpreter and Desktop's bundled standard Python. Trimmed distributions lacking venv/ensurepip still need a standard Python 3.11+ installation. Check `py -3.11 --version` (newer versions work), or set `DSH_KLINE_PYTHON` to the full `python.exe` path before starting DSH. Correcting the configuration invalidates the old retry delay. Nested bundles no longer need a profile-root K-line package, but bundles pinning an older plugin must update it. DSH installation and Windows sandbox issues remain host-level concerns.
|
|
94
180
|
|
|
95
181
|
**Why do two conversations show different charts?**
|
|
96
182
|
This is intentional: each chart belongs to its conversation, so an analysis in one conversation cannot replace another's chart. Search or start a new analysis in the other conversation when needed.
|
|
@@ -100,11 +186,9 @@ Quotes can be delayed and may differ with adjustment policy, exchange convention
|
|
|
100
186
|
|
|
101
187
|
## For AI and developers
|
|
102
188
|
|
|
103
|
-
###
|
|
189
|
+
### Drawing through chat and the workbench
|
|
104
190
|
|
|
105
|
-
|
|
106
|
-
two-anchor trend segments, three-anchor finite parallel channels, and rectangular ranges.
|
|
107
|
-
Names, blue/green/orange/red colors, channel midlines and rectangle fills are supported.
|
|
191
|
+
On a source-checked current chart, the host can interpret a request and use the plugin's calculate → prepare → apply → verify flow. The workbench exposes the same protected objects for manual selection, preview, and editing. Selected families are horizontal levels, two-anchor trend segments, three-anchor finite parallel channels, rectangular ranges, two-anchor Fibonacci retracements, manually supplied or host-proposed-and-checked ABC anchors, and standalone SMA/EMA lines or BOLL three-line bands. Names, four colors, channel midlines, and rectangle fills are supported. The plugin draws ABC labels; **it does not automatically recognize Elliott waves**, and candidates are not definitive conclusions.
|
|
108
192
|
|
|
109
193
|
Try “draw a blue level at 31.2 called support”, “move support to 30.8; leave everything else”,
|
|
110
194
|
or “propose a descending channel with three anchors and explain deviations; wait for approval”.
|
|
@@ -125,14 +209,14 @@ Foundation scope and limitations:
|
|
|
125
209
|
- Confirmed drawings can restore and be edited after browser refresh within the same host run.
|
|
126
210
|
Conversations are isolated. Returning to a conversation restores its last confirmed drawing
|
|
127
211
|
checkpoint, **not necessarily its last manually selected interval, range or viewport**.
|
|
128
|
-
- AI mouse dragging, undo, cross-process old-chart editing and complete automatic failure
|
|
212
|
+
- Workbench point selection and form editing are supported; AI mouse dragging, undo, cross-process old-chart editing and complete automatic failure
|
|
129
213
|
recovery are not supported. Unknown outcomes stop automatic retries.
|
|
130
|
-
-
|
|
131
|
-
|
|
214
|
+
- **Clear drawings and annotations** asks for confirmation, then removes AI objects,
|
|
215
|
+
analysis annotations, manual drawings, and custom levels for the current symbol and interval.
|
|
216
|
+
Indicators and alerts remain. Request an exact AI target when you want to delete only one object.
|
|
132
217
|
- An object may be outside the visible time/price range. Object state and application receipts
|
|
133
218
|
do not prove screen pixels, professional pattern quality or vendor quote correctness.
|
|
134
|
-
- Minute availability depends on source/permissions; not all markets, minute sizes or operation
|
|
135
|
-
combinations are accepted. Natural-language Fibonacci/waves and Chan analysis are deferred.
|
|
219
|
+
- Minute availability depends on source/permissions; not all markets, minute sizes or operation combinations are accepted. Channels, boxes and ABC labels are not automatically recognized professional patterns. Chan analysis is not included. The 201 TA-Lib functions are primarily read-only; only the selected SMA/EMA/BBANDS outputs have a guarded drawing conversion.
|
|
136
220
|
|
|
137
221
|
Host integration uses `get_chart_context → prepare_chart_edit → apply_chart_edit → get_chart_edit_status`.
|
|
138
222
|
Read fresh context after approval and verify against independently retained approved parameters.
|
|
@@ -141,7 +225,7 @@ measure geometry/check parameters; neither selects patterns or grants drawing pe
|
|
|
141
225
|
Legacy per-family tools manipulate explicit snapshots, not the guarded live-chart workflow.
|
|
142
226
|
|
|
143
227
|
Run `pnpm build:sidebar` and `pnpm test` for the build and complete Node/Python regression suite.
|
|
144
|
-
See the [
|
|
228
|
+
See the [v0.5.0 candidate acceptance notes](docs/release-acceptance-v0.5.0.md) for scope, evidence, and remaining release gates. The full [function guide](docs/chart-functions.md) separates read-only calculations from drawable results.
|
|
145
229
|
First-time automatic dependency preparation needs network access and may take several minutes.
|
|
146
230
|
|
|
147
231
|
### Host-provided Python runtime
|
|
@@ -150,14 +234,20 @@ Ordinary installs default to `DSH_KLINE_RUNTIME_MODE=auto`, preserving existing
|
|
|
150
234
|
|
|
151
235
|
| Environment variable | Meaning |
|
|
152
236
|
| --- | --- |
|
|
153
|
-
| `DSH_KLINE_PACKAGE_ROOT` | Optional absolute plugin package directory;
|
|
237
|
+
| `DSH_KLINE_PACKAGE_ROOT` | Optional absolute plugin package directory; otherwise resolved beside the plugin module, including nested installs. |
|
|
154
238
|
| `DSH_KLINE_PYTHON` | Path to the Python interpreter provided by the host. |
|
|
155
239
|
| `DSH_KLINE_RUNTIME_MODE` | `auto` (default) or `external`. |
|
|
156
240
|
|
|
157
|
-
`external` requires Python 3.
|
|
241
|
+
`external` requires Python 3.11+ with the required dependencies already available. It only validates and launches the service: no venv creation, dependency installation, or interpreter fallback. The host must repair failures. This mode rejects `DSH_KLINE_VENV`, `--prepare-project`, and `--bootstrap-runtime`. `DSH_KLINE_DEFER_BOOTSTRAP` does not trigger background installation in this mode.
|
|
242
|
+
|
|
243
|
+
`DSH_KLINE_PYTHON` must identify the executable file (`python.exe` on Windows), not its directory. Automatic preparation distinguishes `PYTHON_NOT_FOUND`, `PYTHON_VERSION_TOO_OLD`, `PYTHON_EXECUTION_FAILED`, `PYTHON_VENV_UNAVAILABLE`, `PYTHON_DEPENDENCY_INSTALL_FAILED`, and `PYTHON_IMPORT_CHECK_FAILED`; an unusable Windows Store redirector is `PYTHON_STORE_ALIAS`. Candidate paths and outcomes are logged locally, without keys or a dump of the parent environment.
|
|
158
244
|
|
|
159
|
-
|
|
245
|
+
In `external` mode, the host owns the interpreter, dependency search paths, and isolation settings (such as `PYTHONPATH`, `PYTHONNOUSERSITE`, or Windows embedded Python's `._pth`); no other interpreter is discovered. `auto` mode uses the bounded discovery and repair described above. Set `DSH_KLINE_CHART_PORT=0` for a dynamic port. The MCP patch explicitly forwards runtime variables without changes to DSH core.
|
|
160
246
|
|
|
161
247
|
## Updates and license
|
|
162
248
|
|
|
163
249
|
See [Releases](https://github.com/FTShare-Lab/dsh_kline/releases) for version history. This project is released under the [MIT License](LICENSE); frontend provenance is in [PROVENANCE.md](PROVENANCE.md).
|
|
250
|
+
|
|
251
|
+
Maintainers changing tools, annotations, resources or the App bridge must regenerate the packaged catalog with `python scripts/generate-codex-catalog.py`; `--check` and regression tests detect stale catalogs.
|
|
252
|
+
|
|
253
|
+
The public `marketplace/ft-kline/` snapshot is generated from the same Codex package allowlist. After editing source, plugin manifests or README files, run `pnpm sync:codex-marketplace` and commit the generated files. CI runs `pnpm verify:codex-marketplace` and independently starts the directory in Desktop and CLI modes. Do not edit generated files directly; see [marketplace maintenance](marketplace/README.md).
|
|
@@ -1,16 +1,31 @@
|
|
|
1
|
-
# 非凸 K 线助手 /
|
|
1
|
+
# 非凸 K 线助手 / FT K-Line
|
|
2
2
|
|
|
3
3
|
简体中文 | [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://github.com/FTShare-Lab/dsh_kline/actions/workflows/install.yml) [](https://github.com/FTShare-Lab/dsh_kline/releases) [](#开始使用-dsh-版) [](LICENSE)
|
|
6
|
+
|
|
7
|
+
**支持 DeepSeek Harness 和 Codex。** DSH 插件名为 `dsh_kline`;Codex 插件名为 `ft-kline`。两者都能用自然语言分析 K 线,并在桌面图表中创建和修改受控绘图。Codex 桌面版提供交互图表;Codex CLI 提供行情、指标和结构化分析,不显示交互图表。
|
|
6
8
|
|
|
7
9
|
> 行情与技术分析用于研究和学习,不构成投资建议。
|
|
8
10
|
|
|
11
|
+
[功能](#它能帮你做什么) · [Codex 使用与安装](#在-codex-中使用) · [DSH 安装与入口](#开始使用-dsh-版) · [自然语言绘图演示](#预览) · [绘图能力](#绘图对话与工作台共用一个对象流程) · [数据源](#行情与数据源)
|
|
12
|
+
|
|
13
|
+
| 运行环境 | 图表与手动绘图 | 自然语言绘图 | 行情、指标与分析 |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| DeepSeek Harness Web | 支持 | 支持 | 支持 |
|
|
16
|
+
| Codex 桌面版 | 支持,图表在应用卡片中打开 | 支持,需先取得当前图表会话 | 支持 |
|
|
17
|
+
| Codex CLI | 无交互图表 | 无图表落图 | 支持,返回结构化结果 |
|
|
18
|
+
|
|
19
|
+
Codex 版目前为 **v0.6.4**,可添加本仓库的公开 **FTShare GitHub 插件源**后安装;尚未上架官方公共插件目录。DSH 版沿用原有安装方式。下面的 DSH 截图和持久化自选说明只针对 DSH Web,Codex 的会话与安装差异见[下文](#在-codex-中使用)。
|
|
20
|
+
|
|
9
21
|
## 它能帮你做什么
|
|
10
22
|
|
|
11
23
|
- **一句话开始分析**:直接说“看看紫金矿业最近一个月趋势”或“分析英伟达的 MACD 和 RSI”。
|
|
12
24
|
- **自己动手看图**:打开 K 线工作台,搜索名称或代码,随时切换日、周、月、季、年和可用的分钟周期。
|
|
13
25
|
- **看清趋势与信号**:支持 MA、成交量、MACD、KDJ、RSI、BOLL、ATR、VWAP 等常用指标。
|
|
26
|
+
- **把分析画在图上**:用对话或图上选点创建水平线、趋势线、平行通道、平台框、斐波那契和 ABC 折线标注;先预览,再决定是否保存。
|
|
27
|
+
- **让 AI 继续修改**:宿主可按自然语言调用同一绘图链,按稳定 ID 改价、改色、修改锚点或删除;绘图计算和应用结果分开核对。
|
|
28
|
+
- **查询标准技术函数**:TA-Lib 0.8.2 的 201 个函数可在当前图只读查询和计算;并非 201 个都能绘图。第一期只有 SMA、EMA、BBANDS 的受控结果可直接落图。详见[函数说明](docs/chart-functions.md)。
|
|
14
29
|
- **寻找价格区域**:一键分析支撑位和压力位;也可以自己画水平价位线、添加备注,并在本机保存。
|
|
15
30
|
- **比较与复盘**:叠加指数或标的、框选两个时间点查看涨跌、振幅、回撤和成交统计。
|
|
16
31
|
- **补充研究信息**:在“市场、板块、资讯、公司、龙虎榜”中浏览指数、板块排行、资金异动、新闻、公司画像、财务与股东信息。
|
|
@@ -18,15 +33,84 @@
|
|
|
18
33
|
|
|
19
34
|
## 预览
|
|
20
35
|
|
|
21
|
-
|
|
36
|
+
自然语言实测:DeepSeek 从自选中筛出卧龙电驱的 ABC **候选**,逐根核对 0、A、B、C 四个锚点,再通过插件落图。同一张完整网页截图展示了对话、应用回执和右侧画布;画布上的折线与标签已实际可见。形态判断由宿主完成,规则筛查不等于专业波浪结论。
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
继续用自然语言在同一张图上添加下降通道:DeepSeek 核对三点几何与区间内的价格偏离,插件将通道作为独立对象落图;原有 ABC 标注仍保留。图上的线条可见,但通道是否具有交易参考价值仍需自行判断。
|
|
41
|
+
|
|
42
|
+

|
|
43
|
+
|
|
44
|
+
## 在 Codex 中使用
|
|
45
|
+
|
|
46
|
+
Codex 插件名为 `ft-kline`,公开源名称为 **FTShare**(标识 `ftshare`)。添加一次 GitHub 源后即可安装,后续从同一个源更新,无需下载 ZIP 或构建源码。该源由本项目维护,尚未上架 OpenAI 官方公共插件目录。
|
|
47
|
+
|
|
48
|
+
### 安装、启动与验证
|
|
49
|
+
|
|
50
|
+
1. 先安装 Git、Node.js **22.19+**、Python **3.11+** 和支持插件的 Codex。Windows 推荐启用 Python Launcher;不要求 Git Bash 或 WSL。
|
|
51
|
+
2. 在终端执行下面两条命令。第一条添加公开源并跟随经过 CI 验证的 `main`;第二条安装并启用插件:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
codex plugin marketplace add FTShare-Lab/dsh_kline --ref main
|
|
55
|
+
codex plugin add ft-kline@ftshare
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
3. 重新打开 Codex,然后说“打开招商银行日 K,显示数据来源”。首次准备期间可先查询“检查 FT K-Line 运行状态”。桌面端可展开图表卡片,搜索、切换标的并使用绘图工作台;CLI 只返回数据和分析。
|
|
59
|
+
|
|
60
|
+
添加源后,也可以重新打开桌面应用,在插件页面选择 **FTShare → FT K-Line** 安装。可用下面的命令检查源和插件列表:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
codex plugin marketplace list
|
|
64
|
+
codex plugin list --marketplace ftshare --available --json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 更新与旧安装迁移
|
|
68
|
+
|
|
69
|
+
以后更新时刷新已添加的源,再安装该源的当前版本,最后重新打开 Codex:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
codex plugin marketplace upgrade ftshare
|
|
73
|
+
codex plugin add ft-kline@ftshare
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
如果此前从 ZIP 安装了 `ft-kline@ftshare-local`,请在插件页面停用旧安装,再启用 `ft-kline@ftshare`,避免同时加载两个来源的同名工具。GitHub 源需要访问 GitHub;首次启动还需要联网下载 Python 依赖。
|
|
77
|
+
|
|
78
|
+
### 固定版本 ZIP 安装
|
|
79
|
+
|
|
80
|
+
如需固定在发布版本,也可从 [v0.6.4 发布页](https://github.com/FTShare-Lab/dsh_kline/releases/tag/v0.6.4) 下载 `ft-kline-v0.6.4.zip` 和同名 SHA-256 文件,核对后解压到长期保留的目录。将下面路径换成实际解压目录;含空格时保留引号:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
codex plugin marketplace add "/absolute/path/ft-kline-v0.6.4"
|
|
84
|
+
codex plugin add ft-kline@ftshare-local
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
重新打开 Codex 后即可使用。ZIP 源标识为 `ftshare-local`,与公开 GitHub 源 `ftshare` 分开维护。DSH 沿用 `dsh-kline-v0.6.4.tgz` 安装包及下文的 DSH 安装方式。
|
|
88
|
+
|
|
89
|
+
### 首次准备与运行模式
|
|
90
|
+
|
|
91
|
+
首次连接会自动寻找可用 Python 并准备依赖,可能需要数分钟。Node 入口先完成握手,并从**第一次工具查询**就提供该宿主模式的完整工具目录和图表资源,不依赖工具列表变更通知。准备期间可查询 `ft_kline_runtime_status`;普通调用会短暂等待,仍未就绪则明确返回 `runtime_preparing`,不会延迟执行已退回的绘图操作。准备完成后直接重试原请求,无需刷新目录或重开对话。失败详情见 `~/.cache/ft-kline/bootstrap.log`,Windows 为 `%LOCALAPPDATA%\ft-kline\bootstrap.log`。
|
|
22
92
|
|
|
23
|
-
|
|
93
|
+
从 v0.6.1 升级后重启一次 Codex,以替换此前只包含状态工具的启动快照;然后直接请求“打开招商银行日 K”。已就绪、数据返回和原生画布实际可见分别验证,备用绘图不计为插件原生验收。
|
|
24
94
|
|
|
25
|
-
|
|
95
|
+
Codex 入口默认按宿主声明的 MCP Apps HTML 能力选择模式:具备图表能力时提供交互图表和受控绘图;其他宿主(包括 CLI)只提供行情、指标与结构化分析。未声明图表能力的宿主不会收到无法使用的绘图工具。高级接入可显式设置 `FT_KLINE_CLIENT=desktop` 或 `cli`;普通安装保持默认 `auto` 即可。
|
|
26
96
|
|
|
27
|
-
|
|
97
|
+
自然语言修改当前图使用 `get_chart_context → prepare_chart_edit → apply_chart_edit → get_chart_edit_status`;服务端提交、应用界面回执和实际画布观察分别核对。CLI 不提供交互图表。
|
|
28
98
|
|
|
29
|
-
|
|
99
|
+
### 已有 FTShare Key 如何复用
|
|
100
|
+
|
|
101
|
+
Codex 依次使用:
|
|
102
|
+
|
|
103
|
+
1. **启动插件的进程环境**中的 `FTSHARE_API_KEY`;仅在另一个终端执行过 `export`,不代表桌面应用也能继承。
|
|
104
|
+
2. 用户明确指定的 `FTSHARE_API_KEY_FILE`,每次取数前重新读取;文件由用户管理,插件不修改、不清除。JSON 格式为 `{"version":1,"api_key":"你的 Key"}`;macOS/Linux 必须限制为仅当前用户可读写(`chmod 600`),不接受符号链接。
|
|
105
|
+
3. 图表“设置 → 数据源”输入的临时 Key,仅当前 App 会话使用。
|
|
106
|
+
|
|
107
|
+
没有 Key 仍可尝试部分 A 股历史日线及免费指数备用源。Codex **不自动扫描** DSH、`.env`、shell、钥匙串或其他应用的配置;如需共享已有文件,必须明确设置上述文件路径。状态只显示 `environment`、`external_file`、`session` 或 `none`,不回显 Key 或路径。
|
|
108
|
+
|
|
109
|
+
图表、函数结果、自选和应用内临时 Key 保存在当前连接内存中;最后一个图表视图关闭、连接结束或空闲 30 分钟后清除。Codex 不继承 DSH 的持久化自选。环境变量和显式文件由用户管理,不会随图表关闭而被插件删除。
|
|
110
|
+
|
|
111
|
+
发布内容、自动化验证和仍待完成的桌面人工验收见 [v0.6.4 发布说明](docs/release-notes-v0.6.4.md) 与 [验收说明](docs/release-acceptance-v0.6.4.md)。
|
|
112
|
+
|
|
113
|
+
## 开始使用 DSH 版
|
|
30
114
|
|
|
31
115
|
### 1. 安装并启用
|
|
32
116
|
|
|
@@ -38,7 +122,7 @@ dsh plugin --profile web add github:FTShare-Lab/dsh_kline
|
|
|
38
122
|
|
|
39
123
|
首次启动会自动准备所需运行环境。以后有新版本时,在插件市场或设置页更新即可。
|
|
40
124
|
|
|
41
|
-
插件支持 macOS、Linux 和原生 Windows。用户需要先安装可运行的 DSH Web,以及 Python 3.
|
|
125
|
+
插件支持 macOS、Linux 和原生 Windows。用户需要先安装可运行的 DSH Web,以及 Python 3.11 或更高版本;Windows 推荐使用 [python.org](https://www.python.org/downloads/windows/) 安装包并启用 Python Launcher。插件不要求 Git Bash 或 WSL。首次启动的依赖安装日志位于用户缓存目录下的 `dsh_kline/bootstrap.log`;Windows 默认为 `%LOCALAPPDATA%\dsh_kline\bootstrap.log`。
|
|
42
126
|
|
|
43
127
|

|
|
44
128
|
|
|
@@ -50,30 +134,40 @@ dsh plugin --profile web add github:FTShare-Lab/dsh_kline
|
|
|
50
134
|
- `分析腾讯控股日 K,标注支撑位和压力位`
|
|
51
135
|
- `查看英伟达最近一个月的成交量、MACD 和 RSI`
|
|
52
136
|
- `这只股票最近有什么新闻和基本面变化?`
|
|
137
|
+
- `在当前图画1300元的蓝色支撑线,叫关键支撑;之后把它改成绿色`
|
|
138
|
+
- `请先给出下降通道的三个锚点和偏离,再等我确认是否落图`
|
|
139
|
+
- `从我的自选中筛选 ABC 候选;选一只核对 0、A、B、C 四个拐点后画到日 K 图上,并说明 C 点是否已经确认`
|
|
53
140
|
|
|
54
141
|
**直接打开工作台**:点击右侧 K 按钮,或在支持工作台 Tab 的界面从 `+` 菜单选择 **非凸 K 线助手 / dsh_kline**。输入股票名称或代码即可开始,不需要记住交易所后缀。
|
|
55
142
|
|
|
56
|
-
|
|
143
|
+
两种入口可操作同一张当前图中的新绘图对象;也可以在图表工具栏打开 **绘图**,从精选工具中点选 K 线锚点、预览、确认。每个对话各自保存图表状态,避免串图;自选与分组属于用户级数据,跨对话保留。
|
|
57
144
|
|
|
58
145
|
## 图表怎么用
|
|
59
146
|
|
|
60
147
|
1. 用顶部搜索框输入标的名称或代码。
|
|
61
148
|
2. 选择时间范围和 K 线周期;分钟线是否可用取决于数据权限和市场。
|
|
62
149
|
3. 开启需要的指标,拖动、缩放或使用十字线查看细节。
|
|
63
|
-
4. 点击 **关键点位**
|
|
150
|
+
4. 点击 **关键点位** 查看支撑和压力;点击 **绘图** 选择工具,在图上点选锚点或输入参数,核对预览后保存。自己的价位线可在 **点位** 管理。
|
|
64
151
|
5. 依次点击两根 K 线,查看这段区间的涨跌、振幅、回撤与成交统计。
|
|
65
152
|
6. 点击名称旁的星标,把标的放进自选。
|
|
66
153
|
|
|
67
154
|
如果界面提供 **UI** 入口,可按习惯选择自动、独立侧栏或工作台 Tab。自动模式会使用当前 Harness 能提供的最佳界面;没有工作台 Tab 框架时,仍可正常使用右侧 K 线侧栏。
|
|
68
155
|
|
|
69
|
-
|
|
156
|
+
### 界面兼容
|
|
70
157
|
|
|
71
|
-
|
|
158
|
+
DeepSeek Harness 自带右侧栏,**不安装 Better Sidebar 也能打开 K 线侧栏**。如果安装了可用的 Better Sidebar,插件还可以把 K 线作为工作台 Tab 打开;它是可选的界面增强,不是行情、指标或绘图的前提。右上角 **UI** 可在自动、侧栏与 Tab 模式间切换;自动模式会按当前宿主提供的界面能力选择。不同 Better Sidebar 版本的适配情况可能不同,不能仅凭安装了它就保证所有布局都已验收。
|
|
159
|
+
|
|
160
|
+
## 绘图:对话与工作台共用一个对象流程
|
|
161
|
+
|
|
162
|
+
在当前已核对来源的图表中,宿主可根据自然语言调用插件的计算、准备、应用和状态核对;工作台则提供可见的手动选择和预览。精选范围包括:
|
|
72
163
|
|
|
73
164
|
- 水平线:指定价位、名称、颜色。
|
|
74
165
|
- 两点趋势线:连接已有 K 线的两个时间 / 价格锚点。
|
|
75
166
|
- 平行通道:三点确定上升、下降或水平通道,可开关中线。
|
|
76
167
|
- 平台矩形框:指定时间和上下价格边界,可开关淡色填充。
|
|
168
|
+
- 斐波那契回撤:两点及比例作为一个对象管理;价位由插件按价格公式计算。
|
|
169
|
+
- ABC 折线标注:连接用户指定、或由宿主基于行情提议并核对的 0/A/B/C 锚点,可按点名续改;**插件不自动识浪,候选并非定论**。
|
|
170
|
+
- SMA、EMA 单线与 BOLL 三轨:TA-Lib 结果可在明确要求后作为独立主图对象落图,不等于切换现有指标开关。
|
|
77
171
|
|
|
78
172
|
例如:
|
|
79
173
|
|
|
@@ -87,19 +181,19 @@ dsh plugin --profile web add github:FTShare-Lab/dsh_kline
|
|
|
87
181
|
不内置另一套 AI,也不靠预置绘图 skill 回放。明确参数可直接执行;要求先提方案时,
|
|
88
182
|
确认前不绘制。宿主分析和解释可能出错,专业画线质量仍需使用者核对。
|
|
89
183
|
|
|
90
|
-
###
|
|
184
|
+
### 当前范围与限制
|
|
91
185
|
|
|
92
186
|
- 重点验收日线 / 周线。锚点必须对应当前已加载的真实 K 线,不会猜日期、吸附端点或自动取新行情补点。
|
|
93
187
|
- 支持蓝、绿、橙、红四种颜色。两点线和通道为有限区间,不自动延伸,不支持对数通道。
|
|
94
188
|
- 修改按稳定对象 ID 定位,绘图不重置行情、指标或可见范围;通道和平台框按创建周期隔离。
|
|
95
189
|
- 当前宿主运行期间,同一对话已确认图形可在网页刷新后恢复并继续修改;不同对话不共用绘图对象。
|
|
96
190
|
返回对话恢复最后确认的绘图检查点,**不保证恢复离开前最后一次手动选择的周期、范围或视口**。
|
|
97
|
-
-
|
|
98
|
-
-
|
|
191
|
+
- 工作台支持表单与图上点选,已确认的新对象可由对话或工作台按 ID 续改;鼠标拖拽和撤销暂不支持。旧手动画线、自动标注与受保护对象分开管理。
|
|
192
|
+
- **清除图形与标注** 会先确认,再清除当前标的、当前周期的 AI 图形、分析标注、手动画线和自定义点位;指标与预警保留。只想删除一个 AI 图形时,可在对话中指定目标。
|
|
99
193
|
- 图形可能超出当前时间 / 价格可见区。对象核对和应用回执不等于屏幕像素核验,也不证明供应商行情真值。
|
|
100
194
|
- 来源过期、周期 / 复权不明、多个活动视图或结果未知时停止修改;不要自动重做未知操作。
|
|
101
195
|
完整服务重启后的旧图编辑和完整异常自动恢复尚不支持。
|
|
102
|
-
- 分钟功能取决于来源与权限,本版不承诺全部分钟 / 市场 /
|
|
196
|
+
- 分钟功能取决于来源与权限,本版不承诺全部分钟 / 市场 / 操作组合。通道、平台、ABC 均不代表自动专业形态识别;缠论未接入。201 个 TA-Lib 函数大多只读,不承诺全部可绘制。
|
|
103
197
|
|
|
104
198
|
### 给宿主与开发者
|
|
105
199
|
|
|
@@ -109,7 +203,7 @@ dsh plugin --profile web add github:FTShare-Lab/dsh_kline
|
|
|
109
203
|
二者不选点、不评判专业形态、不代替绘图授权。旧的分类型工具是快照接口,不应绕过当前图应用协议。
|
|
110
204
|
|
|
111
205
|
运行 `pnpm build:sidebar` 和 `pnpm test` 验证构建与全部 Node / Python 回归。
|
|
112
|
-
|
|
206
|
+
DSH 绘图范围见[v0.5.0 验收说明](docs/release-acceptance-v0.5.0.md),本版安装与 Codex 验证见[v0.6.4 验收说明](docs/release-acceptance-v0.6.4.md)。
|
|
113
207
|
首次自动准备依赖需要网络,耗时取决于网络和本机环境。
|
|
114
208
|
|
|
115
209
|
## 行情与数据源
|
|
@@ -119,24 +213,24 @@ dsh plugin --profile web add github:FTShare-Lab/dsh_kline
|
|
|
119
213
|
普通 A 股当日1分钟、none不复权请求优先使用 FTShare 的实时一分钟数据;前 / 后复权请求(含qfq / hfq)使用携带匹配adjust_kind的历史接口,失败时不混入原始实时数据。指数、ETF 与多日分钟历史继续使用各自适用的历史接口;完整交易时段与缓存复权隔离规则不变。此分流不等于对供应商复权价格正确性的独立验证。
|
|
120
214
|
分钟粒度随明确来源、重绘及工作区状态保留;元数据缺失或非法时仍为未知,不按K线时间间隔 / 界面标签猜测,也不继承上一标的粒度。来源未确认时继续禁止受保护绘图。
|
|
121
215
|
|
|
122
|
-
|
|
216
|
+
DSH 版会按以下顺序复用 FTShare 凭据:当前 DSH 服务已注入的 `FTSHARE_API_KEY`、用户显式指定的 `FTSHARE_API_KEY_FILE`、DSH 的 FTShare 设置所保存的 Key,以及此前由本插件保存的本机凭据。也就是说,若你已把 Key 配给启动 DSH 的环境,插件会直接使用;仅安装 FTShare SDK、或把 Key 留在其他应用的私有配置中,并不会被自动读取。
|
|
123
217
|
|
|
124
218
|
DSH 中安装了 FTShare 设置插件时,宿主会把设置里的 Key 发布给 MCP 服务,插件在每次取数前重新读取,因此在设置页新增、更换或清除 Key 后无需重启 dsh;该 Key 由设置页管理,插件不会显示或清除它。
|
|
125
219
|
|
|
126
|
-
出于安全考虑,插件不会扫描 `.env`、shell 配置、钥匙串或其他应用的配置文件,也不会显示 Key 或文件路径。**设置 → 数据源** 会清楚标出当前来源;需要更换时,在“管理 FTShare 配置”中粘贴 Key
|
|
220
|
+
出于安全考虑,插件不会扫描 `.env`、shell 配置、钥匙串或其他应用的配置文件,也不会显示 Key 或文件路径。**设置 → 数据源** 会清楚标出当前来源;需要更换时,在“管理 FTShare 配置”中粘贴 Key 并测试连接,DSH 版可选择仅本次使用,或保存到本机供下次启动加载;Codex 版仅提供会话临时输入,或读取用户明确指定的外部文件。
|
|
127
221
|
|
|
128
222
|
主题和语言默认跟随 dsh 宿主,可在 **设置 → 主题/语言** 中改为手动选择;随时可切回“跟随宿主(默认)”。
|
|
129
223
|
|
|
130
|
-
|
|
224
|
+
[FTShare 的“免费版”接口](https://market.ft.tech/gateway/doc/p/pb8eizu3)仍需注册并配置 API Key。完全不配置 Key 时,部分 A 股历史日 K 可尝试 BaoStock 备用源,部分大盘指数也有免费备用行情;分钟线、其他市场及新闻等能力仍取决于来源与权限。已有的合规 K 线数据(包括宿主提供的标准 OHLCV)仍可用于本地指标计算与绘图。遇到限流、权限不足或上游暂不可用,界面会说明实际原因和数据来源。
|
|
131
225
|
|
|
132
226
|
## 常见问题
|
|
133
227
|
|
|
134
228
|
**为什么找不到分钟线?**
|
|
135
|
-
|
|
229
|
+
分钟行情是否可用取决于标的市场、账户套餐和数据源当前支持范围。请先在“数据源”中测试连接;日、周、月等周期不受分钟权限限制,但个股 K 线仍需可用的数据源,FTShare 免费套餐也需要 API Key。
|
|
136
230
|
|
|
137
231
|
**Windows 首次启动失败怎么办?**
|
|
138
232
|
|
|
139
|
-
|
|
233
|
+
先查看 `%LOCALAPPDATA%\dsh_kline\bootstrap.log`。v0.6.4 起,依赖更新优先复用现有 venv;重建时会尝试已记录的基础解释器和 Desktop 随附的标准 Python。裁剪版 Python 缺少 venv/ensurepip 时仍需另装 Python 3.11+。可执行 `py -3.11 --version`(更高版本也可以),或在启动 DSH 前将 `DSH_KLINE_PYTHON` 设为 `python.exe` 的完整路径;修正后无需等旧失败记录冷却。嵌套 bundle 安装不再要求 profile 根存在 K 线包,但固定旧版依赖的 bundle 仍需更新。DSH 自身安装或 Windows sandbox 问题请参考 DSH 文档。
|
|
140
234
|
|
|
141
235
|
**为什么两个对话显示不同的图?**
|
|
142
236
|
这是刻意设计:图表会绑定各自对话,避免 A 对话的分析覆盖 B 对话。需要在另一个对话查看时,直接搜索或重新发起分析即可。
|
|
@@ -156,14 +250,20 @@ FTShare 只是默认适配器,不是分析引擎的前提。调用方可以把
|
|
|
156
250
|
|
|
157
251
|
| 环境变量 | 含义 |
|
|
158
252
|
| --- | --- |
|
|
159
|
-
| `DSH_KLINE_PACKAGE_ROOT` |
|
|
253
|
+
| `DSH_KLINE_PACKAGE_ROOT` | 可选的插件包根目录绝对路径;未设置时从插件模块自身定位,支持嵌套安装。 |
|
|
160
254
|
| `DSH_KLINE_PYTHON` | 宿主提供的 Python 解释器路径。 |
|
|
161
255
|
| `DSH_KLINE_RUNTIME_MODE` | `auto`(默认)或 `external`。 |
|
|
162
256
|
|
|
163
|
-
`external` 模式要求 Python 3.
|
|
257
|
+
`external` 模式要求 Python 3.11+ 和所需依赖已经可用,只校验并启动服务,不创建 venv、不安装依赖、不回退到其他解释器;失败应由宿主修复。该模式不能与 `DSH_KLINE_VENV`、`--prepare-project` 或 `--bootstrap-runtime` 同时使用。`DSH_KLINE_DEFER_BOOTSTRAP` 在该模式下不触发后台安装。
|
|
258
|
+
|
|
259
|
+
`DSH_KLINE_PYTHON` 必须指向解释器文件本身(Windows 为 `python.exe`),不能填目录。自动准备失败时,日志会区分 `PYTHON_NOT_FOUND`、`PYTHON_VERSION_TOO_OLD`、`PYTHON_EXECUTION_FAILED`、`PYTHON_VENV_UNAVAILABLE`、`PYTHON_DEPENDENCY_INSTALL_FAILED` 和 `PYTHON_IMPORT_CHECK_FAILED`;不可用的 Windows Store 重定向入口标为 `PYTHON_STORE_ALIAS`。候选路径与结果仅用于本机诊断,不记录密钥或完整环境变量。
|
|
164
260
|
|
|
165
|
-
|
|
261
|
+
`external` 模式由宿主负责解释器、依赖搜索路径及隔离配置(例如 `PYTHONPATH`、`PYTHONNOUSERSITE` 或 Windows 嵌入式 Python 的 `._pth`),不自动探测其他解释器。`auto` 模式的补装和有限解释器探测如上所述。需要动态端口时设置 `DSH_KLINE_CHART_PORT=0`。环境变量在 MCP patch 中显式转交,无需修改 DSH 核心。
|
|
166
262
|
|
|
167
263
|
## 更新与许可
|
|
168
264
|
|
|
169
265
|
更新记录见 [Releases](https://github.com/FTShare-Lab/dsh_kline/releases)。本项目采用 [MIT License](LICENSE),前端来源说明见 [PROVENANCE.md](PROVENANCE.md)。
|
|
266
|
+
|
|
267
|
+
维护者修改工具参数、注解、资源或 App 桥接代码后,运行 `python scripts/generate-codex-catalog.py` 更新随包目录;`--check` 与回归测试会阻止过期目录进入发布包。
|
|
268
|
+
|
|
269
|
+
公开 GitHub 源中的 `marketplace/ft-kline/` 由同一 Codex 打包清单生成。修改源码、插件声明或 README 后,运行 `pnpm sync:codex-marketplace` 并提交生成结果;CI 通过 `pnpm verify:codex-marketplace` 检查文件一致性,并独立验证该目录的桌面及 CLI 启动。不要直接修改生成目录,维护说明见 [marketplace/README.md](marketplace/README.md)。
|
|
@@ -37,6 +37,7 @@ from tools.calc import run_calc_metrics
|
|
|
37
37
|
from core.rows import validate_rows, RowsValidationError
|
|
38
38
|
from core.adjustment import normalize_adjustment, adjustment_error
|
|
39
39
|
from tools.draw import draw_kline
|
|
40
|
+
from tools.chart_indicators import calculate_chart_indicators
|
|
40
41
|
from tools.watchlist import get_watchlist_state, save_watchlist_state
|
|
41
42
|
from tools.fetch import (
|
|
42
43
|
configure_ftshare_api_key,
|
|
@@ -102,6 +103,7 @@ CHART_API_ACTIONS = frozenset(
|
|
|
102
103
|
"analyze_kline",
|
|
103
104
|
"analyze_key_levels",
|
|
104
105
|
"calc_range",
|
|
106
|
+
"calculate_chart_indicators",
|
|
105
107
|
"fetch_candles",
|
|
106
108
|
"fetch_comparison_candles",
|
|
107
109
|
"fetch_security_workspace",
|
|
@@ -309,6 +311,42 @@ def _http_analyze_kline(args: dict[str, Any]) -> dict[str, Any]:
|
|
|
309
311
|
|
|
310
312
|
|
|
311
313
|
def _tool_dispatch(name: str, args: dict[str, Any]) -> dict[str, Any]:
|
|
314
|
+
if name.startswith('workbench_'):
|
|
315
|
+
try:
|
|
316
|
+
from tools.lines import LineError
|
|
317
|
+
from tools.ta_functions import run_ta
|
|
318
|
+
from tools.chart_functions import run_function
|
|
319
|
+
from tools.chart_edits import ChartEdit, prepare_chart_edit
|
|
320
|
+
from tools.chart_applications import request_chart_apply, read_edit_status
|
|
321
|
+
if name == 'workbench_run_ta':
|
|
322
|
+
if args.get('name') not in {'SMA', 'EMA', 'BBANDS'}:
|
|
323
|
+
return {'ok': False, 'error': 'workbench_function_not_selected'}
|
|
324
|
+
return run_ta(**args)
|
|
325
|
+
if name == 'workbench_run_chart_function':
|
|
326
|
+
if args.get('function') not in {'fibonacci_retracement', 'parallel_channel', 'range_box', 'labeled_polyline',
|
|
327
|
+
'channel_candidates', 'range_candidates'}:
|
|
328
|
+
return {'ok': False, 'error': 'workbench_function_not_selected'}
|
|
329
|
+
return run_function(**args)
|
|
330
|
+
if name == 'workbench_prepare_edit':
|
|
331
|
+
edit = ChartEdit.model_validate(args['edit'])
|
|
332
|
+
curated = {'horizontal_line', 'trend_line', 'channel', 'rectangle', 'fibonacci_retracement', 'labeled_polyline', 'series_line', 'price_band'}
|
|
333
|
+
if edit.kind not in curated and not (edit.action == 'delete' and edit.kind in {'text_annotation', 'number_annotation', 'icon_annotation', 'price_sticks', 'all_drawings'}):
|
|
334
|
+
return {'ok': False, 'error': 'workbench_kind_not_selected'}
|
|
335
|
+
return prepare_chart_edit(**{k: v for k, v in args.items() if k != 'edit'}, edit=edit)
|
|
336
|
+
if name == 'workbench_apply_edit':
|
|
337
|
+
return request_chart_apply(args['context_ref'], args['candidate_chart_session'])
|
|
338
|
+
if name == 'workbench_edit_status':
|
|
339
|
+
return read_edit_status(args['context_ref'], args['candidate_chart_session'])
|
|
340
|
+
return {'ok': False, 'error': 'unsupported_chart_action'}
|
|
341
|
+
except (LineError, ValueError, TypeError, KeyError) as exc:
|
|
342
|
+
return {'ok': False, 'error': getattr(exc, 'code', 'invalid_workbench_request'), 'message': str(exc)}
|
|
343
|
+
except OSError:
|
|
344
|
+
return {'ok': False, 'error': 'workbench_storage_unavailable', 'message': '绘图结果暂时无法保存,图表未修改。'}
|
|
345
|
+
if name == "calculate_chart_indicators":
|
|
346
|
+
try:
|
|
347
|
+
return calculate_chart_indicators(**args)
|
|
348
|
+
except (TypeError, ValueError) as exc:
|
|
349
|
+
return {"ok": False, "error": "invalid_indicator_request", "message": str(exc)}
|
|
312
350
|
if name == "analyze_key_levels":
|
|
313
351
|
return _http_key_levels(args)
|
|
314
352
|
if name == "analyze_kline":
|