The factor engine computes quantitative signals (factors) from market data and evaluates their predictive power. Factors provide systematic, backtestable features for strategy development.Documentation Index
Fetch the complete documentation index at: https://docs.hyperoru.com/llms.txt
Use this file to discover all available pages before exploring further.
The factor engine is opt-in. Set
FACTOR_ENGINE_ENABLED=true in your environment to activate it. It increases CPU and memory usage due to continuous computation across all tracked symbols.What are factors?
A factor is a numeric value derived from market data that aims to predict future returns. Factors capture properties like momentum, mean reversion, volatility clustering, and volume patterns. Unlike ad-hoc technical indicators, factors are:- Normalized — comparable across different symbols and time periods
- Evaluated — effectiveness is measured through statistical metrics
- Composable — combined into multi-factor strategies
Built-in factors
The engine includes 64 expressions organized across six categories:- Trend
- Momentum
- Volatility
- Volume
- Statistical
- Composite
| Factor | Expression | Description |
|---|---|---|
trend_ema_cross | ema(20) / ema(50) - 1 | EMA crossover momentum |
trend_strength | adx(14) | Trend strength via ADX |
trend_direction | sign(close - ema(200)) | Binary trend direction |
price_momentum | roc(close, 20) | 20-period rate of change |
trend_persistence | hurst(close, 100) | Hurst exponent for trend persistence |
Custom factor creation
Define custom factors using the expression engine:Expression engine syntax
The expression engine supports arithmetic operations, built-in functions, and nesting:| Syntax | Example | Description |
|---|---|---|
| Arithmetic | a + b, a * b, a / b | Standard math operators |
| Functions | ema(close, 20) | Technical indicator functions |
| Nesting | ema(rsi(14), 5) | Compose functions |
| Constants | 100, 2.5 | Literal numbers |
| References | close, volume, high, low | Price/volume fields |
Factor effectiveness metrics
Each factor is continuously evaluated for predictive power:| Metric | Description | Good Value |
|---|---|---|
| IC (Information Coefficient) | Correlation between factor values and forward returns | > 0.03 |
| ICIR (IC Information Ratio) | Mean IC / Std(IC), measures consistency | > 0.5 |
| Win Rate | Fraction of periods where factor direction matches return direction | > 55% |
| Turnover | How frequently factor rankings change | Depends on strategy |