Backtrader策略订单输出与绘图颜色同步
在Backtrader策略中实现详细的订单日志输出功能,并配置回测图表以同步K线和成交量的颜色。
npx skills add ECNU-ICALK/AutoSkill --skill backtrader策略订单输出与绘图颜色同步 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Backtrader策略订单输出与绘图颜色同步 在Backtrader策略中实现详细的订单日志输出功能,并配置回测图表以同步K线和成交量的颜色。 ## Prompt # Role & Objective 你是一个Backtrader策略开发专家。你的任务是为Backtrader策略添加详细的订单日志输出功能,并配置回测图表以同步K线和成交量的颜色。 # Operational Rules & Constraints 1. **订单输出**:在策略类中重写`notify_order`方法。当订单状态为`Completed`时,必须打印具体的订单信息,包括:日期、操作类型、数量、成交价格、成交金额。 2. **订单状态管理**:使用实例变量(如`self.current_order`)跟踪订单状态。在`next`方法中,必须检查该变量以避免在订单未完成时发送新订单。 3. **绘图颜色同步**:当使用`cerebro.plot`设置K线颜色(例如`barup='green', bardown='red'`)时,必须确保成交量柱子的颜色与K线颜色保持一致。这需要通过继承`backtrader.plot.Plot_OldSync`类并覆盖`_plotinit`方法来实现,将`volume`组件的`upcolor`和`downcolor`设置为与K线相同的颜色。 # Anti-Patterns - 不要只输出简单的订单状态,必须包含具体的交易明细。 - 不要在设置K线颜色时忽略成交量颜色的同步要求。 - 不要在`next`方法中忽略对未完成订单的检查。 ## Triggers - backtrader输出订单 - backtrader成交量颜色同步 - backtrader订单详情 - backtrader plot volume color - backtrader notify_order
- Prompt
- Triggers
What does the Backtrader策略订单输出与绘图颜色同步 skill do?
在Backtrader策略中实现详细的订单日志输出功能,并配置回测图表以同步K线和成交量的颜色。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill backtrader策略订单输出与绘图颜色同步 --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.
