Skip to content
Agentmart
Submit a tool

a-share-strategy-allmarket-multi-swing-defensive

A 股全市场高流动性池内按趋势回踩(trend_pullback)产出买入候选与持仓卖出信号;另有 realtime_quotes 批量拉取现价快照。供下单前决策;不跑回测、不自动下单。Use when 用户要选股、看实时报价、判断买卖信号或检查持仓是否触发离场条件。

Skill by shouldnotappearcalm

IndexedMIT★ 253
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/shouldnotappearcalm-a-share-strategy-allmarket-multi-swing-defensive

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

A 股全市场高流动性池内按趋势回踩(trend_pullback)产出买入候选与持仓卖出信号;另有 realtime_quotes 批量拉取现价快照。供下单前决策;不跑回测、不自动下单。Use when 用户要选股、看实时报价、判断买卖信号或检查持仓是否触发离场条件。

Use cases: finance-accounting

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/a-share-strategy-allmarket-multi-swing-defensive

What's inside

Skill name
a-share-strategy-allmarket-multi-swing-defensive
Description
A 股全市场高流动性池内按趋势回踩(trend_pullback)产出买入候选与持仓卖出信号;另有 realtime_quotes 批量拉取现价快照。供下单前决策;不跑回测、不自动下单。Use when 用户要选股、看实时报价、判断买卖信号或检查持仓是否触发离场条件。
License
MIT
Instructions
104 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (10)

  • SKILL.md
  • daily_decisions.py · scripts/
  • __init__.py · scripts/paper_trading/
  • market_data.py · scripts/paper_trading/
  • realtime_quotes.py · scripts/
  • __init__.py · scripts/strategy_lab/
  • indicators.py · scripts/strategy_lab/
  • strategies.py · scripts/strategy_lab/
  • strategy_params.py · scripts/strategy_lab/
  • test_market_universe_filters.py · scripts/

SKILL.md (first lines)

# 全市场多波段防御型 · 决策信号

本 skill 核心做三件事:**选股范围**、**买入侧信号**、**卖出侧信号**;并可选使用 **`realtime_quotes.py`** 对指定代码批量拉取**现价类快照**(基于 `MarketDataProvider.get_quote`,腾讯报价 + 分钟 K 聚合)。
输出的是**决策参考**(结构化列表或 JSON),**不包含**历史回测撮合、**不包含**自动报单;真实下单请用券商或另接 `a-share-paper-trading` 等执行通道。
策略信号定位为**条件有效**:在市场结构与交易成本变化下,信号强度可能衰减,需持续复核。

## 能力边界

| 做 | 不做 |
|----|------|
| 从全市场高流动性股票(含创业板、科创板)中取前 N 只构成当日股票池 | 分钟级回测、混合回测、收益曲线 |
| 用日线 `trend_pullback` 标出入场/离场条件 | 保证收益或替代投顾 |
| 给出两类「买入参考」列表(见下) | 直接向交易所或模拟盘服务下单 |
| 可选:读取持仓列表文件,标出「策略离场」标的 | 替你保存实盘持仓(除非你自建文件) |
| 批量拉取多只股票现价、涨跌幅、涨跌停参考价等(`realtime_quotes.py`) | 替代 `a-share-data` 的全市场实时板块、资金流等重接口 |

## 策略逻辑(与参数)

默认参数见 `scripts/strategy_lab/strategy_params.py`(均线快慢、回踩幅度、RSI 区间与离场 RSI 等)。
信号计算在 `scripts/strategy_lab/strategies.py` 的 `trend_pullback`。
脚本会额外应用两层过滤:

- **成本过滤**:按 `--roundtrip-cost-bps` 估算往返成本,只有 `edge_after_cost > 0` 的候选才进入最终买入列表。
- **鲁棒性过滤**:在 `ROBUSTNESS_PARAM_GRID` 参数邻域内计算 `entry_consensus_ratio`,低于 `--entry-consensus-min` 的候选会被过滤。

**买入参考(两组,请区分语义):**

- **`from_previous_day_close`**:上一根已收盘日线满足 `entry`。与「前一日收盘后出信号、当日再执行」的习惯一致,**更贴近事前计划**。
- **`from_last_close`**:最新一根日线也满足 `entry`,偏**形态展示**;若与上一日重复,请避免重复计数。

