SharpTrader Pairs Trading: Direction parameter explained — all 8 modes 2026年05月28日 – Posted in: Arbitrage Software – Tags: pair trading, pairs trading, statistical arbitrage, z-index
BJF TRADING GROUP · PRODUCT REFERENCE
SharpTrader Pairs Trading: the Direction Parameter Explained — All 8 Modes
Direction controls which side of the pair gets the buy and which gets the sell once the Zindex threshold fires. The eight modes split into two strategic camps — fade the divergence (mean-reversion) and ride the divergence (momentum) — with one outlier, Inversed, that flips the trigger condition itself. This page is the practical reference: what each mode does, when it triggers, and which mode to pick for the setup you actually trade.
A quick refresher: Current Zindex and Zindex Open
Current Zindex is the live z-score of the spread between the two paired instruments — how many standard deviations the spread currently sits from its historical mean. Zindex Open is the magnitude threshold the trader configures: once the absolute value of the current z-score crosses it, the strategy is allowed to open a position. The Direction parameter then decides which leg becomes the buy and which becomes the sell.
For the full conceptual background — what cointegration is, why the spread mean-reverts, and how the z-score is computed — see our pillar on forex pairs trading and statistical arbitrage. This page focuses specifically on the Direction parameter and the eight values it can take.
One clarification that resolves most confusion
The wiki phrases the trigger as “Current Zindex is greater than the value of Zindex Open.” Read literally, that would fail when the current Z-index is negative. In practice, the test is a magnitude comparison: |Current Zindex| > Zindex Open. Zindex Open is the threshold expressed as a positive number (e.g. 2.0); the strategy fires when the spread has stretched at least that far from the mean, in either direction. The Current Zindex sign then determines which side gets long and which gets short.
The two strategic camps — and one outlier
Every Direction mode encodes two decisions: when to open (the trigger condition) and which way to open (the leg assignment). Looking at all eight together, three patterns emerge:
- Fade the divergence (mean-reversion bet). The spread has stretched; the trade bets it returns to the mean. 5 modes: ZIndexBased, PriceBased, Buy1Sell2, Sell1Buy2, ZIndexSign.
- Ride the divergence (momentum bet). The spread has stretched; the trade bets it will continue to stretch further. 2 modes: Reversed, ZIndexSignInv.
- The outlier — Inversed. The trigger is flipped: instead of waiting for the spread to stretch beyond the threshold, the trade opens while the spread is still inside the band, betting it will stretch outward. This is the only mode that fires near the mean rather than at the extremes.

