PIR Evolver Engine
Prime Integer Relations for regime detection
Uses Prime Integer Relations (PIR) to detect market regimes and optimize trading strategies. Includes momentum rebalancer for top crypto assets with risk-adjusted position sizing.
Overview
The PIR Evolver Engine applies Prime Integer Relations to financial time-series data. It detects market regime shifts by measuring how far a return sequence deviates from Thue-Morse equilibrium — the same mathematical framework that detects structural health issues in our TPNN neural networks.
How PIR Regime Detection Works
Step 1: Extract Return Sequences
Price data is converted to return sequences per asset. The Thue-Morse sequence assigns deterministic signs based on bit-count parity — no randomness, no fitting, no parameters to tune.
Step 2: Compute Balance Gap
The signed power-sum residual measures how far the return sequence is from Thue-Morse equilibrium. Zero means perfect equilibrium (stable regime). Non-zero means structural shift detected.
Step 3: Compute Pattern Area
The shoelace area of the signed cumulative path. Low area = well-structured trend. High area = scattered, uncertain regime. This is the entropy measure — it captures the "shape" of the return sequence.
Step 4: Classify Regime
Balance gap magnitude and pattern area classify the market into four states:
- Bullish — low balance gap, low pattern area, positive returns
- Range — low balance gap, low pattern area, flat returns
- Transition — high balance gap, high pattern area, direction uncertain
- Bearish — low balance gap, low pattern area, negative returns
Momentum Rebalancer
The engine applies regime detection to a top-16 crypto momentum strategy:
- Detect regime shifts via balance gap spikes
- Adjust position sizing based on regime confidence score
- Risk-adjusted allocation across BTC, ETH, SOL, AVAX, and 12 more assets
- Rebalance on regime transitions, not on fixed time intervals
Why PIR Works Here
Markets have structural equilibria — trends, ranges, and consolidation patterns. PIR captures the mathematical "shape" of the return sequence. When that shape breaks Thue-Morse balance, a regime change has occurred. This is not pattern matching or machine learning — it is a deterministic mathematical test that runs in O(n) time.
SignalO Integration
The PIR Evolver Engine powers SignalO, our live signal feed product. SignalO exposes the engine's regime detection as a real-time subscription service with push alerts, API access, and historical replay. See SignalO for the product page.
Educational Disclaimer
PIR regime detection is an experimental mathematical framework. Markets are complex adaptive systems and no signal can predict future performance. The PIR Evolver Engine and SignalO are educational and research tools, not financial advice.
Key Highlights
- Top 16 crypto momentum rebalancer
- PIR-based regime detection
- Risk-adjusted position sizing