Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Feature Request: New style called binance-dark

未关闭
#614 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
matplotlib, python

调研方向

该 issue 提供了一个拟议的 binance_dark 样式字典和一个 mpf.plot 使用示例,但没有指定源文件或测试。首先定位 mplfinance 如何定义并公开 binance 等现有样式,然后将渲染出的图表与附带的预览进行比较。当新样式可通过该库使用,并能生成所要求的深色蜡烛图时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

enhancement

I would like to suggest the addition of a new style for the mplfinance library. The addition of this feature will improve the plot styles since there isn't a good dark style plot yet and will provide a better user experience.

I have copied the binance dark theme color scheme and code it, so I would like to propose a new style called binance_dark or somethink similar in addition to the binance style. Nevetheless, the style could be definitely be improved even more yet I would like to make the first step.

Additional context
Here is an example code snippet that demonstrates how this feature can be implemented:

binance_dark = {
    "base_mpl_style": "dark_background",
    "marketcolors": {
        "candle": {"up": "#3dc985", "down": "#ef4f60"},  
        "edge": {"up": "#3dc985", "down": "#ef4f60"},  
        "wick": {"up": "#3dc985", "down": "#ef4f60"},  
        "ohlc": {"up": "green", "down": "red"},
        "volume": {"up": "#247252", "down": "#82333f"},  
        "vcedge": {"up": "green", "down": "red"},  
        "vcdopcod": False,
        "alpha": 1,
    },
    "mavcolors": ("#ad7739", "#a63ab2", "#62b8ba"),
    "facecolor": "#1b1f24",
    "gridcolor": "#2c2e31",
    "gridstyle": "--",
    "y_on_right": True,
    "rc": {
        "axes.grid": True,
        "axes.grid.axis": "y",
        "axes.edgecolor": "#474d56",
        "axes.titlecolor": "red",
        "figure.facecolor": "#161a1e",
        "figure.titlesize": "x-large",
        "figure.titleweight": "semibold",
    },
    "base_mpf_style": "binance-dark",
}

can = pd.read_csv("data1.csv", parse_dates=True, index_col=0)
# Plot the candlestick chart
mpf.plot(
    can,
    type="candle",
    style=binance_dark,
    title="BTCUSDT",
    ylabel="Price ($)",
    ylabel_lower="Volume",
    volume=True,
    mav=(2, 4, 6),
    update_width_config=dict(candle_linewidth=0.5, candle_width=0.5),
)
Here is a preview of how the style of the plot looks like

output

主要语言
Python
星标
4.4k
派生
678
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

matplotlib/mplfinance 的其他 Issue

查看 matplotlib/mplfinance 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。