-
Notifications
You must be signed in to change notification settings - Fork 663
Access to mplfinance Calculated Values
Daniel Goldfarb edited this page Jan 2, 2022
·
3 revisions
Sometimes you may want to see or use values that mplfinance calculated internally. This is particularly helpful to gain access to Renko and/or Point-and-Figure data. But other values (such as moving averages, minimums and maximums) are also returned.
To gain access to calculated values, you must set a variable equal to an empty dictionary. Then pass this variable as the value of **kwarg return_calculated_values
. Mplfinance will fill the empty dictionary with various calculated values. Here is an example:
import pandas as pd
import mplfinance as mpf
import pprint
daily = pd.read_csv('data/SPY_20110701_20120630_Bollinger.csv',index_col=0,parse_dates=True)
renko_kwargs = dict(type='renko',mav=(8,20,30), volume=True,figratio=(10,8),figscale=0.75)
cv = {}
mpf.plot(daily,**renko_kwargs,style='blueskies',return_calculated_values=cv)
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(cv)