matplotlib / matplotlib/mplfinance
Can this MACD Gradient Histogram Included As A New Feature?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 678
- PR merge metrics
- No merged PRs in 30d
Description
I Have Taken Inspiration From Trading View MACD Histogram

```python
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),
```

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue provides a Python color-selection snippet and TradingView screenshots, but names no repository files or tests. Start by locating the existing MACD histogram and addplot color-handling entry points, then determine how the requested four-state gradient should be exposed and tested; done means histogram bars visibly use those colors based on adjacent values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100