Momentum Calculation Components
The momentum model computes scores based on the following key components:| Component | Description | Function |
|---|---|---|
| Short-term Momentum | Recent price trends | get_momentum_components_nb() |
| Medium-term Momentum | Intermediate price trends | get_momentum_components_nb() |
| Long-term Momentum | Full dataset price trends | get_momentum_components_nb() |
| Volatility Adjustment | Risk normalization | get_volatility_adjustments_nb() |
| Weighted Scoring | Combined signal generation | weighted_average_scores_nb() |
API Classes for Momentum
The momentum API provides four main classes:| Class | Purpose | Core Function |
|---|---|---|
RollingMomentumFactor | Per-asset rolling | rolling_momentum_nb() |
RollingAverageMomentumFactor | Averaged rolling | rolling_momentum_average_nb() |
MomentumFactorCV | Per-asset CV | momentum_cv(combined=False) |
AverageMomentumFactorCV | Averaged CV | momentum_cv(combined=True) |
RollingAverageMomentumFactor
- Multiple Periods: The Momentum indicator is calculated through different time horizons, giving more weight to recent data for faster response.
- Volatility Adjustments : It incorporates both momentum and volatility adjustments to generate a normalized score.
- Trend Components Calculation: For each symbol, calculate the short, medium and long-term momentum using the average price returns over specified periods.
- Volatility Adjustment: Calculate the short-term and long-term volatility using the standard deviation of returns over the respective periods.
- Standardization: Normalize the momentum components by dividing them by the corresponding volatility values to account for risk.
- Scoring Mechanism: Combine the normalized scores from the short, medium and long-term periods, applying different weights to each based on their importance (e.g., more weight for short-term momentum).
- Signal Calculation: Amplify the combined score by a scaling factor and clip the final signal to a range between -1 and 1 to represent the direction and strength of the momentum.
- Handling Multiple Symbols: The process is repeated for each pair, with the final signal being the equal-weighted average, offering a broader market view.
Ancestors
systematica.models.base.BaseStatArbabc.ABC
Descendants
systematica.api.models.momentum.RollingMomentumFactor
Instance variables
-
long_term_weight: float: Long term weight coefficient. Defaults to0.2. -
medium_term_mom: int: Medium term momentum window. Defaults to50. -
medium_term_weight: float: Medium term weight coefficient. Defaults to0.3. -
minp: int: Mininim period. Defaults toNone, which means no minimum period is applied. -
score_scale: float: Scale final score. Defaults to2.0. This factor amplifies the final score, enhancing the signal strength. -
short_term_mom: int: Short term momentum window. Defaults to30. -
short_term_vol: int: Short term volatility window. Defaults to30. -
short_term_weight: float: Short term weight coeff. Defaults to0.5. -
window: int: The size of the rolling window. Defaults to365.
RollingMomentumFactor
RollingAverageMomentumFactor.
Method generated by attrs for class RollingMomentumFactor.
Ancestors
systematica.api.models.momentum.RollingAverageMomentumFactorsystematica.models.base.BaseStatArbabc.ABC
MomentumFactorCV
RollingMomentumAverageFactor.
Method generated by attrs for class MomentumFactorCV.
Ancestors
systematica.api.models.momentum.AverageMomentumFactorCVsystematica.models.base.BaseStatArbabc.ABC
AverageMomentumFactorCV
RollingMomentumAverageFactor.
Method generated by attrs for class AverageMomentumFactorCV.
Ancestors
systematica.models.base.BaseStatArbabc.ABC
Descendants
systematica.api.models.momentum.MomentumFactorCV
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. -
long_term_weight: float: Long term weight coeff. Defaults to0.2. This is the weight applied to the long-term momentum in the final score calculation. -
medium_term_mom: int: Medium term momentum window. Defaults to50. This is the window size used for medium-term momentum calculations. -
medium_term_weight: float: Medium term weight coeff. Defaults to0.3. This is the weight applied to the medium-term momentum in the final score calculation. -
score_scale: float: Scale final score. Defaults to2.0. This factor amplifies the final score, enhancing the signal strength. -
short_term_mom: int: Short term momentum window. Defaults to30. This is the window size used for short-term momentum calculations. -
short_term_vol: int: Short term volatility window. Defaults to30. This is the window size used for short-term volatility calculations. -
short_term_weight: float: Short term weight coeff. Defaults to0.5. This is the weight applied to the short-term momentum in the final score calculation. -
splitter: str: Default splitter to be used if custom_splitter is not passed. Choices arefrom_rolling,from_custom_rolling,from_expanding,from_custom_expanding. Defaults tofrom_custom_rolling. -
testing_window: int: The size of the testing window. Defaults to60. This is the period used for testing the model after training on the training window. -
training_window: int: The size of the training window. Defaults to365.

