Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: mplfinance with inbuilt Technical Analysis and Indicator Plot System #621

Open
DrChandrakant opened this issue Jun 6, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@DrChandrakant
Copy link
Contributor

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
mmmm
bb
mm
mmm
GUI App with mplfinance
pyside6

@DrChandrakant DrChandrakant added the enhancement New feature or request label Jun 6, 2023
@DanielGoldfarb
Copy link
Collaborator

DanielGoldfarb commented Jun 15, 2023

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.

  1. 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 uses mplfinance 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.
  2. 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 for mpf.plot() is already quite complicated and challenging to maintain. I am 90% certain that adding indicators to mpf.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, perhaps mpf.ta_plot() which is a wrapper around mpf.plot(). The user would pass in their DataFrame, and one or more indicators (names, along with adjustable parameters), and mpf.ta_plot() would then do all the work for the caller to generate the plot. Of course users can always still call mpf.make_addplot() and mpf.plot() themselves directly if they choose.
  3. 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.
  4. 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.
  5. 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 separate import, so that users who choose not to use it can avoid the dependency. Even if we use a separate import, I would really like to avoid adding more dependencies.
  6. 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.

@DrChandrakant
Copy link
Contributor Author

  1. 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 on mplfinance to do so, which demonstrates the potential of mplfinance. this is listed under the head of the visualization I wish it stays at the same header but the subheader of mplfinance 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 so mplfinance directly accepts data provided by another package as "OHLCV" with add column like "Ichimoke_column a, Ichimoke_column b,"
  2. Currently mpf.plot() and mpf.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 to mpf.plot() or mpf.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 version mplfinance + indicator concept (df+id_column, indicator = {'kind':'rsi'}) in this case mplfinance internally determines what kind indicator to plot (RSI), where to plot determine which panel to be used, where to fill fill_between and what to shade. alternative make_addplot left for those who wish to plot a custom plot.
  3. We Can Understand your import concern as a maintainer but a strict import 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.
  4. Currently Two Function Built-in mplfinance MAV and EMA are technical analysis tools. similarly, we extending functionality to Bolliger Band Ichimoku, etc.
  5. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants