volume_overlay function display error color
jiapengfei opened this issue · comments
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]
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.
@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.
https://pypi.org/project/mplfinance/ handles volume easily