Comments (6)
Hello Daniel,
Thank a lot for all of this explanations
I've understand what I have to do
It will be done within the next few days
Hugo
from mplfinance.
Presently there is no way. We can look into possibly having mpf.plot()
return values that it calculates.
from mplfinance.
I'd like to. This feature would be awesome.
I could contribute but I don't know how to do this at all...
from mplfinance.
I'd like to. This feature would be awesome.
I could contribute but I don't know how to do this at all...
I will be happy to guide you in making this enhancement. Give me a day or two to finish up my current enhancement, and I will provide some design/coding guidance to get you started.
In the meantime, you may want to familiarize youself with the code here starting with plotting.py, and mpf.plot()
. You can email any questions about the code to me at [email protected] (or post them here). Thank you.
from mplfinance.
Ok thank you
from mplfinance.
@WHug0 - I hope you are doing well, and had a chance to familiarize yourself with the code. I will outline here changes needed for this request. I assume you know basic GitHub workflow (fork, clone, code, commit, push, pull-request) but if not let me know I will review it with you.
Regarding returning renko values, moving averages, and anything else mpf.plot()
might calculate, I don't think we should return these things as the return value of the function, because mpf.plot()
already has an option to return the Figure
and Axes
, and we should not confuse things by having the return value of mpf.plot()
sometimes be plotting objects and sometimes be data.
I propose that you create a new kwarg, return_calculated_values
, and the user wanting the calculated data would pass a variable containing an empty dict as the value for that kwarg, and mpf.plot()
will fill that empty dict with the calculated values. Thus, for example:
retdata = {}
mpf.plot(df, type='renko', mav=(10,20), return_calculated_values=retdata)
The kwarg should be added to _valid_plot_kwargs()
with a default value of None
, and its validator should check to make sure the user passes only an empty dict.
All of the possible calculated values are available in this general vicinity of the code. These include brick_values
, new_dates
, mavprices
, and only for the case of type=renko
the variable volumes
may contact calculated values (but not for other plot types). In an appropriate place near that part of the code, you can write code to insert the calculated values into the dict. Here is some pseudo code to give you an idea:
if config['return_calculated_values'] is not None:
retdict = config['return_calculated_values']
if ptype == 'renko':
retdict['renko_bricks'] = brick_values
retdict['renko_dates'] = new_dates
if config['volume']:
retdict[renko_volumes'] = volumes
if mavgs is not None:
for mav in mavgs:
format a string like 'mav10' for a 10 period mav, etc.
retdict['mav25'] = mavprices
That's the basic idea. Let me know if you have any questions, or if you want me to look at the code before you submit a pull request (after is fine too).
All the best. --Daniel
from mplfinance.
Related Issues (20)
- I just don't know who to ask…. HOT 1
- mplfinance warn if user passes an empty data set. HOT 1
- Feature Request: The line width argument adding request for 'candlestick_ohlc' about the 'Wick/shadow' part(above/blow line) HOT 9
- Bug Report: marketcolors display error when open=close HOT 1
- Bug Report: Typo HOT 1
- How do I create a buy indicator using mplfinance? HOT 1
- Using with `matplotlib.testing.decorators.image_comparison` HOT 6
- PNF ATR Boxsize HOT 4
- Hollow and Filled Candles HOT 1
- Feature Request: Add SubFigures to Mpf_Figure HOT 2
- The example image of price-movement_plots.ipynb is inconsistent with the displayed result. HOT 3
- Interactive plots for OHLC candles with mplfinance HOT 1
- What is the most elegant way to implement ribbons? HOT 4
- Bug Report: legends on panels overlaps
- PnF Reversal Bug
- Bug Report: Errors occur for NaN columns.
- The use of `returnfig=True` creates multiple figures when using ipywidgets
- Custom Candlestick Timeframe HOT 2
- Bug Report: Inconsistent Volume Bar Border Colors Between v0.12.9b7 and v0.12.10b0 When Using make_marketcolors
- missing from current font. FigureCanvasAgg.draw(self)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mplfinance.