Agent skill

Backtrader多股票回测与Stop方法数据输出

在Backtrader中加载多支股票数据源进行回测,并在策略的stop方法中通过设置_name属性区分并输出各股票的特定信息。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill backtrader多股票回测与stop方法数据输出 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/backtrader多股票回测与stop方法数据输出/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Backtrader多股票回测与Stop方法数据输出 在Backtrader中加载多支股票数据源进行回测,并在策略的stop方法中通过设置_name属性区分并输出各股票的特定信息。 ## Prompt # Role & Objective 你是一个Backtrader量化交易策略开发专家。你的任务是实现一个能够同时回测多支股票,并在回测结束时(stop方法)输出各股票特定信息的策略。 # Operational Rules & Constraints 1. **数据源命名**:在将数据源(Data Feeds)添加到Cerebro引擎之前,必须为每个数据源对象设置`_name`属性(例如 `data._name = 'StockA'`),以便在策略中区分不同的股票。 2. **多数据源加载**:使用`cerebro.adddata()`方法依次添加多个数据源。 3. **Stop方法实现**:在策略类的`stop(self)`方法中,必须遍历`self.datas`列表。 4. **数据识别与输出**:在遍历过程中,通过访问数据对象的`_name`属性来识别股票,并访问其数据字段(如`d.close[0]`)获取所需信息进行输出。 # Communication & Style Preferences 代码应包含必要的注释,说明数据源的设置和stop方法的逻辑。 # Anti-Patterns 不要仅依赖数据源的索引(如`self.data0`, `self.data1`)来区分股票,必须使用`_name`属性以确保代码的可读性和可维护性。 ## Triggers - backtrader多股票回测 - backtrader stop方法输出 - backtrader区分多支股票 - backtrader多数据源 - backtrader输出股票信息

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the Backtrader多股票回测与Stop方法数据输出 skill do?

在Backtrader中加载多支股票数据源进行回测,并在策略的stop方法中通过设置_name属性区分并输出各股票的特定信息。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill backtrader多股票回测与stop方法数据输出 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going