Skip to main content
The factor engine computes quantitative signals (factors) from market data and evaluates their predictive power. Factors provide systematic, backtestable features for strategy development.
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:
FactorExpressionDescription
trend_ema_crossema(20) / ema(50) - 1EMA crossover momentum
trend_strengthadx(14)Trend strength via ADX
trend_directionsign(close - ema(200))Binary trend direction
price_momentumroc(close, 20)20-period rate of change
trend_persistencehurst(close, 100)Hurst exponent for trend persistence

Custom factor creation

Define custom factors using the expression engine:
curl -X POST https://api.hyperoru.com/api/factors \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my_momentum",
    "expression": "roc(close, 10) * (volume / sma(volume, 20))",
    "description": "Volume-weighted 10-period momentum",
    "user_id": "your-user-id"
  }'

Expression engine syntax

The expression engine supports arithmetic operations, built-in functions, and nesting:
SyntaxExampleDescription
Arithmetica + b, a * b, a / bStandard math operators
Functionsema(close, 20)Technical indicator functions
Nestingema(rsi(14), 5)Compose functions
Constants100, 2.5Literal numbers
Referencesclose, volume, high, lowPrice/volume fields

Factor effectiveness metrics

Each factor is continuously evaluated for predictive power:
MetricDescriptionGood 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 RateFraction of periods where factor direction matches return direction> 55%
TurnoverHow frequently factor rankings changeDepends on strategy
curl "https://api.hyperoru.com/api/factors/{factor_id}/effectiveness?lookback=90d"

Factor computation pipeline

The pipeline runs on a configurable schedule (typically every 1–5 minutes) and caches results in the FactorCache for instant access by strategies and the API.