Skip to content

Commit 73a1c05

Browse files
committed
add renko condition
1 parent 00e4bd3 commit 73a1c05

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mplfinance/plotting.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from mplfinance._utils import _construct_ohlc_collections
1616
from mplfinance._utils import _construct_candlestick_collections
17+
from mplfinance._utils import _construct_renko_collections
1718

1819
from mplfinance._utils import _updown_colors
1920
from mplfinance._utils import IntegerIndexDateTimeFormatter
@@ -242,13 +243,18 @@ def plot( data, **kwargs ):
242243

243244
ptype = config['type']
244245

246+
renko_params = config['renko_params']
247+
245248
collections = None
246249
if ptype == 'candle' or ptype == 'candlestick':
247250
collections = _construct_candlestick_collections(xdates, opens, highs, lows, closes,
248251
marketcolors=style['marketcolors'] )
249252
elif ptype == 'ohlc' or ptype == 'bars' or ptype == 'ohlc_bars':
250253
collections = _construct_ohlc_collections(xdates, opens, highs, lows, closes,
251254
marketcolors=style['marketcolors'] )
255+
elif ptype == 'renko':
256+
collections = _construct_renko_collections(xdates, renko_params, closes,
257+
marketcolors=style['marketcolors'] )
252258
elif ptype == 'line':
253259
ax1.plot(xdates, closes, color=config['linecolor'])
254260
else:

0 commit comments

Comments
 (0)