agentsclimarketplace

Backtrader k线颜色与风格自定义

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/backtrader-k线颜色与风格自定义

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

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

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.7 KB, 435 tokens by cl100k_base, as published. Nobody here has run it

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蜡烛图风格

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.