列表内按策略内 **`score`(均线强弱)** 降序;默认**每种买入列表最多保留 5 只**(`strategy_params.MAX_BUY_CANDIDATES`),与「同时关注仓位不宜过多」一致。需要更多或全部时加 `--max-buys 0` 表示不截断,或 `--max-buys 10` 等。

**卖出参考:**
对 `--holdings` 文件中的代码,若**最新一根日线**满足 `exit`(破慢线或 RSI 过高等规则内条件),则列入卖出参考。文件格式:一行一只代码,可含注释行(`#` 开头)。

**风控参考(仅文档与 JSON 字段):**
`REFERENCE_INTRADAY_STOP_PCT` 表示历史上与策略文档一致的**日内止损比例参考**,本脚本**不**替你监控盘中止损,需自行在下单软件中设置。

## 环境与依赖

```bash
pip install akshare pandas numpy requests
```

## 运行

```bash
SKILL_DIR="<本 skill 绝对路径>"
python3 "$SKILL_DIR/scripts/daily_decisions.py" --json
```

常用参数:

- `--top-n`:股票池大小,默认 120
- `--max-buys`:买入侧列表在排序后最多保留几条,默认 5;传 `0` 不截断
- `--holdings`:持仓代码文件路径
- `--workers`:拉日线并发数
- `--json`:输出一份 JSON,便于程序消费(JSON 内含截断前数量 `*_total`)
- `--roundtrip-cost-bps`:往返交易成本估计(单位 bps),默认 45
- `--entry-consensus-min`:参数邻域入场一致性阈值,默认 0.67
- `--disable-robust-check`:关闭参数邻域一致性过滤(仅在调试时使用)

示例:

```bash
python3 "$SKILL_DIR/scripts/daily_decisions.py" --top-n 120 --holdings "$HOME/my_holdings.txt"
```

JSON 输出中会同时包含原始候选与过滤后候选:

- `from_previous_day_close_raw` / `from_last_close_raw`:仅满足信号的原始候选
- `from_previous_day_close` / `from_last_close`:通过成本与鲁棒过滤后的候选
- 单条候选附带 `entry_consensus_ratio`、`edge_after_cost`、`cost_filter_passed`、`consensus_filter_passed`
- `todo_confirm_items`:当前采用口径的记录项(roundtrip=45bps、consensus=0.67、RSI 区间偏移)

### 实时行情快照(增强)

对**已知代码列表**批量取报价(并发),可与 `daily_decisions` 输出的代码配合使用:

```bash
python3 "$SKILL_DIR/scripts/realtime_quotes.py" 600519 000001 601318 --json
python3 "$SKILL_DIR/scripts/realtime_quotes.py" -f "$HOME/my_holdings.txt" --workers 10
```

- `--json`:输出统一 JSON(含 `quotes` 与逐条 `details`)
- `--intraday`:额外拉取**最后一根**分钟 K(`--intraday-freq` 默认 `5m`),便于核对与日线快照的时间对齐
- 数据来自 `paper_trading/market_data.py`:与全市场深度行情相比为**轻量快照**,盘中价格随最新分钟 K 更新

## 脚本布局

| 路径 | 作用 |
|------|------|
| `scripts/daily_decisions.py` | 入口:拉池、算信号、打印或 `--json` |
| `scripts/realtime_quotes.py` | 批量现价快照,可选附带最后一根分钟 K |
| `scripts/paper_trading/market_data.py` | 行情与 `get_all_market_universe` |
| `scripts/strategy_lab/strategies.py` | `trend_pullback` |
| `scripts/strategy_lab/indicators.py` | 均线、RSI |
| `scripts/strategy_lab/strategy_params.py` | 默认参数与策略名 |

## 与执行层衔接

若要将信号落到模拟盘,可在 Agent 中组合使用 **`a-share-paper-trading`**:先读本 skill 输出,再调用模拟盘 CLI 或 HTTP API 下单;本 skill **不**依赖模拟盘进程。

From shouldnotappearcalm/a-share-skill, MIT.

More from shouldnotappearcalm/a-share-skill

Signals

Stars
253
Forks
48
Open issues
0
Last commit (this folder)
Sep 28, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from shouldnotappearcalm

Cite this page

a-share-strategy-allmarket-multi-swing-defensive skill. Agent Mart. https://agentmart.dev/skills/shouldnotappearcalm-a-share-strategy-allmarket-multi-swing-defensive (last updated 2026-10-24)