Skip to content

Commit 9f47ade

Browse files
committed
updates to _updownhollow_colors function
- first redefined - _list definition adjusted
1 parent 7336881 commit 9f47ade

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/mplfinance/_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,10 @@ def _updown_colors(upcolor,downcolor,opens,closes,use_prev_close=False):
168168
def _updownhollow_colors(upcolor,downcolor,uphollow,downhollow,opens,closes):
169169
if upcolor == downcolor == downhollow== uphollow:
170170
return upcolor
171-
cmap = {True : upcolor, False : downcolor}
172-
first = cmap[opens[0] < closes[0]]
173171
umap = {True : upcolor, False : uphollow}
174172
dmap = {True : downcolor, False : downhollow}
175-
_list = [ umap[cls > opn] if cls > cls0 else dmap[cls < opn] for opn0,cls0,opn,cls in zip(opens[0:-1],closes[0:-1],opens[1:],closes[1:]) ]
173+
_list = [ umap[cls < opn] if cls > cls0 else dmap[cls < opn] for opn0,cls0,opn,cls in zip(opens[0:-1],closes[0:-1],opens[1:],closes[1:]) ]
174+
first = umap[closes[0] < opens[0]]
176175
return [first] + _list
177176

178177

0 commit comments

Comments
 (0)