Skip to content

Modified 'candlestick' function in response to request #2546 #3016

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

Closed
wants to merge 1 commit into from

Conversation

jdgd1
Copy link

@jdgd1 jdgd1 commented Apr 28, 2014

  1. Added ability for the candlestick function to use a "light" and "dark" theme
  2. Fill color of candlestick bodies can be user definite and is based upon stock price movement on each given period
  3. In the light theme (which uses a white background) candlestick shadows are dark; ie: Follows traditional candlestick format
  4. In dark theme (which uses black background) candlestick shadows match box colors

1. Added ability for the candlestick function to use a "light" and "dark" theme
2. Fill color of candlestick bodies can be user definite and is based upon stock price movement on each given period
3. In the light theme (which uses a white background) candlestick shadows are dark; ie: Follows traditional candlestick format
4. In dark theme (which uses black background) candlestick shadows match box colors
if theme == 'light':
coloredge = 'k'
coloredgeup = 'k'
coloredgedown = 'k'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of odd that the default behavior is to ignore explicitly passed kwargs. I think it would be better hove have all of the color kwargs default to None. If theme is None, then assume it is 'light'. Then, if coloredge is not None over ride the theme values.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, although looking this over I think I could probably remove the coloredge kwarg since it's either going to be black (if using a light theme) or the candlestick body color (if using a dark theme).

@tacaswell
Copy link
Member

We are looking for some to be responsible for maintenance of the finance module.

@tacaswell tacaswell added this to the v1.4.x milestone Apr 28, 2014
@tacaswell
Copy link
Member

I also don't see where the dark theme is implemented, sorry if I am being daft.

@jdgd1
Copy link
Author

jdgd1 commented Apr 28, 2014

Probably could do a better job with themes, but the dark theme is implemented in the actual in the script that calls the candlestick function. The reason for dark theme is because if you are using a black background (which a lot of people use nowadays for stock charts) then the the edge colors and shadows need to be set based on the color of the body. However, when using a light a theme, the shadows and edges of the body need to remain black.

@tacaswell
Copy link
Member

Sorry for the long silence.

@jdgd1 Do you have any interest in continuing to work on this? The entire finance module is slated for removal in the next release, do you want to adopt it?

@jdgd1
Copy link
Author

jdgd1 commented Oct 20, 2014

@tacaswell I would hate to see it removed, it's hands down the best financial charting module of any package out there. My free time has become less and less lately though, which is the only reason I'm hesitant to take on full responsibility for it. Lets chat about this later - i might be able to take it on.

@tacaswell tacaswell closed this Nov 1, 2014
@tacaswell
Copy link
Member

Not sure how I closed this.

@efiring
Copy link
Member

efiring commented Sep 28, 2015

@jdgd1, is there still a possibility that you could become the finance module maintainer? This PR can be revived via a new PR, or maybe via rebasing against master and using force-push. I can't simply reopen it because it is presently based on a deleted branch.

lifetime42 added a commit to lifetime42/matplotlib that referenced this pull request Oct 1, 2015
This attempts to give the user the option to choose a color for the edge
of a candlestick body and the high-low bars (optional). If no argument
is given the behavior is just
like before. It also should fix the vertical line (high-low) zorder so
its behind the candlestickbody now.
Idea mainly by jdgd1. I tried to keep existing code working while adding
the feature.
matplotlib#3016
matplotlib#2546
Hopefully fixed the whitespaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants