Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Bug Report: Inconsistent Volume Bar Border Colors Between v0.12.9b7 and v0.12.10b0 When Using make_marketcolors

Đang mở
#676 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
matplotlib, python
Lĩnh vực
data-visualization

Hướng nghiên cứu

Bắt đầu bằng cách chạy mã kiểm thử tối thiểu với mplfinance v0.12.9b7 và v0.12.10b0, tập trung vào make_marketcolors, make_mpf_style và mpf.plot khi volume được bật. Theo dõi cách các màu volume đảo ngược truyền đến các thanh volume và so sánh các đường viền được render. Được xem là hoàn tất khi phiên bản mới hơn tạo ra màu đường viền nhất quán cho các thanh volume với các màu thị trường được yêu cầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Description
When changing the volume colors using make_marketcolors, the results differ between versions v0.12.9b7 and v0.12.10b0. The older version looks fine, but in the newer version, the border color of the volume bars appears inconsistent.

Minimal Test Code

import mplfinance as mpf
import pandas as pd

# Sample data
dates = pd.date_range('2023-01-01', periods=10)
data = {
    'Open': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    'High': [2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
    'Low': [0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5],
    'Close': [2, 1, 4, 3, 6, 5, 8, 7, 10, 9],
    'Volume': [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000]
}
df = pd.DataFrame(data, index=dates)

# Get the 'yahoo' style
yahoo_style = mpf.make_mpf_style(base_mpf_style='yahoo')

# Access the 'yahoo' style market colors
yahoo_market_colors = yahoo_style['marketcolors']

# Reverse the colors
reversed_market_colors = mpf.make_marketcolors(
    up=yahoo_market_colors['candle']['down'],
    down=yahoo_market_colors['candle']['up'],
    edge={'up': yahoo_market_colors['edge']['down'], 'down': yahoo_market_colors['edge']['up']},
    wick={'up': yahoo_market_colors['wick']['down'], 'down': yahoo_market_colors['wick']['up']},
    ohlc={'up': yahoo_market_colors['ohlc']['down'], 'down': yahoo_market_colors['ohlc']['up']},
    volume={'up': yahoo_market_colors['volume']['down'], 'down': yahoo_market_colors['volume']['up']}
)

# Define a new style with reversed colors
reversed_style = mpf.make_mpf_style(base_mpf_style='yahoo', marketcolors=reversed_market_colors)

# Plot the candlestick chart
mpf.plot(df, type='candle', volume=True, style=reversed_style)

Screenshots
v0.12.9b7 (looks fine):
download

v0.12.10b0 (the border color of the volume bars appears inconsistent):
download-1

Ngôn ngữ chính
Python
Star
4.4k
Fork
678
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của matplotlib/mplfinance

Tất cả issue của matplotlib/mplfinance

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.