What problem does it solve?
This Skill helps you generate long-short trading signals that exploit temporary divergences in the price relationship of two correlated instruments, aiming for eventual mean reversion.
Core Features & Use Cases
- Ratio-based Z-score signals: Computes the A/B price ratio, then derives a rolling mean, rolling standard deviation, and Z-score to measure how far the relationship deviates from normal.
- Hedge-aligned pair positions: Produces opposite-direction signals for the two legs (A long with B short, or A short with B long) using equal 50/50 capital allocation.
- Entry/exit rule support: Opens positions when Z-score crosses entry thresholds and closes when the absolute Z-score falls below the exit threshold.
- Use Case: Running a daily BTC/ETH strategy where you enter when the ratio deviates strongly and exit as the ratio returns toward its rolling average.
Quick Start
Generate signals for exactly two instruments by providing a mapping of their OHLCV DataFrames keyed by instrument code to the pair trading signal engine.