Volume Profile Components
| Component | Description | Calculation |
|---|---|---|
| Volume Trend | Short vs. long-term volume ratio | (short_avg / long_avg) - 1 |
| Price-Volume Correlation | Correlation between volume and absolute returns | nancorr_1d_nb(volume, abs(returns)) |
| Volume Surge | Logarithmic volume increase detection | log1p(ratio) * surge_scale |
Volume Profile API Classes
| Class | Description | Key Features |
|---|---|---|
RollingVolumeProfileFactor | Rolling window analysis | Dynamic window sizing, trend detection |
VolumeProfileFactorCV | Cross-validated volume analysis | Walk-forward validation, parameter stability |
RollingVolumeProfileFactor
- Volume Profile Variation : This method calculates volume profile variation by combining volume-based signals with price movement (correlation between volume and price returns) over configurable time windows. It highlights volume surges and volume-price trends to generate an indicator.
- Signal Calculation : The signals are scaled and combined to give a final output by iterating over the historical data (closing prices and volume) using a rolling window.
- Calculate Volume and Trend : calculates the average volume over two time periods: a short-term window and the entire window. It also computes the volume trend, defined as the ratio of short-term to long-term average volume.
- Volume-Price Correlation : Calculates the correlation between volume — smoothed over the short-term window — and price returns over the same period. This helps determine if changes in volume are associated with price movement.
-
Volume Surge Detection :
Detect volume surges by comparing the short-term volume with long-term
volume. This surge is amplified by the
surge_scalefactor. - Signal Combination : Combine the volume trend, price-volume correlation, and volume surge to create a composite signal.
- Iterating Over Symbols : Applies the volume and price trend calculations for each symbol.
-
Final Signal Calculation :
Slice the closing prices and volume data to the most recent
volume_windowand computes the signals. The resulting signals are aggregated and scaled. Finally, the signal is passed through a hyperbolic tangent (np.tanh) for smoothing and amplified before returning the final value.
Ancestors
systematica.models.base.BaseStatArbabc.ABC
Instance variables
-
minp: int: Mininim period. Defaults toNone, which means no minimum period is applied. -
score_scale: float: Score scale coefficient. Defaults to2.0. This factor scales the final score output. -
short_term_window: int: Short term window. Defaults to30. -
surge_scale: float: Volume surge scale coefficient. Defaults to5.0. This factor amplifies the volume surge detection. -
window: int: The size of the rolling window. Defaults to365.
VolumeProfileFactorCV
- Volume Profile Variation : This method calculates volume profile variation by combining volume-based signals with price movement (correlation between volume and price returns) over configurable time windows. It highlights volume surges and volume-price trends to generate an indicator.
- Signal Calculation : The signals are scaled and combined to give a final output by iterating over the historical data (closing prices and volume) using a cross-validation approach.
- Calculate Volume and Trend : calculates the average volume over two time periods: a short-term window and the entire window. It also computes the volume trend, defined as the ratio of short-term to long-term average volume.
- Volume-Price Correlation : Calculates the correlation between volume — smoothed over the short-term window — and price returns over the same period. This helps determine if changes in volume are associated with price movement.
-
Volume Surge Detection :
Detect volume surges by comparing the short-term volume with long-term
volume. This surge is amplified by the
surge_scalefactor. - Signal Combination : Combine the volume trend, price-volume correlation, and volume surge to create a composite signal.
- Iterating Over Symbols : Applies the volume and price trend calculations for each symbol.
-
Final Signal Calculation :
Slice the closing prices and volume data to the most recent
volume_windowand computes the signals. The resulting signals are aggregated and scaled. Finally, the signal is passed through a hyperbolic tangent (np.tanh) for smoothing and amplified before returning the final value.
Ancestors
systematica.models.base.BaseStatArbabc.ABC
Instance variables
-
custom_splitter: str | None: Custom splitter to use for data partitioning. Defaults toNone. If set, it should be a string that matches a custom splitter function. -
custom_splitter_kwargs: dict | None: Additional keyword arguments for the custom splitter. Defaults toNone. Ifcustom_splitteris set, this should contain any necessary parameters for the custom splitter function. -
score_scale: float: Score scale coefficient. Defaults to2.0. This factor scales the final score output. -
short_term_window: int: Short term window. Defaults to30. This is the window size used for short-term volume calculations. -
splitter: str: Default splitter to be used ifcustom_splitteris not passed. Choices arefrom_rolling,from_expanding,from_custom_rolling,from_custom_expanding. Defaults to “from_custom_rolling”. -
surge_scale: float: Volume surge scale coefficient. Defaults to5.0. This factor amplifies the volume surge detection. -
testing_window: int: The size of the testing window. Defaults to60. This is the window size used for testing the model. -
training_window: int: The size of the training window. Defaults to365. This is the window size used for training the model.

