Skip to content

Can this MACD Gradient Histogram Included As A New Feature? #594

Open
@DrChandrakant

Description

@DrChandrakant

I Have Taken Inspiration From Trading View MACD Histogram
TCS_2023-03-07_15-35-55

macd_color = []
for i,v in enumerate(df["MACD_histogram"]):
    if df["MACD_histogram"][i] >= 0 and df["MACD_histogram"][i-1] < df["MACD_histogram"][i]:
        macd_color.append('#26A69A')
    elif df["MACD_histogram"][i] >= 0 and df["MACD_histogram"][i-1] > df["MACD_histogram"][i]:
        macd_color.append('#B2DFDB')
    elif df["MACD_histogram"][i] < 0 and df["MACD_histogram"][i-1] > df["MACD_histogram"][i] :
        macd_color.append('#FF5252')
    elif df["MACD_histogram"][i] < 0 and df["MACD_histogram"][i-1] < df["MACD_histogram"][i] :
        macd_color.append('#FFCDD2')
    else:
        macd_color.append('#FFCDD2')

mpl.make_addplot(histogram,type='bar',width=0.7,panel=2, color=macd_color,alpha=1,secondary_y=True),

Trading View

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions