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提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。