Replies: 3 comments
-
import finplot as fplt
import yfinance
df = yfinance.download('AAPL')
p = fplt.candlestick_ochl(df[['Open', 'Close', 'High', 'Low']])
p.colors.update(dict(bull_body='#0a0', bull_shadow='#000', bull_frame='#000',
bear_body='#a00', bear_shadow='#000', bear_frame='#000'))
fplt.show() Check out the examples for more info. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi,
Copied your code and got this:
runcell(3, 'C:/Dev/Spyder/finplot_V3.py')
[*********************100%***********************] 1 of 1 completed
Traceback (most recent call last):
File "C:\Dev\Spyder\finplot_V3.py", line 46, in <module>
p = fplt.candlestick_ochl(df[['Open', 'Close', 'High', 'Low']])
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 1288, in candlestick_ochl
item = CandlestickItem(ax=ax, datasrc=datasrc, draw_body=draw_body, draw_shadow=draw_shadow, candle_width=candle_width, colorfunc=colorfunc)
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 969, in __init__
weak_bull_shadow = brighten(candle_bull_color, 1.2),
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 2217, in brighten
return pg.mkColor(color).lighter(int(f*100))
File "C:\Users\grant\anaconda3\lib\site-packages\pyqtgraph\functions.py", line 216, in mkColor
r = int(c[0]*2, 16)
ValueError: invalid literal for int() with base 16: 'gg'
runcell(3, 'C:/Dev/Spyder/finplot_V3.py')
[*********************100%***********************] 1 of 1 completed
Traceback (most recent call last):
File "C:\Dev\Spyder\finplot_V3.py", line 46, in <module>
p = fplt.candlestick_ochl(df[['Open', 'Close', 'High', 'Low']])
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 1288, in candlestick_ochl
item = CandlestickItem(ax=ax, datasrc=datasrc, draw_body=draw_body, draw_shadow=draw_shadow, candle_width=candle_width, colorfunc=colorfunc)
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 969, in __init__
weak_bull_shadow = brighten(candle_bull_color, 1.2),
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 2217, in brighten
return pg.mkColor(color).lighter(int(f*100))
File "C:\Users\grant\anaconda3\lib\site-packages\pyqtgraph\functions.py", line 216, in mkColor
r = int(c[0]*2, 16)
ValueError: invalid literal for int() with base 16: 'gg'
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: Jonas Byström<mailto:notifications@github.com>
Sent: 19 February 2021 23:55
To: highfestiva/finplot<mailto:finplot@noreply.github.com>
Cc: grantxx<mailto:grant.shuttleworth@outlook.com>; Author<mailto:author@noreply.github.com>
Subject: Re: [highfestiva/finplot] Candle colors (#125)
import finplot as fplt
import yfinance
df = yfinance.download('AAPL')
p = fplt.candlestick_ochl(df[['Open', 'Close', 'High', 'Low']])
p.colors.update(dict(bull_body='#0a0', bull_shadow='#000', bull_frame='#000',
bear_body='#a00', bear_shadow='#000', bear_frame='#000'))
fplt.show()
Check out the examples for more info.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#125 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOHBP4HJSFPJRBYTLGTERO3S7327DANCNFSM4X4HOFXQ>.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Sorry. Nevermind. It works.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: Grant Shuttleworth<mailto:grant.shuttleworth@outlook.com>
Sent: 21 February 2021 19:59
To: highfestiva/finplot<mailto:reply@reply.github.com>; highfestiva/finplot<mailto:finplot@noreply.github.com>
Cc: Author<mailto:author@noreply.github.com>
Subject: RE: [highfestiva/finplot] Candle colors (#125)
Hi,
Copied your code and got this:
runcell(3, 'C:/Dev/Spyder/finplot_V3.py')
[*********************100%***********************] 1 of 1 completed
Traceback (most recent call last):
File "C:\Dev\Spyder\finplot_V3.py", line 46, in <module>
p = fplt.candlestick_ochl(df[['Open', 'Close', 'High', 'Low']])
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 1288, in candlestick_ochl
item = CandlestickItem(ax=ax, datasrc=datasrc, draw_body=draw_body, draw_shadow=draw_shadow, candle_width=candle_width, colorfunc=colorfunc)
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 969, in __init__
weak_bull_shadow = brighten(candle_bull_color, 1.2),
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 2217, in brighten
return pg.mkColor(color).lighter(int(f*100))
File "C:\Users\grant\anaconda3\lib\site-packages\pyqtgraph\functions.py", line 216, in mkColor
r = int(c[0]*2, 16)
ValueError: invalid literal for int() with base 16: 'gg'
runcell(3, 'C:/Dev/Spyder/finplot_V3.py')
[*********************100%***********************] 1 of 1 completed
Traceback (most recent call last):
File "C:\Dev\Spyder\finplot_V3.py", line 46, in <module>
p = fplt.candlestick_ochl(df[['Open', 'Close', 'High', 'Low']])
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 1288, in candlestick_ochl
item = CandlestickItem(ax=ax, datasrc=datasrc, draw_body=draw_body, draw_shadow=draw_shadow, candle_width=candle_width, colorfunc=colorfunc)
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 969, in __init__
weak_bull_shadow = brighten(candle_bull_color, 1.2),
File "C:\Users\grant\AppData\Roaming\Python\Python38\site-packages\finplot\__init__.py", line 2217, in brighten
return pg.mkColor(color).lighter(int(f*100))
File "C:\Users\grant\anaconda3\lib\site-packages\pyqtgraph\functions.py", line 216, in mkColor
r = int(c[0]*2, 16)
ValueError: invalid literal for int() with base 16: 'gg'
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: Jonas Byström<mailto:notifications@github.com>
Sent: 19 February 2021 23:55
To: highfestiva/finplot<mailto:finplot@noreply.github.com>
Cc: grantxx<mailto:grant.shuttleworth@outlook.com>; Author<mailto:author@noreply.github.com>
Subject: Re: [highfestiva/finplot] Candle colors (#125)
import finplot as fplt
import yfinance
df = yfinance.download('AAPL')
p = fplt.candlestick_ochl(df[['Open', 'Close', 'High', 'Low']])
p.colors.update(dict(bull_body='#0a0', bull_shadow='#000', bull_frame='#000',
bear_body='#a00', bear_shadow='#000', bear_frame='#000'))
fplt.show()
Check out the examples for more info.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#125 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOHBP4HJSFPJRBYTLGTERO3S7327DANCNFSM4X4HOFXQ>.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. Great work on this. How do I change candle colors and outlines?
Bull bars = green
Bear bars = red
Outline and wicks = black
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions