Mplfinance: Highlighting candlestick patterns.

Created on 2 Sep 2020  路  5Comments  路  Source: matplotlib/mplfinance

What is the best way to highlicht a pattern in a candlestick chart for example by changing their color.
Any help is appreciated as I am new here and using this library for the first time.

question

All 5 comments

i use two horizontal lines for 4 candle narrow ranges and triangles for EMA/SMA breakouts.
Do you mean something like this?

fb_us

Well this could be a good alternative, but I had something like coloring the highlighted candlesticks with brighter colors in mind. Is that even possible?

@simonholzapfel

There is no "best way" to highlight a pattern. It's really just a matter of preference how you want to do it.

In terms of actually modifying the candle colors for some of the candles, mplfinance does not yet support this, but there is a suggestion here for an enhancement that would support doing so. The enhancement suggestion mentions ohlc _bars_, but it can also be made to work for candles.

A good workaround, for now, would be to use fill_between, or to overlay a marker symbol from a scatter plot, as shown in some of the examples below, but to put the marker directly on top of the candle(s) of interest.


Here are some examples of what some people have done:

  1. As Markus noted above: https://github.com/matplotlib/mplfinance/issues/254#issuecomment-685729260
  2. https://github.com/matplotlib/mplfinance/issues/97#issue-601609003
  3. https://user-images.githubusercontent.com/49436733/79945165-84a61500-846d-11ea-8d7c-ec3ac876bdd5.png
  4. https://user-images.githubusercontent.com/11164790/82761057-b04a5100-9dc5-11ea-93e2-dfba0ef00095.png
  5. https://user-images.githubusercontent.com/11164790/76273899-70a7aa80-6255-11ea-8636-f2cff10b3ba8.jpg
  6. fill_between example (from the plot cutomizations tutorial):
    image

  7. Example from the addplot tutorial

image

  1. Some examples from the lines tutorial:

    image
    image
    image

have not found any good suggestions for this.
Parallel to this I am still working with colored dots below/on top, which can be noticed immediately.

ice_amd_us

i use two horizontal lines for 4 candle narrow ranges and triangles for EMA/SMA breakouts.
Do you mean something like this?

fb_us

@fxhuhn I will use this as an alternative until the requested feature gets implemented, thank you for bringing up this solution!
Could you please provide me a code example, so I can figure out how this works?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Full4me picture Full4me  路  3Comments

tessanix picture tessanix  路  5Comments

toksis picture toksis  路  5Comments

smjure picture smjure  路  4Comments

ismailbayram picture ismailbayram  路  4Comments