Figure 1 — All 8 Direction modes at a glance. Gold border = fade-the-divergence (mean-reversion). Red border = ride-the-divergence (momentum). The Inversed card carries a “trigger flipped” marker because it enters while the spread is still inside the threshold band.
Mode-by-mode reference
Each mode below lists its trigger condition (when it fires), its leg-assignment rule (which side becomes the buy and which the sell), a concrete numeric example, and the kind of setup it is designed for.
ZIndexBased FADE
Trigger |Current Zindex| > Zindex Open
Action If Current Zindex ≥ 0 → sell left side, buy right side. If Current Zindex < 0 → buy left side, sell right side.
Example Zindex Open = 2.0, Current Zindex = +2.3. The mode sells the left leg and buys the right leg, betting the spread reverts toward zero.
When to use the default fade mode. Use when you trust the z-score sign as a clean directional signal and want symmetric behavior on both extremes of the spread. This is the most common starting configuration.
PriceBased FADE
Trigger |Current Zindex| > Zindex Open
Action If Current Ask on the left side > Current Ask on the right side → sell left, buy right. Otherwise → buy left, sell right.
Example Zindex Open = 2.0, Current Zindex = +2.3. Left Ask = 1.0850, Right Ask = 1.2640. Since the right Ask is higher, the mode buys left and sells right.
When to use: When the β (cointegration coefficient) is asymmetric enough that the raw Ask comparison is a more reliable direction signal than the z-score sign. Some traders prefer PriceBased on pairs where the two instruments trade at very different absolute price scales.
Buy1Sell2 FADE ONE-SIDED
Trigger |Current Zindex| > Zindex Open AND Current Zindex < 0
Action Buy left side, sell right side. (Fixed direction; the mode does not enter when Current Zindex ≥ 0.)
Example Zindex Open = 2.0, Current Zindex = −2.4. The mode buys left and sells right. If the current Z-index were +2.4, nothing opens.
When to use When you only want to trade the negative-Zindex side of the spread. Practical reasons: directional regime view, broker margin asymmetry, or one-sided pair behaviour where only the lower-Zindex setups have historically been profitable.
Sell1Buy2 FADE ONE-SIDED
Trigger |Current Zindex| > Zindex Open AND Current Zindex ≥ 0
Action Sell left side, buy right side. (Fixed direction; the mode does not enter when Current Zindex < 0.)
Example Zindex Open = 2.0, Current Zindex = +2.4. The market sells on the left and buys on the right. If the current Z-index were −2.4, nothing opens.
When to use The mirror image of Buy1Sell2 — when you only want positive-Zindex setups. Often paired with Buy1Sell2 on two separate strategy instances to run each side independently with different sizing.
ZIndexSign FADE
Trigger |Current Zindex| > |Zindex Open| AND Current Zindex and Zindex Open share the same sign
Action If Current Zindex ≥ 0 → sell left, buy right. If Current Zindex < 0 → buy left, sell right.
Example Zindex Open is set to +2.0 (with explicit sign). Current Zindex = +2.4 → same sign → sells left, buys right. Current Zindex = −2.4 → opposite sign → nothing opens.
When to use a stricter version of ZIndexBased? Use when you want the strategy to only trade in the direction the threshold was originally set for — useful for staged or directional pair entries where you don’t want the strategy to fire on the opposite extreme.
Reversed RIDE
Trigger |Current Zindex| > Zindex Open
Action If Current Zindex ≥ 0 → buy left, sell right. If Current Zindex < 0 → sell left, buy right. (Opposite leg assignment to ZIndexBased.)
Example Zindex Open = 2.0, Current Zindex = +2.3. The mode buys left and sells right, betting the spread continues to stretch further from the mean.
When to use A momentum bet on the spread — the inverse of mean-reversion. Appropriate when the pair is going through a regime where divergences widen further before reverting (e.g. one currency in a sharp trend). Higher risk than fade modes because correlation breaks tend to fail in this direction first.
ZIndexSignInv RIDE
Trigger |Current Zindex| > |Zindex Open| AND Current Zindex and Zindex Open share the same sign
Action If Current Zindex ≥ 0 → buy left, sell right. If Current Zindex < 0 → sell left, buy right.
Example Zindex Open = +2.0, Current Zindex = +2.4. Same sign and magnitude exceeded → buys left, sells right (ride the move).
When to use Stricter version of Reversed — momentum bet, but only when the spread has stretched further in the originally-configured direction. The same-sign requirement filters out spurious opposite-extreme triggers.
Inversed RIDE TRIGGER FLIPPED
Trigger |Current Zindex| < Zindex Open — note the inequality is flipped. The mode enters while the spread is inside the threshold band, not beyond it.
Action If Current Zindex ≥ 0 → buy left, sell right. If Current Zindex < 0 → sell left, buy right.
Example Zindex Open = 2.0, Current Zindex = +0.6. Magnitude is inside the band → buys left, sells right, betting the spread will stretch outward.
When to use Specialized momentum setup: you believe the spread is in a regime where small deviations expand into large ones rather than reverting. Effectively the opposite philosophy from every other mode — instead of waiting for an extreme, the mode enters early and rides the stretch. Used sparingly, in pairs with strong observed divergence-continuation behavior.
Side-by-side comparison of all 8 modes
| Mode | Trigger condition | When Z ≥ 0 | When Z < 0 | Camp |
|---|---|---|---|---|
| ZIndexBased | |Z| > Open |
Sell L, Buy R | Buy L, Sell R | Fade |
| PriceBased | |Z| > Open |
By raw Ask: higher Ask → sell, lower Ask → buy | Fade | |
| Buy1Sell2 | |Z| > Open AND Z < 0 |
no entry | Buy L, Sell R | Fade |
| Sell1Buy2 | |Z| > Open AND Z ≥ 0 |
Sell L, Buy R | no entry | Fade |
| ZIndexSign | |Z| > |Open| AND same sign |
Sell L, Buy R | Buy L, Sell R | Fade |
| Reversed | |Z| > Open |
Buy L, Sell R | Sell L, Buy R | Ride |
| ZIndexSignInv | |Z| > |Open| AND same sign |
Buy L, Sell R | Sell L, Buy R | Ride |
| Inversed | |Z| < Open (flipped) |
Buy L, Sell R | Sell L, Buy R | Ride |
Which mode should you pick?
There is no single “correct” mode — the choice depends on what you believe about the pair’s behavior and what you want the strategy to do at each extreme. As a practical guide:
- Starting from zero on a new pair? Use ZIndexBased. It is the cleanest default fade and gives you symmetric entries on both sides of the spread.
- Pair where the two instruments have very different price scales (different orders of magnitude)? Try PriceBased. It uses raw Ask comparison instead of z-score sign, which can be more reliable when β is far from 1.0.
- Want to run two independently-sized strategies, one per spread side? Run Buy1Sell2 on one instance (negative side only) and Sell1Buy2 on another (positive side only). This lets you size and stop each side independently.
- Worried about false triggers when the spread crosses zero rapidly? Use ZIndexSign. It only fires when Current and Open share the same sign, filtering out opposite-side noise.
- Trading a pair in a regime where divergences continue rather than revert? Reversed (or ZIndexSignInv for the stricter version). This is the momentum bet — higher variance, and you should size accordingly.
- Specialized setups where you want to enter near the mean and ride outward? Inversed is the only mode that does this. Use sparingly and only with strong evidence the pair behaves this way.
Three practical rules
- Backtest the mode you are about to deploy. The Direction parameter is not interchangeable — the same pair can produce wildly different P&L curves under ZIndexBased vs Reversed. Re-run the optimization for whichever mode you intend to run live.
- Match mode to the strategic thesis, not the historical P&L. If you cannot explain why a mode should work on a given pair, don’t deploy it just because the backtest looked good. Mode selection should follow a thesis about the pair’s regime.
- Don’t flip mode mid-session. Switching Direction while positions are open will leave you with positions opened under one rule set and an exit logic expecting another. Close everything cleanly before changing mode.
Frequently asked questions
It means |Current Zindex| > Zindex Open — a magnitude comparison. Zindex Open is the threshold expressed as a positive number (e.g. 2.0), and the strategy fires when the spread has stretched at least that far from the mean, in either direction. The Current Zindex sign then determines which leg is the buy and which is the sell, depending on the selected Direction mode.
Both share the same trigger (|Z| > Open) and both are fade modes. The difference is in how they decide the leg assignment. ZIndexBased uses the sign of the z-score: Z ≥ 0 means sell left / buy right, Z < 0 means the opposite. PriceBased ignores the z-score sign and compares raw Ask prices: the higher-priced side is sold, the lower-priced side is bought. Price-based is most useful when the two pair instruments have very different absolute price levels.
Inversed is the only mode whose trigger is flipped — it enters while the spread is inside the band (|Z| < Open), not beyond it. Use it when you have strong evidence that the pair is in a regime where small spread deviations expand into large ones rather than reverting. This is an unusual setup; the default behavior of most pairs is mean-reversion, so Inversed should be reserved for specific regimes you have explicitly observed and tested.
Both are fade modes with identical leg assignment by Z-sign. The difference is in the trigger: ZIndexBased fires whenever the magnitude exceeds the threshold, regardless of sign. ZIndexSign additionally requires Current Zindex and Zindex Open to share the same sign — meaning the spread has stretched further in the direction the threshold was originally configured for. ZIndexSign filters out opposite-extreme triggers; ZIndexBased fires on both extremes symmetrically.
ZIndexBased is the practical default. It implements the canonical fade-the-divergence pairs trade with symmetric behavior on both sides of the spread. Start there, backtest under realistic execution conditions, and only move to one of the other modes when you have a specific reason (regime view, asymmetric sizing, sign confirmation, or momentum thesis).
Yes — that is one of the main reasons those one-sided modes exist. Running two strategy instances on the same pair, one with Buy1Sell2 (negative Zindex side only) and one with Sell1Buy2 (positive Zindex side only), is equivalent to ZIndexBased, except you can size, stop, and parameterize each side independently. Useful when one side has historically been more profitable or you want different sizing per direction.
Technically, you can, but you should not. Positions opened under one mode were entered against an implicit thesis about which side should win — the exit logic, take-profit, and stop-loss rules behave consistently with that thesis. Switching mode mid-position leaves you with open trades that the new ruleset was never designed to manage. Close all positions cleanly, then change Direction before the next session.
Direction is the leg-assignment rule; the rest of the parameters — Zindex Open, Zindex Close, ATR filters, lot sizing, take-profit, stop-loss — decide when to exit and how to size. The Direction mode does not change those rules, but it can change which Zindex Close logic makes sense (a fade mode targets reversion to zero; a ride mode targets a wider divergence). Re-tune the exit parameters whenever you change Direction. The wiki has the full parameter reference: sharptrader.arbitragesoftware.net/Pairs_Trading_Strategy.
Run pairs trading in SharpTrader
The Direction parameter is one of several controls that decide whether a pairs strategy survives in production. The others — broker execution quality, realistic backtest assumptions, and walk-forward validation — are covered in our pillar guide and the BEQI broker audit toolkit.
English
Deutsch
العربية
한국어
Español
Português
Indonesia
Tiếng Việt
中文