PROTECTED SOURCE SCRIPT
מעודכן Optimus Pair Trader — Long/Short Two Symbols

This indicator implements a Pairs Trading Z-Score model to identify mean-reversion opportunities between two correlated assets. It allows you to select a second symbol in the settings, automatically calculates the hedge ratio (β) using rolling correlation, and computes a Z-score spread to visualize divergence and convergence between the pair.
When the Z-score rises above the +threshold, the spread is considered wide — signaling a Short A / Long B setup. When it falls below the −threshold, the spread is narrow — signaling a Long A / Short B setup. When the Z-score returns within the exit band, the trade is closed.
Features include:
• Dynamic hedge ratio (β) calculation
• Z-score chart with entry/exit bands
• One-time entry/exit signal labels per trade
• Synthetic cumulative P&L performance line
• Info table displaying active pair stats
• Built-in alert conditions for Long, Short, and Exit signals
Ideal for studying statistical arbitrage, market-neutral strategies, and algorithmic pair signals across stocks, ETFs, futures, or crypto.
When the Z-score rises above the +threshold, the spread is considered wide — signaling a Short A / Long B setup. When it falls below the −threshold, the spread is narrow — signaling a Long A / Short B setup. When the Z-score returns within the exit band, the trade is closed.
Features include:
• Dynamic hedge ratio (β) calculation
• Z-score chart with entry/exit bands
• One-time entry/exit signal labels per trade
• Synthetic cumulative P&L performance line
• Info table displaying active pair stats
• Built-in alert conditions for Long, Short, and Exit signals
Ideal for studying statistical arbitrage, market-neutral strategies, and algorithmic pair signals across stocks, ETFs, futures, or crypto.
הערות שחרור
Change Z to 2.0/0.5סקריפט מוגן
סקריפט זה פורסם כמקור סגור. עם זאת, אתה יכול להשתמש בו באופן חופשי וללא כל הגבלה - למד עוד כאן.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
סקריפט מוגן
סקריפט זה פורסם כמקור סגור. עם זאת, אתה יכול להשתמש בו באופן חופשי וללא כל הגבלה - למד עוד כאן.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.