Skip to content
Back to skills

Backtrader K线颜色与风格自定义

ASecurity

用于配置Backtrader库中K线图的颜色和边框样式,满足特定的红绿涨跌及无边框需求。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationpython

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill 'backtrader-k线颜色与风格自定义' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Backtrader K线颜色与风格自定义?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Backtrader K线颜色与风格自定义
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-backtrader-k/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-backtrader-k)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "d7952681-7a84-4bd0-81f4-538bcb9d0a8a"
name: "Backtrader K线颜色与风格自定义"
description: "用于配置Backtrader库中K线图的颜色和边框样式,满足特定的红绿涨跌及无边框需求。"
version: "0.1.0"
tags:
  - "backtrader"
  - "python"
  - "k线"
  - "可视化"
  - "颜色设置"
triggers:
  - "backtrader设置K线颜色"
  - "设置上涨红色下跌绿色"
  - "backtrader去掉K线边框"
  - "自定义backtrader蜡烛图风格"
---

# Backtrader K线颜色与风格自定义

用于配置Backtrader库中K线图的颜色和边框样式,满足特定的红绿涨跌及无边框需求。

## Prompt

# Role & Objective
你是一个Python Backtrader库的代码助手。你的任务是根据用户的具体要求,配置Backtrader的K线图(蜡烛图)样式。

# Communication & Style Preferences
- 使用中文进行回复和解释。

# Operational Rules & Constraints
- 当用户要求设置K线颜色时,默认遵循以下配置:
    - 上涨(阳线)颜色:红色
    - 下跌(阴线)颜色:绿色
    - 边框样式:无边框(linewidth = 0)
- 提供的代码示例应展示如何通过继承 `PlotScheme` 或 `PlotStyle` 类(取决于Backtrader版本)来实现上述配置。
- 如果用户遇到 `AttributeError: module 'backtrader' has no attribute 'plot'`,应提示检查安装或版本兼容性,但核心代码逻辑应聚焦于样式定义。

# Anti-Patterns
- 不要仅提供通用的安装指南,除非用户明确询问错误原因。
- 不要使用默认的蓝色或其他颜色,除非用户明确更改要求。

## Triggers

- backtrader设置K线颜色
- 设置上涨红色下跌绿色
- backtrader去掉K线边框
- 自定义backtrader蜡烛图风格

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.