Comments (9)
@Mitchell-kw-Lee
Please take a look at the "widths" documentation for the new mplfinance api. Let me know if that allows you to do what you want. Alternatively propose the enhancement to apply to the new api.
Please note that original_flavor.py
will be deprecated sometime this year, and no changes will be made, since all functionality provided by "original flavor" is also provided in the new api.
from mplfinance.
@DanielGoldfarb .First of all, thanks for your guide.
I'm afraid that cannot be actually archive my goal...
I have wrote whole new code as below.
df : DataFrame = pd.DataFrame.from_dict(data=_recordSet, orient='columns')
df.index = pd.DatetimeIndex(df['date_at'])
setup = dict(type='candle',volume=False,figscale=1.0)
mc = mpf.make_marketcolors(up='red',down='blue', wick='inherit', edge='inherit')
style = mpf.make_mpf_style(base_mpf_style='yahoo')
mpf.plot(df,
tight_layout=True,
**setup,
update_width_config=dict(candle_linewidth=4),
#scale_width_adjustment=dict(candle_linewidth=0.4),
style=style,
figratio = (1.5,2.0),
savefig='testsave.png'
)
It shows below that has an issue.
The figure show the wick bolder than original 1pixel line. But It also enlarge candle body's border as well.
What I'm looking for is that the way to enlarge the wick line only with no touch candle body's border.
Is it archivable with current version of the mplfinance?
from mplfinance.
@Mitchell-kw-Lee
It seems it's not currently possible. As you can see here the same line width parameter is used for the wick and for the edge of the candle body.
However this could be a somewhat easy change to mplfinance to have two separate width parameters. Inside the width_config
we could simply add a new item, 'wick_linewidth'
, to be used independently from 'candle_linewidth'
here.
We would have to take some care to be backwards compatible for those users who are already specifying 'candle_linewidth'
. Seems to me the simplest way to do that is if 'wick_linewidth'
is not specified, then 'candle_linewidth'
applies to both (gets copied into 'wick_linewidth'
), but if 'wick_linewidth'
is specified by the caller, then 'candle_linewidth'
and 'wick_linewidth'
are used independently. This would be simplest.
Alternatively we could create a new width_adjuster_version
... 'v2'
and in v2
not worry about backwards compatibility but always treat 'candle_linewidth'
and 'wick_linewidth'
independently.
What do you think?
from mplfinance.
@DanielGoldfarb Thanks for the reply. By quick reading all of those are seems reasonable(I know you are the guru on this).
So, 'wick_linewidth' would be great rather than making new interface.
Would you please proceed and release the version which support 'wick_linewidth' sooner or later?
from mplfinance.
@DanielGoldfarb Please don't miss the feature that setting color for 'wick_linewidth' as candle border color.
Thank you.
from mplfinance.
@Mitchell-kw-Lee
wick and edge color control is already available via mpf.make_marketcolors()
See here: https://github.com/matplotlib/mplfinance/blob/master/examples/styles.ipynb
from mplfinance.
@Mitchell-kw-Lee
Support for 'wick_linewidth' can happen sooner if you are willing to contribute code. I can certainly guide you through the process (if you are unfamiliar with the fork/clone/pull-request process) and will code-review and help test.
from mplfinance.
@Mitchell-kw-Lee Support for 'wick_linewidth' can happen sooner if you are willing to contribute code. I can certainly guide you through the process (if you are unfamiliar with the fork/clone/pull-request process) and will code-review and help test.
@DanielGoldfarb I have no idea how to proceed it. If you want, let's do this quick.
And there are following questions,
- How to write the changed code to meet your expectation
- what tools I need? Git? only?
- And...learn the process by some blogs, right?
from mplfinance.
@Mitchell-kw-Lee
Sorry for the delayed reply. Please see https://github.com/matplotlib/mplfinance/blob/master/CONTRIBUTING.md#fork-clone-workflow and comments at the bottom there about coding standards.
Please take a shot at modifying the code according to my suggestions here and the above contributing guidelines. If you have any specific questions feel free to ask.
I recommend that once you have a clone on your local machine, assuming you are the only user on that machine, install mplfinance with pip install -e ./
(Do this from within the top level mplfinance directory.) This will install mplfinance directly from your clone, and create an "editable" install, meaning that any changes you make will be immediately reflected in the installed mplfinance on your machine (following a re-import
). This makes development and testing easier since you won't have to re-install every time you make a change.
If you do share a machine with others (who also may be using mplfinance) then do the same as above but in a python virtual environnment so that only you see the version you are working on.
Let me know if you have any questions. Thanks. --Daniel
from mplfinance.
Related Issues (20)
- Feature Request: Alternating Background Color
- during save to image file to the disk, there are some noise...how to fix these issue? HOT 2
- Adding ConciseDateFormatter displays dates from 1970 HOT 10
- Bug Report: Is there a typo in src/mplfinance/plotting.py, line 946: fig.suptitle(title,**title_kwargs) HOT 1
- how to get OHLC return values and trend from renko plot HOT 1
- Issue while trying to get_ydata of an EMA from a fig or from the axes HOT 3
- Subplot and panel work fine when they use separately, but mix up when I try to use them in same figure, how can I solve? HOT 8
- Feature Request: HOT 2
- How do i get renko values without ploting the chart? HOT 2
- weird orange line appearing in axes' .plot() HOT 1
- Parabolic Sar and supertrend for renko
- Assist to draw Simple Moving Average. HOT 2
- I just don't know who to ask…. HOT 1
- mplfinance warn if user passes an empty data set. HOT 1
- 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
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.