Skip to content

volume_overlay function display error color #19

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
jiapengfei opened this issue Nov 3, 2019 · 3 comments
Closed

volume_overlay function display error color #19

jiapengfei opened this issue Nov 3, 2019 · 3 comments

Comments

@jiapengfei
Copy link

When the open and close are same price, the color is the down color, but it should be the up color.
Current code:
colors = [colord[open < close]
for open, close in zip(opens, closes)
if open != -1 and close != -1]
I think the compare between open and close should be close >= open, see below:
colors = [colord[close >= open]
for open, close in zip(opens, closes)
if open != -1 and close != -1]

@DanielGoldfarb
Copy link
Contributor

DanielGoldfarb commented Nov 7, 2019

The code is inconsistent as to how it treats open equals close: In most places equal is given the up color. In three places it is given the down color. It makes sense to make the code consistent. Can you please post, to a github gist, your own code to form your plot with a volume overlay, so that I can be sure I can reproduce and see exactly what you are seeing? Then please provide a link here to the gist. (A screen shot would also be helpful). Thank you.

@DanielGoldfarb
Copy link
Contributor

@jiapengfei not sure if you saw my previous comment. Adding an @... style comment so that you will get an email. Please see comment above and respond. Thank you.

@DanielGoldfarb
Copy link
Contributor

https://pypi.org/project/mplfinance/ handles volume easily

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

No branches or pull requests

2 participants