Skip to content

Commit

Permalink
add back deleted pull code and fix typo in README
Browse files Browse the repository at this point in the history
  • Loading branch information
coffincw committed Mar 28, 2020
1 parent 07684af commit 0d8d002
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ mpf.plot(daily)
---
<br>

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'`
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'`


```python
Expand Down
14 changes: 14 additions & 0 deletions src/mplfinance/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ def _valid_plot_kwargs():

'returnfig' : { 'Default' : False,
'Validator' : lambda value: isinstance(value,bool) },

'return_calculated_values': {'Default': None,
'Validator': lambda value: isinstance(value, dict) and len(value) == 0},

}

Expand Down Expand Up @@ -304,6 +307,17 @@ def plot( data, **kwargs ):
else:
ax1.plot(xdates, mavprices)

if config['return_calculated_values'] is not None:
retdict = config['return_calculated_values']
if ptype == 'renko':
retdict['renko_bricks'] = brick_values
retdict['renko_dates'] = mdates.num2date(new_dates)
if config['volume']:
retdict['renko_volumes'] = volumes
if mavgs is not None:
for i in range(0, len(mavgs)):
retdict['mav' + str(mavgs[i])] = mavprices

avg_dist_between_points = (xdates[-1] - xdates[0]) / float(len(xdates))
minx = xdates[0] - avg_dist_between_points
maxx = xdates[-1] + avg_dist_between_points
Expand Down

0 comments on commit 0d8d002

Please sign in to comment.