vp#

API documentation for pandas_ta.volume.vp Python function.

vp(close, volume, width=None, **kwargs)[source]#

Volume Profile (VP)

Calculates the Volume Profile by slicing price into ranges. Note: Value Area is not calculated.

Sources:

https://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:volume_by_price https://www.tradingview.com/wiki/Volume_Profile http://www.ranchodinero.com/volume-tpo-essentials/ https://www.tradingtechnologies.com/blog/2013/05/15/volume-at-price/

Calculation:
Default Inputs:

width=10

vp = pd.concat([close, pos_volume, neg_volume], axis=1) if sort_close:

vp_ranges = cut(vp[close_col], width) result = ({range_left, mean_close, range_right, pos_volume, neg_volume} foreach range in vp_ranges

else:

vp_ranges = np.array_split(vp, width) result = ({low_close, mean_close, high_close, pos_volume, neg_volume} foreach range in vp_ranges

vpdf = pd.DataFrame(result) vpdf[‘total_volume’] = vpdf[‘pos_volume’] + vpdf[‘neg_volume’]

Args:

close (pd.Series): Series of ‘close’s volume (pd.Series): Series of ‘volume’s width (int): How many ranges to distrubute price into. Default: 10

Kwargs:

fillna (value, optional): pd.DataFrame.fillna(value) fill_method (value, optional): Type of fill method sort_close (value, optional): Whether to sort by close before splitting

into ranges. Default: False

Returns:

pd.DataFrame: New feature generated.