INVITE-ONLY SCRIPT
Spread Mean Reversion Strategy [SciQua]

╭───────────────────────────────────────╮
Spread Mean Reversion Strategy [SciQua]
╰───────────────────────────────────────╯
This invite-only futures spread strategy applies a statistical mean reversion framework, executing limit orders exclusively at calculated Z-score thresholds for precise, rules-based entries and exits. It is designed for CME-style spreads and synthetic instruments with well-defined reversion tendencies.
╭────────────╮
Core Concept
╰────────────╯
The strategy calculates a rolling mean and standard deviation of a chosen spread or synthetic price series, then computes the Z-score to measure deviation from the mean in standard deviation units.
╭────────────╮
Key Features
╰────────────╯
╭────────────────────╮
Entry Blocking Rules
╰────────────────────╯
New trades are blocked:
╭────────────────────────╮
Intended Markets & Usage
╰────────────────────────╯
╭──────────────────────────╮
Risk Management & Defaults
╰──────────────────────────╯
Note: This strategy is for research and backtesting purposes only. Past performance does not guarantee future results. All use is subject to explicit written permission from the author.
Spread Mean Reversion Strategy [SciQua]
╰───────────────────────────────────────╯
This invite-only futures spread strategy applies a statistical mean reversion framework, executing limit orders exclusively at calculated Z-score thresholds for precise, rules-based entries and exits. It is designed for CME-style spreads and synthetic instruments with well-defined reversion tendencies.
╭────────────╮
Core Concept
╰────────────╯
The strategy calculates a rolling mean and standard deviation of a chosen spread or synthetic price series, then computes the Z-score to measure deviation from the mean in standard deviation units.
- Long entries trigger when Z crosses upward through a negative entry threshold (`-devEnter`). A buy limit is placed exactly at the price corresponding to that Z-score, optionally offset by a configurable tick amount.
- Short entries trigger when Z crosses downward through a positive entry threshold (`+devEnter`). A sell limit is placed at the corresponding threshold price, also with optional offset.
- Exits use the same threshold method, with an independent `Close Limit Offset` to fine-tune exit placement.
╭────────────╮
Key Features
╰────────────╯
- Persistence filter – Requires the Z-score to remain beyond threshold for a configurable number of bars before entry.
- Cooldown after exits – Prevents immediate re-entry to reduce over-trading.
- Daily and weekend flattening – Force-flattens positions via limit orders before exchange maintenance breaks and weekend closes.
- Auto-rollover detection with persistence – Detects when the second contract month’s daily volume exceeds the first for a set number of days, then blocks new entries (optional).
- Configurable tick offsets – Independently adjust entry and exit levels relative to threshold prices.
- Minimum spread width filter – Blocks trades when long/short entry thresholds are too close together.
- Contract multiplier override – Allows correct sizing for synthetic symbols where `syminfo.pointvalue` is incorrect or missing.
- Limit-only execution – All entries, exits, and forced-flat actions are executed with limit orders for price control.
╭────────────────────╮
Entry Blocking Rules
╰────────────────────╯
New trades are blocked:
- During daily maintenance break pre-windows
- During weekend close pre-windows
- After rollover triggers, if `Block After Roll` is enabled
╭────────────────────────╮
Intended Markets & Usage
╰────────────────────────╯
- Built for futures spreads and synthetic instruments, including calendar spreads.
- Performs best in markets with clear seasonal or statistical mean-reverting tendencies.
- Not designed for strongly trending, non-reverting markets.
╭──────────────────────────╮
Risk Management & Defaults
╰──────────────────────────╯
- Fixed default position size of 1 contract (qty calc function available for customization).
- Realistic commission and slippage assumptions pre-set.
- Pyramiding disabled by default.
- Default Z-score levels: Entry at ±2.0, Exit at ±0.5.
- Separate tick offset controls for entries and exits.
Note: This strategy is for research and backtesting purposes only. Past performance does not guarantee future results. All use is subject to explicit written permission from the author.
僅限邀請腳本
只有經作者批准的使用者才能訪問此腳本。您需要申請並獲得使用權限。該權限通常在付款後授予。如欲了解更多詳情,請依照以下作者的說明操作,或直接聯絡JoshuaDanford。
除非您完全信任其作者並了解腳本的工作原理,否則TradingView不建議您付費或使用腳本。您也可以在我們的社群腳本中找到免費的開源替代方案。
作者的說明
🔑 Access This Indicator
➡️ Visit sciqua.com
💳 Purchase a package with indicator access.
📩 Message @JoshuaDanford on TradingView with your username.
✅ Access granted within 72 hours.
提醒:在請求訪問權限之前,請閱讀僅限邀請腳本指南。
🚀 Founder of SciQua | Strategy. Simulation. Signals.
TradingView indicators, backtesting tools, weekly contests, and live market analysis.
Join free, compete, win, and stay updated at sciqua.com
TradingView indicators, backtesting tools, weekly contests, and live market analysis.
Join free, compete, win, and stay updated at sciqua.com
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
僅限邀請腳本
只有經作者批准的使用者才能訪問此腳本。您需要申請並獲得使用權限。該權限通常在付款後授予。如欲了解更多詳情,請依照以下作者的說明操作,或直接聯絡JoshuaDanford。
除非您完全信任其作者並了解腳本的工作原理,否則TradingView不建議您付費或使用腳本。您也可以在我們的社群腳本中找到免費的開源替代方案。
作者的說明
🔑 Access This Indicator
➡️ Visit sciqua.com
💳 Purchase a package with indicator access.
📩 Message @JoshuaDanford on TradingView with your username.
✅ Access granted within 72 hours.
提醒:在請求訪問權限之前,請閱讀僅限邀請腳本指南。
🚀 Founder of SciQua | Strategy. Simulation. Signals.
TradingView indicators, backtesting tools, weekly contests, and live market analysis.
Join free, compete, win, and stay updated at sciqua.com
TradingView indicators, backtesting tools, weekly contests, and live market analysis.
Join free, compete, win, and stay updated at sciqua.com
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。