-1

Here is an example of MACD plot using python.

https://code.luasoftware.com/tutorials/algo-trading/python-mplfinance-plot-yfinance-candle-chart-moving-average-macd-and-volume/

I'd like the result (including colors and crossover points, etc.) to be the same as that of tradingview.com

https://www.tradingview.com/script/NDH8bJow-MACD-Colors-Signals/

Could anybody show the python so that it is the same as that of tradingview.com?

user1424739
  • 11,937
  • 17
  • 63
  • 152

1 Answers1

1

Could anybody show the python so that it is the same as that of tradingview.com?

I don't think anyone is going to want to write your code for you.
However what I would recommend is that you work through the mplfinance tutorials on Customizing the Appearance of Your Plots and especially teach yourself about mplfinance styles which shows how to modify the overall color scheme of your plot. See also mplfinance style sheets reference.

For example, to achieve a color scheme similar to trading view you could use the "market colors" from style 'yahoo' and the combine that with mplfinance style 'nightclouds'. Something like this:

mc = mpf.make_marketcolors(base_mpf_style='yahoo')
s  = mpf.make_mpf_style(base_mpf_style='nightclouds',marketcolors=mc)

Then when you call mpf.plot() specify kwarg style=s

hth

Daniel Goldfarb
  • 6,937
  • 5
  • 29
  • 61