Giter VIP home page Giter VIP logo

Comments (9)

DanielGoldfarb avatar DanielGoldfarb commented on May 27, 2024

@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.

mic-user avatar mic-user commented on May 27, 2024

@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.
image

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.

DanielGoldfarb avatar DanielGoldfarb commented on May 27, 2024

@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.

mic-user avatar mic-user commented on May 27, 2024

@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.

mic-user avatar mic-user commented on May 27, 2024

@DanielGoldfarb Please don't miss the feature that setting color for 'wick_linewidth' as candle border color.
Thank you.

from mplfinance.

DanielGoldfarb avatar DanielGoldfarb commented on May 27, 2024

@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.

DanielGoldfarb avatar DanielGoldfarb commented on May 27, 2024

@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.

mic-user avatar mic-user commented on May 27, 2024

@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.

DanielGoldfarb avatar DanielGoldfarb commented on May 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.