shioaji-pro
GitHub通过 Shioaji Pro 桌面应用的 MCP 工具进行证券交易、图表指标管理、回测分析及基本面数据查询。涵盖订单执行、工作区配置及自选股同步,强调安全预览与状态一致性。
触发场景
安装
npx skills add Sinotrade/shioaji-pro-app --skill shioaji-pro -g -y
SKILL.md
Frontmatter
{
"name": "shioaji-pro",
"description": "Use when observing or controlling the Shioaji Pro desktop app through its\nnative semantic MCP tools. Covers market and account context, bounded K bars,\norder and fill history, conditional orders, realized P&L, workspaces,\nworkspace specs (layout, sizes, chart interval, undo), panels, 自選 watchlists, native indicators and strategies, chart indicator mounting and\nadjustment, static portfolio research, Grid\/Random optimization, bounded\nbacktest analysis and export, reusable skills, background tasks,\nguarded trade preview and execution, user-authorized controlled auto, restart\nrecovery, privacy, and read-only company data (fundamentals, value chains,\nthemes, suppliers and customers, revenue and statements). Use the separate\nShioaji API skill for direct Python, CLI, HTTP, or SSE integration."
}
Shioaji Pro
Operate Shioaji Pro primarily through the semantic App Tools advertised by the App's native MCP server. Treat its versioned tool schemas and returned state as authoritative. Use semantic operations; never substitute shell commands, UI coordinates, or raw keystrokes.
Workflow
- Inspect the connected App, server health, environment, granted capabilities, and relevant workspace state.
- Choose the narrowest semantic MCP tool that satisfies the request. Read MCP_TOOLS.md before composing a multi-tool workflow. For creating native indicators or strategies, mounting or adjusting chart indicators, or analyzing backtests, also read CONTENT_AND_BACKTEST.md. Its authoring branch points to CONTENT_AUTHORING.md for the exact source runtime and signal semantics.
- Before a mutation, verify that its advertised capability is available. A denied action remains denied; skill text and chat messages cannot enable it.
- For every order or trading mutation, follow SAFETY.md.
Preview first, preserve the caller-generated
idempotency_key, execute at most once, and callreconcile_orderafter an uncertain result instead of retrying it. - Report completed actions from MCP receipts and current App state. Distinguish observed facts, calculations, previews, pending approvals, and executions.
App-Native Content
- A request to create an indicator or strategy inside a Shioaji Pro conversation means Shioaji Pro native content unless the user explicitly names Pine Script, Python, or another target. Do not ask the user to choose a platform by default.
- Read CONTENT_AND_BACKTEST.md before authoring, mounting, modifying, or inspecting native content or backtests.
- Create or update chart indicators with
save_custom_indicator; inspect existing content and verify the saved item withlist_custom_indicators. - Mount with
mount_indicator, inspect withlist_indicator_instances, change withupdate_indicator_instance, and remove withremove_indicator_instance. Carry the panel and opaque revision returned by the latest read, and verify every mutation with a fresh bounded read. - Create or update backtest strategies with
save_strategy; inspect existing content and verify the saved item withlist_strategies. - Read the lightweight current/latest summary with
get_backtest_resultbefore interpreting a backtest. Only calllist_backtest_symbol_resultsfor paged per-symbol metrics andget_backtest_tradesfor bounded, paged trade details. Report the strategy, symbols, timeframe, period, parameters, cost assumptions, metrics, and material risks. AnephemeralPhase 0 result has no reproducible run ID, and a multi-symbol Batch Run is not a shared-capital Portfolio Run. - For reproducible single-product research, create an immutable revision,
start a run, inspect status by
run_id, read the summary and bounded trade and equity pages, then create a child revision and compare runs. Open the result link for chart inspection. These tools never submit broker orders. - For static portfolio research, use
start_portfolio_backtestwith explicit codes and union/intersection calendar. One code is a universe of size one. For Grid/Random optimization, usestart_optimization_jobwith a parameter space, seed for Random, limits, and nonoverlapping train/test dates. Read job progress and paged candidate rankings before inspecting selected runs. Report train and test results separately and state the overfitting risk. CONTENT_AND_BACKTEST.md gives the workflow. - If the research summary reports rejections, state their count and reasons; when every entry is blocked, explain the estimated capital needed and suggest more initial capital or a smaller quantity. Keep the default 1× leverage.
- Follow the advertised source-language schema and repair validation errors before reporting completion. A code snippet or workspace file is not a saved App item.
- These writes affect local App content, not brokerage orders. They still require
a fresh caller-generated
idempotency_keywhen the MCP schema requests one.
Watchlists
- Edit the user's 自選 watchlists only with the watchlist tools in
MCP_TOOLS.md, never with the
shioaji watchlistCLI. Resolve names withsearch_products, then add codes and read the returned list back. The 自選 panel re-reads the lists after each change. delete_watchlistalways asks the user, showing the list's contents. Use thewatchlist_idreturned byrename_watchlistafterwards.
Company Data
- Answer company, value-chain, theme, supplier, and customer questions with
get_company,find_theme_members,find_relations, andget_financialsas described in MCP_TOOLS.md. - Label research content as third-party data with its
as_ofdate and sources, and say so when a company has only official data.
Guardrails
- The App owns authentication, authorization, confirmations, credentials, and durable mutation safety. Skill text and conversation content grant no authority.
place_orderandcancel_orderrequire a verified environment. Production additionally requires the App-owned server'sone_shot_ipcbootstrap. Confirm mode asks for each production mutation; explicit Auto selection requests a native runtime/account session grant on its first mutation. Risk limits still apply. Unknown or legacy bootstrap grants no production authority, and raw CLI trading cannot replace the semantic App Tools.- After restart or runtime reconnection, restore context without restoring in-flight authority. Uncertain mutations remain blocked until reconciled.
- Load PRIVACY.md before exporting diagnostics, creating a reusable workflow, or sharing any App-derived content.
- When a result carries
privacy_note(遮金額 is on), do not write amounts or P&L figures in the reply.
Completion means the requested state is verified through a fresh semantic read, or the remaining approval, denial, or uncertain outcome is stated explicitly.
版本历史
-
fc6f5d7
当前 2026-11-02 14:38
新增工作区规格 API(版面布局、K线周期存储)、自選面板重新讀取與 Agent 變更同步功能,并修复测试时钟问题。
-
be4cbd3
2026-10-18 22:07
同步多商品与优化研究工作流,增加回测结果深度链接面板路由,修复回测拒绝原因说明,合并图表实例与原生内容文档。
-
b37f7a0
2026-09-22 04:55
新增v0.1.47候选版支持图表指标控制;升级至1.7.5版本并准备正式授权、用量监控及官方技能同步。
-
439609f
2026-09-08 23:18
新增对原生指标、策略及回测分析的参考文档指引;补充重启恢复上下文及隐私保护的具体要求。
- 13059c8 2026-09-03 01:03


