mplfinance icon indicating copy to clipboard operation
mplfinance copied to clipboard

Can this MACD Gradient Histogram Included As A New Feature?

Open DrChandrakant opened this issue 1 year ago • 2 comments

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

DrChandrakant avatar Mar 07 '23 10:03 DrChandrakant

looks interesting. if more people is interested, i can try implement it

alexpvpmindustry avatar Apr 14 '23 13:04 alexpvpmindustry

looks interesting. if more people is interested, i can try implement it

Thanks. If Required I Can Work on Other Indicator People Who Want Just Tag Me

DrChandrakant avatar Apr 14 '23 13:04 DrChandrakant