Skip to content

Commit 0d8d002

Browse files
committed
add back deleted pull code and fix typo in README
1 parent 07684af commit 0d8d002

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ mpf.plot(daily)
181181
---
182182
<br>
183183

184-
The default plot type, as you can see above, is `'ohlc'`. Other plot types can be specified with the keyword argument `type`, for example, `type='candle'`, `type='line'`, `type='renko'`, or `type='renko'`
184+
The default plot type, as you can see above, is `'ohlc'`. Other plot types can be specified with the keyword argument `type`, for example, `type='candle'`, `type='line'`, `type='renko'`, or `type='pf'`
185185

186186

187187
```python

src/mplfinance/plotting.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ def _valid_plot_kwargs():
128128

129129
'returnfig' : { 'Default' : False,
130130
'Validator' : lambda value: isinstance(value,bool) },
131+
132+
'return_calculated_values': {'Default': None,
133+
'Validator': lambda value: isinstance(value, dict) and len(value) == 0},
131134

132135
}
133136

@@ -304,6 +307,17 @@ def plot( data, **kwargs ):
304307
else:
305308
ax1.plot(xdates, mavprices)
306309

310+
if config['return_calculated_values'] is not None:
311+
retdict = config['return_calculated_values']
312+
if ptype == 'renko':
313+
retdict['renko_bricks'] = brick_values
314+
retdict['renko_dates'] = mdates.num2date(new_dates)
315+
if config['volume']:
316+
retdict['renko_volumes'] = volumes
317+
if mavgs is not None:
318+
for i in range(0, len(mavgs)):
319+
retdict['mav' + str(mavgs[i])] = mavprices
320+
307321
avg_dist_between_points = (xdates[-1] - xdates[0]) / float(len(xdates))
308322
minx = xdates[0] - avg_dist_between_points
309323
maxx = xdates[-1] + avg_dist_between_points

0 commit comments

Comments
 (0)