Skip to content
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

Candle stick colors incorrectly colored #248

Closed
lcobiac opened this issue Aug 24, 2020 · 4 comments
Closed

Candle stick colors incorrectly colored #248

lcobiac opened this issue Aug 24, 2020 · 4 comments
Labels
question Further information is requested

Comments

@lcobiac
Copy link

lcobiac commented Aug 24, 2020

Hi Daniel,

Im running the following code and getting incorrect colors for the cande sticks. Output and screenshot are given below. Please advise.

Code

import mplfinance as mpf
import pandas as pd
print("mpf version:", mpf.__version__)

AAL_csv = pd.read_csv('./data/F.csv', index_col='timestamp', parse_dates=True)
print(AAL_csv.head())
mpf.plot(AAL_csv[['open', 'high', 'low', 'close']][-20:], type='candlestick', style='yahoo')
plt.show()

Output

mpf version: 0.12.7a0
            open  high    low  close    volume
timestamp                                     
2020-08-19  6.89  7.02  6.860   6.87  44158123
2020-08-18  6.98  7.01  6.885   6.89  40444196
2020-08-17  7.05  7.06  6.870   6.98  64307597
2020-08-14  6.97  7.11  6.930   7.04  43517662
2020-08-13  7.03  7.18  7.000   7.03  50066758

Screenshot of plot
image

@lcobiac lcobiac added the question Further information is requested label Aug 24, 2020
@lcobiac
Copy link
Author

lcobiac commented Aug 24, 2020

I notice this is also the case in the screenshot in #247

@lcobiac
Copy link
Author

lcobiac commented Aug 24, 2020

I have realized there are no issues with the colors. My data is in reverse order when compared with the expected input.

@lcobiac lcobiac closed this as completed Aug 24, 2020
@DanielGoldfarb
Copy link
Collaborator

I have realized there are no issues with the colors. My data is in reverse order when compared with the expected input.

Thanks. I should probably put a check in the code and issue a warning if the datetime index appears to be going in the wrong direction.

@lcobiac
Copy link
Author

lcobiac commented Aug 24, 2020

I have realized there are no issues with the colors. My data is in reverse order when compared with the expected input.

Thanks. I should probably put a check in the code and issue a warning if the datetime index appears to be going in the wrong direction.

Or automatically reverse the order of the data.

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

No branches or pull requests

2 participants