Skip to content

Latest commit

 

History

History
59 lines (53 loc) · 7.27 KB

Indicator.md

File metadata and controls

59 lines (53 loc) · 7.27 KB

Indicators in mplfinance

"Indicators" In the world of investing is a vital tool, indicators typically refer to technical chart patterns deriving from the price, volume, or open interest of a given security.


There are two ways to build indicators in mplfinance:

  • Building a indicator with mpf.addplot() method
  • Inbuilt Indicator Method (Upcoming Feature)

Below is a brief description of each method, with links to tutorials on how to use each method:


  • The mpf.addplot() Method is easy to use and requires little or no knowledge of matplotlib, and no need to import matplotlib.
  • The mpf.addplot() with mpf.make_addplot handles 95% of the most common types of indicators and market studies.
  • The mpf.make_addplot method attains its simplicity, in part, by having certain limitations.
    These limitations are:
    • Large code required for complex indicators.
    • Larger calculation required.
    • Legend box support Limited.
  • The Inbuilt method is adequate for any kind of complex indicator:
    • Complex indicators can be handled.
    • Legend box fully supported
    • With one or more studies/indicators, such as:
      • Ichimoku Cloud, MACD, DMI, RSI, Bollinger, Accumulation/Distribution Oscillator, Commodity Channel Index, Etc.
  • See here for a tutorial and details on implementing the mplfinance for addplot method.
  • The Alphatrend Indicator
    • For Building Alphatrend Indicator with make_addplot. This method helps plot two lines, named k1 and k2. The area between two lines is filled with fill_between method. For color conditional formatting we use the where.
    • Details on how to implement Alphatrend Indicator Over are described below.
        (code examples can be found in the examples/indicators/)
  • Awesome Oscillator
    • Use method make_addplot method Awesome Oscillator Build as Histogram Bar type of plot bar in a new panel with panel method
    • Details on how to implement Awesome Oscillator is described below.
        (code examples can be found in the examples/indicators/)
  • Dochian Channel
    • For Building Dochian Channel with make_addplot. This method helps plot three lines in this indicator, named upper, middle, and lower bands. The area between the upper and lower band is filled with fill_between method.
    • Details on how to implement Dochian Channel Over are described below.
        (code examples can be found in the examples/indicators/)
  • Golden Cross Over
    • For Building Golden Cross with make_addplot we use two moving averages named short-term moving averages and long-term moving averages. When One Line Cross another that point is marked with marker with type scatter. while to change the color of the long-term moving average we use a custom function.
    • Details on how to implement Golden Cross Over are described below.
        (code examples can be found in the examples/indicators/)
  • Ichimoku Cloud
    • For Building Ichimoku Cloud with make_addplot. The following method helps to plot Five lines used in this indicator, named Tenkan-sen, Kijun-sen, Senkou_Span_A, Senkou_Span_B, Chikou_Span. The area between the Senkou_Span_A and Senkou_Span_B is filled with fill_between method.
    • Details on how to implement Ichimoku Cloud are described below.
        (code examples can be found in the examples/indicators/)
  • MACD
    • Use method make_addplot MACD is built as Histogram Bar type of plot bar in a new panel with panel method
    • Details on how to implement MACD are described below.
        (code examples can be found in the examples/indicators/)
  • MACD Histogram
    • Use method make_addplot MACD with Histogram is built as Histogram Bar type of plot bar in a new panel with panel method. For Generating a color list for the histogram we use the custom function.
    • Details on how to implement MACD Histogram are described below.
        (code examples can be found in the examples/indicators/)
  • Relative Strength Index
    • Use methods make_addplot and panel were used to plot rsi
    • Details on how to implement Relative Strength Index are described below.
        (code examples can be found in the examples/indicators/)
  • Parabolic SAR
    • For Building Parabolic SAR with make_addplot. This method helps plot two lines in this indicator, named upper and lower bands. The custom function is used to segregate uptrend and down-trending areas. Which later plot with type scatter
    • Details on how to implement Parabolic SAR are described below.
        (code examples can be found in the examples/indicators/)
  • Supertrend
    • For Building Supertrend with make_addplot. This method helps plot three lines in this indicator, named upper, trendline, and lower bands. when the price is above the trendline area marked uptrend and downtrend with a custom function, The area between the upper band and high of the candle is filled with fill_between method.
    • Details on how to implement Supertrend described below.
        (code examples can be found in the examples/indicators/)