Feature Request: mplfinance with inbuilt Technical Analysis and Indicator Plot System
DrChandrakant opened this issue · 2 comments
mplfinance with inbuild technical parameter calculation.
This Can Be a Big Achievement Because This Module is Completly Dedicated to The Finance Market Ploting.
Over The 120 Great Indicators Available Which Being Used Globally
This Will be the Most Desirable Feature of mplfinance If an Indicator With Length Parameter Pass Through API Within add_plot Return a Complete Plot of the Indicator Parameter
**This Feature I Have Created Locally On My system **
I Have Achieved 43 Primary Indicator Inclusion On My Local System Inviting Suggestions On More Inclusion.
Please Go Through The Following Pull Request's Examples of New Suggestions.
Simarly Successfully integrated mplfinance Pyside6 as GUI App
Sharing Notebook of Direct Indicator Inclusion API Call Through
**All Example plot within mplfinance modification share notebook out but **
https://github.com/DrChandrakant/tr/blob/main/Future_add_on_indicator.ipynb
All New Function Indicators within add_plot
GUI App with mplfinance
This needs to be discussed, and this issue is the perfect place so that others using and contributing to mplfinance
can see the discussion and give their opinions.
I am not fully convinced that mplfinance
should provide technical analysis, but I am also willing to consider the idea. I have some concerns, and I will list them here for consideration and discussion.
- There are already several open source packages available that provide indicators and technical analysis. Those packages can be used together with
mplfinance
to provide visualization of the indicators as in the indicator examples. Also, there is at least one case that I know of (pandas-ta) where the package usesmplfinance
under the hood to provide visualization. I need to be convinced that we are providing some value-added benefit that is not necessarily provided by another half-dozen packages out there. - One possible benefit might be to make it easier for users to plot indicators. For those who are not especially particular about which panels have the analysis, we could make some common choices and the user can then avoid making all of the
mpf.make_addplot()
calls and whatever else is necessary to set up an indicator. I am uncertain as to whether this is benefit enough; maybe. As mentioned above, there is already at least one package that does this to some extent.
3.The following certain in my mind - the code formpf.plot()
is already quite complicated and challenging to maintain. I am 90% certain that adding indicators tompf.plot()
will make it extremely difficult to maintain.- If we decide to add technical analysis to
mplfinance
, I would be inclined to write a new API, perhapsmpf.ta_plot()
which is a wrapper aroundmpf.plot()
. The user would pass in their DataFrame, and one or more indicators (names, along with adjustable parameters), andmpf.ta_plot()
would then do all the work for the caller to generate the plot. Of course users can always still callmpf.make_addplot()
andmpf.plot()
themselves directly if they choose.
- If we decide to add technical analysis to
- Another concern I have, if we take this route, is that mpf styles would need to work with the technical analysis. Many indicator visualizations involve shaded regions. We would have to enhance mpf styles to support various features (such as shading color, and line colors and line types) that indicators commonly have, so that we have color sets that look appropriate for each style.
- I am very grateful to @DrChandrakant for contributing the Indicator Examples to this
mplfinance
repository. Thank you! Perhaps this is the way to go, to simply continue to add and document examples of indicators here, so that others can learn and code them with their own variations and tweaks. - Another concern that I have is I want to avoid increasing the number of packages that
mplfinance
depends upon. If necessary, then the new API could be a separateimport
, so that users who choose not to use it can avoid the dependency. Even if we use a separateimport
, I would really like to avoid adding more dependencies. - I have some other concerns, but I am running out of time right now, and lets get this discussion going. I want to hear ideas about whether and how these concerns can be addressed.
- I agree that there are thousands of packages that provide backtesting, and technical analysis. Most of them provide data in the form of a dataframe or any tabular format. To Visualize this data
mplfinance
or other visualization packages are used. Even other technical analysis packages depend onmplfinance
to do so, which demonstrates the potential ofmplfinance
. this is listed under the head of the visualization I wish it stays at the same header but the subheader ofmplfinance
is 'Financial Data Visualization'. Candlesticks, Bar Graph, Renko, etc are the special plot technique. But We are Missing out on Indicators properly as a visualization tool. In my view, we upgrading it for visualization purposes not for technical analysis purposes with internal calculations. Another alternative is to extend mplfinance with the indicator to go beyond the "OHLCV" data processing method somplfinance
directly accepts data provided by another package as "OHLCV" with add column like "Ichimoke_column a, Ichimoke_column b," - Currently
mpf.plot()
andmpf.make_addplot()
accept more than 40 kwargs to modify the plot of the indicator. Even if the user asks for a feature upgrade there will be the addition of another kwargs tompf.plot()
ormpf.make_addplot()
. which going to become difficult to maintain and adding new features getting more and more complex. For Example, if any user is willing to plot a candlestick chart with mav in the current scenario
mpf.plot( df, type="hollow_and_filled", style= 'tradingview', title = 'TCS-EQ', volume=True, volume_panel = 1, figscale =1.2, figsize = (46,26), scale_width_adjustment = {'volume' : 0.9} mav = (3,6,9), volume_alpha= (a requested feature)
upgraded versionmplfinance
+ indicator concept (df+id_column, indicator = {'kind':'rsi'}) in this casemplfinance
internally determines what kind indicator to plot (RSI), where to plot determine whichpanel
to be used, where to fillfill_between
and what to shade. alternativemake_addplot
left for those who wish to plot a custom plot. - We Can Understand your
import
concern as a maintainer but a strictimport
policy or template for new PR about the indicator section will element this concern. with policy or template maximum permissible import restricted to numpy and pandas which currently mplfinance is using. - Currently Two Function Built-in mplfinance MAV and EMA are technical analysis tools. similarly, we extending functionality to Bolliger Band Ichimoku, etc.
- This upgrade just provides financial visualization of data provided in "OHLCV" data format with internal calculation or OHLCV+other column. ultimately adaptation and upgradation are vital processes of any program.