pip install volprofile
This package provides functions for analyzing volume profile data using Python. The package includes the following functions:
This function takes a Pandas DataFrame with columns price and volume, and returns a DataFrame consisting of minPrice, maxPrice, and aggregateVolume for each price bin.
This function takes a Pandas DataFrame with columns open, high, low, close, and volume, and returns a DataFrame consisting of minPrice, maxPrice, and aggregateVolume for each price bin. It uses the OHLC data to calculate more accurate price bins.
This function takes a DataFrame generated by getVP or getVPWithOHLC, and returns the top k price bins with the highest aggregate volume.
This function takes a DataFrame generated by getVP or getVPWithOHLC, and returns the price bins that have experienced unusual increases in volume. The isUpward parameter determines whether to search for upward or downward trends.
This function takes a DataFrame generated by getVP or getVPWithOHLC, and a price series, and generates a plot of the volume profile. Installation
To install the package, run:
pip install volprofile
import pandas as pd
from volprofile import getVP, plot
# Load data
df = pd.read_csv('mydata.csv')
# Calculate volume profile
vp = getVPWithOHLC(df)
# Plot volume profile
plot(vp, df['price'])