Buscar en scripts para "威廉二世vs布雷达"
Bitcoin Exchanges Premium (Incl Int & GBTC) vs GdaxShows the exchange premiums internationally (Hong Kong, Luxembourg, Korea, Japan, China) vs Gdax. Also includes GBTC Trust price (adjusted).
Index Vs Futures v4.0 (dashed edition)Generalized script of
Originally designed for bitcoin, but can be used to compare between futures and index (or any two symbol expressions).
Conventions:
- green background := futures deviates 'way above' index
- red background := futures deviates 'way below' index
VS Score [SpiritualHealer117]An experimental indicator that uses historical prices and readings of technical indicators to give the probability that stock and crypto prices will be in a certain range on the next close. This indicator may be helpful for options traders or for traders who want to see the probability of a move.
It classifies returns into five categories:
Extreme Rise - Over 2 standard deviations above normal returns
Rise - Between 0.5 standard deviations and 2 standard deviations above normal returns
Flat - Falling in the range of +/- 0.5 standard deviations of normal returns
Fall - Between 0.5 standard deviations and 2 standard deviations below normal returns
Extreme Fall - Over 2 standard deviations below normal returns
It is an adaptive probability model, which trains on the previous 1000 data points, and is calculated by creating probability vectors for the current reading of the PPO, MA, volume histogram, and previous return, and combining them into one probability vector.
BOCS Channel Scalper Indicator - Mean Reversion Alert System# BOCS Channel Scalper Indicator - Mean Reversion Alert System
## WHAT THIS INDICATOR DOES:
This is a mean reversion trading indicator that identifies consolidation channels through volatility analysis and generates alert signals when price enters entry zones near channel boundaries. **This indicator version is designed for manual trading with comprehensive alert functionality.** Unlike automated strategies, this tool sends notifications (via popup, email, SMS, or webhook) when trading opportunities occur, allowing you to manually review and execute trades. The system assumes price will revert to the channel mean, identifying scalp opportunities as price reaches extremes and preparing to bounce back toward center.
## INDICATOR VS STRATEGY - KEY DISTINCTION:
**This is an INDICATOR with alerts, not an automated strategy.** It does not execute trades automatically. Instead, it:
- Displays visual signals on your chart when entry conditions are met
- Sends customizable alerts to your device/email when opportunities arise
- Shows TP/SL levels for reference but does not place orders
- Requires you to manually enter and exit positions based on signals
- Works with all TradingView subscription levels (alerts included on all plans)
**For automated trading with backtesting**, use the strategy version. For manual control with notifications, use this indicator version.
## ALERT CAPABILITIES:
This indicator includes four distinct alert conditions that can be configured independently:
**1. New Channel Formation Alert**
- Triggers when a fresh BOCS channel is identified
- Message: "New BOCS channel formed - potential scalp setup ready"
- Use this to prepare for upcoming trading opportunities
**2. Long Scalp Entry Alert**
- Fires when price touches the long entry zone
- Message includes current price, calculated TP, and SL levels
- Notification example: "LONG scalp signal at 24731.75 | TP: 24743.2 | SL: 24716.5"
**3. Short Scalp Entry Alert**
- Fires when price touches the short entry zone
- Message includes current price, calculated TP, and SL levels
- Notification example: "SHORT scalp signal at 24747.50 | TP: 24735.0 | SL: 24762.75"
**4. Any Entry Signal Alert**
- Combined alert for both long and short entries
- Use this if you want a single alert stream for all opportunities
- Message: "BOCS Scalp Entry: at "
**Setting Up Alerts:**
1. Add indicator to chart and configure settings
2. Click the Alert (⏰) button in TradingView toolbar
3. Select "BOCS Channel Scalper" from condition dropdown
4. Choose desired alert type (Long, Short, Any, or Channel Formation)
5. Set "Once Per Bar Close" to avoid false signals during bar formation
6. Configure delivery method (popup, email, webhook for automation platforms)
7. Save alert - it will fire automatically when conditions are met
**Alert Message Placeholders:**
Alerts use TradingView's dynamic placeholder system:
- {{ticker}} = Symbol name (e.g., NQ1!)
- {{close}} = Current price at signal
- {{plot_1}} = Calculated take profit level
- {{plot_2}} = Calculated stop loss level
These placeholders populate automatically, creating detailed notification messages without manual configuration.
## KEY DIFFERENCE FROM ORIGINAL BOCS:
**This indicator is designed for traders seeking higher trade frequency.** The original BOCS indicator trades breakouts OUTSIDE channels, waiting for price to escape consolidation before entering. This scalper version trades mean reversion INSIDE channels, entering when price reaches channel extremes and betting on a bounce back to center. The result is significantly more trading opportunities:
- **Original BOCS**: 1-3 signals per channel (only on breakout)
- **Scalper Indicator**: 5-15+ signals per channel (every touch of entry zones)
- **Trade Style**: Mean reversion vs trend following
- **Hold Time**: Seconds to minutes vs minutes to hours
- **Best Markets**: Ranging/choppy conditions vs trending breakouts
This makes the indicator ideal for active day traders who want continuous alert opportunities within consolidation zones rather than waiting for breakout confirmation. However, increased signal frequency also means higher potential commission costs and requires disciplined trade selection when acting on alerts.
## TECHNICAL METHODOLOGY:
### Price Normalization Process:
The indicator normalizes price data to create consistent volatility measurements across different instruments and price levels. It calculates the highest high and lowest low over a user-defined lookback period (default 100 bars). Current close price is normalized using: (close - lowest_low) / (highest_high - lowest_low), producing values between 0 and 1 for standardized volatility analysis.
### Volatility Detection:
A 14-period standard deviation is applied to the normalized price series to measure price deviation from the mean. Higher standard deviation values indicate volatility expansion; lower values indicate consolidation. The indicator uses ta.highestbars() and ta.lowestbars() to identify when volatility peaks and troughs occur over the detection period (default 14 bars).
### Channel Formation Logic:
When volatility crosses from a high level to a low level (ta.crossover(upper, lower)), a consolidation phase begins. The indicator tracks the highest and lowest prices during this period, which become the channel boundaries. Minimum duration of 10+ bars is required to filter out brief volatility spikes. Channels are rendered as box objects with defined upper and lower boundaries, with colored zones indicating entry areas.
### Entry Signal Generation:
The indicator uses immediate touch-based entry logic. Entry zones are defined as a percentage from channel edges (default 20%):
- **Long Entry Zone**: Bottom 20% of channel (bottomBound + channelRange × 0.2)
- **Short Entry Zone**: Top 20% of channel (topBound - channelRange × 0.2)
Long signals trigger when candle low touches or enters the long entry zone. Short signals trigger when candle high touches or enters the short entry zone. Visual markers (arrows and labels) appear on chart, and configured alerts fire immediately.
### Cooldown Filter:
An optional cooldown period (measured in bars) prevents alert spam by enforcing minimum spacing between consecutive signals. If cooldown is set to 3 bars, no new long alert will fire until 3 bars after the previous long signal. Long and short cooldowns are tracked independently, allowing both directions to signal within the same period.
### ATR Volatility Filter:
The indicator includes a multi-timeframe ATR filter to avoid alerts during low-volatility conditions. Using request.security(), it fetches ATR values from a specified timeframe (e.g., 1-minute ATR while viewing 5-minute charts). The filter compares current ATR to a user-defined minimum threshold:
- If ATR ≥ threshold: Alerts enabled
- If ATR < threshold: No alerts fire
This prevents notifications during dead zones where mean reversion is unreliable due to insufficient price movement. The ATR status is displayed in the info table with visual confirmation (✓ or ✗).
### Take Profit Calculation:
Two TP methods are available:
**Fixed Points Mode**:
- Long TP = Entry + (TP_Ticks × syminfo.mintick)
- Short TP = Entry - (TP_Ticks × syminfo.mintick)
**Channel Percentage Mode**:
- Long TP = Entry + (ChannelRange × TP_Percent)
- Short TP = Entry - (ChannelRange × TP_Percent)
Default 50% targets the channel midline, a natural mean reversion target. These levels are displayed as visual lines with labels and included in alert messages for reference when manually placing orders.
### Stop Loss Placement:
Stop losses are calculated just outside the channel boundary by a user-defined tick offset:
- Long SL = ChannelBottom - (SL_Offset_Ticks × syminfo.mintick)
- Short SL = ChannelTop + (SL_Offset_Ticks × syminfo.mintick)
This logic assumes channel breaks invalidate the mean reversion thesis. SL levels are displayed on chart and included in alert notifications as suggested stop placement.
### Channel Breakout Management:
Channels are removed when price closes more than 10 ticks outside boundaries. This tolerance prevents premature channel deletion from minor breaks or wicks, allowing the mean reversion setup to persist through small boundary violations.
## INPUT PARAMETERS:
### Channel Settings:
- **Nested Channels**: Allow multiple overlapping channels vs single channel
- **Normalization Length**: Lookback for high/low calculation (1-500, default 100)
- **Box Detection Length**: Period for volatility detection (1-100, default 14)
### Scalping Settings:
- **Enable Long Scalps**: Toggle long alert generation on/off
- **Enable Short Scalps**: Toggle short alert generation on/off
- **Entry Zone % from Edge**: Size of entry zone (5-50%, default 20%)
- **SL Offset (Ticks)**: Distance beyond channel for stop (1+, default 5)
- **Cooldown Period (Bars)**: Minimum spacing between alerts (0 = no cooldown)
### ATR Filter:
- **Enable ATR Filter**: Toggle volatility filter on/off
- **ATR Timeframe**: Source timeframe for ATR (1, 5, 15, 60 min, etc.)
- **ATR Length**: Smoothing period (1-100, default 14)
- **Min ATR Value**: Threshold for alert enablement (0.1+, default 10.0)
### Take Profit Settings:
- **TP Method**: Choose Fixed Points or % of Channel
- **TP Fixed (Ticks)**: Static distance in ticks (1+, default 30)
- **TP % of Channel**: Dynamic target as channel percentage (10-100%, default 50%)
### Appearance:
- **Show Entry Zones**: Toggle zone labels on channels
- **Show Info Table**: Display real-time indicator status
- **Table Position**: Corner placement (Top Left/Right, Bottom Left/Right)
- **Long Color**: Customize long signal color (default: darker green for readability)
- **Short Color**: Customize short signal color (default: red)
- **TP/SL Colors**: Customize take profit and stop loss line colors
- **Line Length**: Visual length of TP/SL reference lines (5-200 bars)
## VISUAL INDICATORS:
- **Channel boxes** with semi-transparent fill showing consolidation zones
- **Colored entry zones** labeled "LONG ZONE ▲" and "SHORT ZONE ▼"
- **Entry signal arrows** below/above bars marking long/short alerts
- **TP/SL reference lines** with emoji labels (⊕ Entry, 🎯 TP, 🛑 SL)
- **Info table** showing channel status, last signal, entry/TP/SL prices, risk/reward ratio, and ATR filter status
- **Visual confirmation** when alerts fire via on-chart markers synchronized with notifications
## HOW TO USE:
### For 1-3 Minute Scalping with Alerts (NQ/ES):
- ATR Timeframe: "1" (1-minute)
- ATR Min Value: 10.0 (for NQ), adjust per instrument
- Entry Zone %: 20-25%
- TP Method: Fixed Points, 20-40 ticks
- SL Offset: 5-10 ticks
- Cooldown: 2-3 bars to reduce alert spam
- **Alert Setup**: Configure "Any Entry Signal" for combined long/short notifications
- **Execution**: When alert fires, verify chart visuals, then manually place limit order at entry zone with provided TP/SL levels
### For 5-15 Minute Day Trading with Alerts:
- ATR Timeframe: "5" or match chart
- ATR Min Value: Adjust to instrument (test 8-15 for NQ)
- Entry Zone %: 20-30%
- TP Method: % of Channel, 40-60%
- SL Offset: 5-10 ticks
- Cooldown: 3-5 bars
- **Alert Setup**: Configure separate "Long Scalp Entry" and "Short Scalp Entry" alerts if you trade directionally based on bias
- **Execution**: Review channel structure on alert, confirm ATR filter shows ✓, then enter manually
### For 30-60 Minute Swing Scalping with Alerts:
- ATR Timeframe: "15" or "30"
- ATR Min Value: Lower threshold for broader market
- Entry Zone %: 25-35%
- TP Method: % of Channel, 50-70%
- SL Offset: 10-15 ticks
- Cooldown: 5+ bars or disable
- **Alert Setup**: Use "New Channel Formation" to prepare for setups, then "Any Entry Signal" for execution alerts
- **Execution**: Larger timeframes allow more analysis time between alert and entry
### Webhook Integration for Semi-Automation:
- Configure alert webhook URL to connect with platforms like TradersPost, TradingView Paper Trading, or custom automation
- Alert message includes all necessary order parameters (direction, entry, TP, SL)
- Webhook receives structured data when signal fires
- External platform can auto-execute based on alert payload
- Still maintains manual oversight vs full strategy automation
## USAGE CONSIDERATIONS:
- **Manual Discipline Required**: Alerts provide opportunities but execution requires judgment. Not all alerts should be taken - consider market context, trend, and channel quality
- **Alert Timing**: Alerts fire on bar close by default. Ensure "Once Per Bar Close" is selected to avoid false signals during bar formation
- **Notification Delivery**: Mobile/email alerts may have 1-3 second delay. For immediate execution, use desktop popups or webhook automation
- **Cooldown Necessity**: Without cooldown, rapidly touching price action can generate excessive alerts. Start with 3-bar cooldown and adjust based on alert volume
- **ATR Filter Impact**: Enabling ATR filter dramatically reduces alert count but improves quality. Track filter status in info table to understand when you're receiving fewer alerts
- **Commission Awareness**: High alert frequency means high potential trade count. Calculate if your commission structure supports frequent scalping before acting on all alerts
## COMPATIBLE MARKETS:
Works on any instrument with price data including stock indices (NQ, ES, YM, RTY), individual stocks, forex pairs (EUR/USD, GBP/USD), cryptocurrency (BTC, ETH), and commodities. Volume-based features are not included in this indicator version. Multi-timeframe ATR requires higher-tier TradingView subscription for request.security() functionality on timeframes below chart timeframe.
## KNOWN LIMITATIONS:
- **Indicator does not execute trades** - alerts are informational only; you must manually place all orders
- **Alert delivery depends on TradingView infrastructure** - delays or failures possible during platform issues
- **No position tracking** - indicator doesn't know if you're in a trade; you must manage open positions independently
- **TP/SL levels are reference only** - you must manually set these on your broker platform; they are not live orders
- **Immediate touch entry can generate many alerts** in choppy zones without adequate cooldown
- **Channel deletion at 10-tick breaks** may be too aggressive or lenient depending on instrument tick size
- **ATR filter from lower timeframes** requires TradingView Premium/Pro+ for request.security()
- **Mean reversion logic fails** in strong breakout scenarios - alerts will fire but trades may hit stops
- **No partial closing capability** - full position management is manual; you determine scaling out
- **Alerts do not account for gaps** or overnight price changes; morning alerts may be stale
## RISK DISCLOSURE:
Trading involves substantial risk of loss. This indicator provides signals for educational and informational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Mean reversion strategies can experience extended drawdowns during trending markets. Alerts are not guaranteed to be profitable and should be combined with your own analysis. Stop losses may not fill at intended levels during extreme volatility or gaps. Never trade with capital you cannot afford to lose. Consider consulting a licensed financial advisor before making trading decisions. Always verify alerts against current market conditions before executing trades manually.
## ACKNOWLEDGMENT & CREDITS:
This indicator is built upon the channel detection methodology created by **AlgoAlpha** in the "Smart Money Breakout Channels" indicator. Full credit and appreciation to AlgoAlpha for pioneering the normalized volatility approach to identifying consolidation patterns. The core channel formation logic using normalized price standard deviation is AlgoAlpha's original contribution to the TradingView community.
Enhancements to the original concept include: mean reversion entry logic (vs breakout), immediate touch-based alert generation, comprehensive alert condition system with customizable notifications, multi-timeframe ATR volatility filtering, cooldown period for alert management, dual TP methods (fixed points vs channel percentage), visual TP/SL reference lines, and real-time status monitoring table. This indicator version is specifically designed for manual traders who prefer alert-based decision making over automated execution.
BOCS Channel Scalper Strategy - Automated Mean Reversion System# BOCS Channel Scalper Strategy - Automated Mean Reversion System
## WHAT THIS STRATEGY DOES:
This is an automated mean reversion trading strategy that identifies consolidation channels through volatility analysis and executes scalp trades when price enters entry zones near channel boundaries. Unlike breakout strategies, this system assumes price will revert to the channel mean, taking profits as price bounces back from extremes. Position sizing is fully customizable with three methods: fixed contracts, percentage of equity, or fixed dollar amount. Stop losses are placed just outside channel boundaries with take profits calculated either as fixed points or as a percentage of channel range.
## KEY DIFFERENCE FROM ORIGINAL BOCS:
**This strategy is designed for traders seeking higher trade frequency.** The original BOCS indicator trades breakouts OUTSIDE channels, waiting for price to escape consolidation before entering. This scalper version trades mean reversion INSIDE channels, entering when price reaches channel extremes and betting on a bounce back to center. The result is significantly more trading opportunities:
- **Original BOCS**: 1-3 signals per channel (only on breakout)
- **Scalper Version**: 5-15+ signals per channel (every touch of entry zones)
- **Trade Style**: Mean reversion vs trend following
- **Hold Time**: Seconds to minutes vs minutes to hours
- **Best Markets**: Ranging/choppy conditions vs trending breakouts
This makes the scalper ideal for active day traders who want continuous opportunities within consolidation zones rather than waiting for breakout confirmation. However, increased trade frequency also means higher commission costs and requires tighter risk management.
## TECHNICAL METHODOLOGY:
### Price Normalization Process:
The strategy normalizes price data to create consistent volatility measurements across different instruments and price levels. It calculates the highest high and lowest low over a user-defined lookback period (default 100 bars). Current close price is normalized using: (close - lowest_low) / (highest_high - lowest_low), producing values between 0 and 1 for standardized volatility analysis.
### Volatility Detection:
A 14-period standard deviation is applied to the normalized price series to measure price deviation from the mean. Higher standard deviation values indicate volatility expansion; lower values indicate consolidation. The strategy uses ta.highestbars() and ta.lowestbars() to identify when volatility peaks and troughs occur over the detection period (default 14 bars).
### Channel Formation Logic:
When volatility crosses from a high level to a low level (ta.crossover(upper, lower)), a consolidation phase begins. The strategy tracks the highest and lowest prices during this period, which become the channel boundaries. Minimum duration of 10+ bars is required to filter out brief volatility spikes. Channels are rendered as box objects with defined upper and lower boundaries, with colored zones indicating entry areas.
### Entry Signal Generation:
The strategy uses immediate touch-based entry logic. Entry zones are defined as a percentage from channel edges (default 20%):
- **Long Entry Zone**: Bottom 20% of channel (bottomBound + channelRange × 0.2)
- **Short Entry Zone**: Top 20% of channel (topBound - channelRange × 0.2)
Long signals trigger when candle low touches or enters the long entry zone. Short signals trigger when candle high touches or enters the short entry zone. This captures mean reversion opportunities as price reaches channel extremes.
### Cooldown Filter:
An optional cooldown period (measured in bars) prevents signal spam by enforcing minimum spacing between consecutive signals. If cooldown is set to 3 bars, no new long signal will fire until 3 bars after the previous long signal. Long and short cooldowns are tracked independently, allowing both directions to signal within the same period.
### ATR Volatility Filter:
The strategy includes a multi-timeframe ATR filter to avoid trading during low-volatility conditions. Using request.security(), it fetches ATR values from a specified timeframe (e.g., 1-minute ATR while trading on 5-minute charts). The filter compares current ATR to a user-defined minimum threshold:
- If ATR ≥ threshold: Trading enabled
- If ATR < threshold: No signals fire
This prevents entries during dead zones where mean reversion is unreliable due to insufficient price movement.
### Take Profit Calculation:
Two TP methods are available:
**Fixed Points Mode**:
- Long TP = Entry + (TP_Ticks × syminfo.mintick)
- Short TP = Entry - (TP_Ticks × syminfo.mintick)
**Channel Percentage Mode**:
- Long TP = Entry + (ChannelRange × TP_Percent)
- Short TP = Entry - (ChannelRange × TP_Percent)
Default 50% targets the channel midline, a natural mean reversion target. Larger percentages aim for opposite channel edge.
### Stop Loss Placement:
Stop losses are placed just outside the channel boundary by a user-defined tick offset:
- Long SL = ChannelBottom - (SL_Offset_Ticks × syminfo.mintick)
- Short SL = ChannelTop + (SL_Offset_Ticks × syminfo.mintick)
This logic assumes channel breaks invalidate the mean reversion thesis. If price breaks through, the range is no longer valid and position exits.
### Trade Execution Logic:
When entry conditions are met (price in zone, cooldown satisfied, ATR filter passed, no existing position):
1. Calculate entry price at zone boundary
2. Calculate TP and SL based on selected method
3. Execute strategy.entry() with calculated position size
4. Place strategy.exit() with TP limit and SL stop orders
5. Update info table with active trade details
The strategy enforces one position at a time by checking strategy.position_size == 0 before entry.
### Channel Breakout Management:
Channels are removed when price closes more than 10 ticks outside boundaries. This tolerance prevents premature channel deletion from minor breaks or wicks, allowing the mean reversion setup to persist through small boundary violations.
### Position Sizing System:
Three methods calculate position size:
**Fixed Contracts**:
- Uses exact contract quantity specified in settings
- Best for futures traders (e.g., "trade 2 NQ contracts")
**Percentage of Equity**:
- position_size = (strategy.equity × equity_pct / 100) / close
- Dynamically scales with account growth
**Cash Amount**:
- position_size = cash_amount / close
- Maintains consistent dollar exposure regardless of price
## INPUT PARAMETERS:
### Position Sizing:
- **Position Size Type**: Choose Fixed Contracts, % of Equity, or Cash Amount
- **Number of Contracts**: Fixed quantity per trade (1-1000)
- **% of Equity**: Percentage of account to allocate (1-100%)
- **Cash Amount**: Dollar value per position ($100+)
### Channel Settings:
- **Nested Channels**: Allow multiple overlapping channels vs single channel
- **Normalization Length**: Lookback for high/low calculation (1-500, default 100)
- **Box Detection Length**: Period for volatility detection (1-100, default 14)
### Scalping Settings:
- **Enable Long Scalps**: Toggle long entries on/off
- **Enable Short Scalps**: Toggle short entries on/off
- **Entry Zone % from Edge**: Size of entry zone (5-50%, default 20%)
- **SL Offset (Ticks)**: Distance beyond channel for stop (1+, default 5)
- **Cooldown Period (Bars)**: Minimum spacing between signals (0 = no cooldown)
### ATR Filter:
- **Enable ATR Filter**: Toggle volatility filter on/off
- **ATR Timeframe**: Source timeframe for ATR (1, 5, 15, 60 min, etc.)
- **ATR Length**: Smoothing period (1-100, default 14)
- **Min ATR Value**: Threshold for trade enablement (0.1+, default 10.0)
### Take Profit Settings:
- **TP Method**: Choose Fixed Points or % of Channel
- **TP Fixed (Ticks)**: Static distance in ticks (1+, default 30)
- **TP % of Channel**: Dynamic target as channel percentage (10-100%, default 50%)
### Appearance:
- **Show Entry Zones**: Toggle zone labels on channels
- **Show Info Table**: Display real-time strategy status
- **Table Position**: Corner placement (Top Left/Right, Bottom Left/Right)
- **Color Settings**: Customize long/short/TP/SL colors
## VISUAL INDICATORS:
- **Channel boxes** with semi-transparent fill showing consolidation zones
- **Colored entry zones** labeled "LONG ZONE ▲" and "SHORT ZONE ▼"
- **Entry signal arrows** below/above bars marking long/short entries
- **Active TP/SL lines** with emoji labels (⊕ Entry, 🎯 TP, 🛑 SL)
- **Info table** showing position status, channel state, last signal, entry/TP/SL prices, and ATR status
## HOW TO USE:
### For 1-3 Minute Scalping (NQ/ES):
- ATR Timeframe: "1" (1-minute)
- ATR Min Value: 10.0 (for NQ), adjust per instrument
- Entry Zone %: 20-25%
- TP Method: Fixed Points, 20-40 ticks
- SL Offset: 5-10 ticks
- Cooldown: 2-3 bars
- Position Size: 1-2 contracts
### For 5-15 Minute Day Trading:
- ATR Timeframe: "5" or match chart
- ATR Min Value: Adjust to instrument (test 8-15 for NQ)
- Entry Zone %: 20-30%
- TP Method: % of Channel, 40-60%
- SL Offset: 5-10 ticks
- Cooldown: 3-5 bars
- Position Size: Fixed contracts or 5-10% equity
### For 30-60 Minute Swing Scalping:
- ATR Timeframe: "15" or "30"
- ATR Min Value: Lower threshold for broader market
- Entry Zone %: 25-35%
- TP Method: % of Channel, 50-70%
- SL Offset: 10-15 ticks
- Cooldown: 5+ bars or disable
- Position Size: % of equity recommended
## BACKTEST CONSIDERATIONS:
- Strategy performs best in ranging, mean-reverting markets
- Strong trending markets produce more stop losses as price breaks channels
- ATR filter significantly reduces trade count but improves quality during low volatility
- Cooldown period trades signal quantity for signal quality
- Commission and slippage materially impact sub-5-minute timeframe performance
- Shorter timeframes require tighter entry zones (15-20%) to catch quick reversions
- % of Channel TP adapts better to varying channel sizes than fixed points
- Fixed contract sizing recommended for consistent risk per trade in futures
**Backtesting Parameters Used**: This strategy was developed and tested using realistic commission and slippage values to provide accurate performance expectations. Recommended settings: Commission of $1.40 per side (typical for NQ futures through discount brokers), slippage of 2 ticks to account for execution delays on fast-moving scalp entries. These values reflect real-world trading costs that active scalpers will encounter. Backtest results without proper cost simulation will significantly overstate profitability.
## COMPATIBLE MARKETS:
Works on any instrument with price data including stock indices (NQ, ES, YM, RTY), individual stocks, forex pairs (EUR/USD, GBP/USD), cryptocurrency (BTC, ETH), and commodities. Volume-based features require data feed with volume information but are optional for core functionality.
## KNOWN LIMITATIONS:
- Immediate touch entry can fire multiple times in choppy zones without adequate cooldown
- Channel deletion at 10-tick breaks may be too aggressive or lenient depending on instrument tick size
- ATR filter from lower timeframes requires higher-tier TradingView subscription (request.security limitation)
- Mean reversion logic fails in strong breakout scenarios leading to stop loss hits
- Position sizing via % of equity or cash amount calculates based on close price, may differ from actual fill price
- No partial closing capability - full position exits at TP or SL only
- Strategy does not account for gap openings or overnight holds
## RISK DISCLOSURE:
Trading involves substantial risk of loss. Past performance does not guarantee future results. This strategy is for educational purposes and backtesting only. Mean reversion strategies can experience extended drawdowns during trending markets. Stop losses may not fill at intended levels during extreme volatility or gaps. Thoroughly test on historical data and paper trade before risking real capital. Use appropriate position sizing and never risk more than you can afford to lose. Consider consulting a licensed financial advisor before making trading decisions. Automated trading systems can malfunction - monitor all live positions actively.
## ACKNOWLEDGMENT & CREDITS:
This strategy is built upon the channel detection methodology created by **AlgoAlpha** in the "Smart Money Breakout Channels" indicator. Full credit and appreciation to AlgoAlpha for pioneering the normalized volatility approach to identifying consolidation patterns. The core channel formation logic using normalized price standard deviation is AlgoAlpha's original contribution to the TradingView community.
Enhancements to the original concept include: mean reversion entry logic (vs breakout), immediate touch-based signals, multi-timeframe ATR volatility filtering, flexible position sizing (fixed/percentage/cash), cooldown period filtering, dual TP methods (fixed points vs channel percentage), automated strategy execution with exit management, and real-time position monitoring table.
Advanced Correlation Monitor📊 Advanced Correlation Monitor - Pine Script v6
🎯 What does this indicator do?
Monitors real-time correlations between 13 different asset pairs and alerts you when historically strong correlations break, indicating potential trading opportunities or changes in market dynamics.
🚀 Key Features
✨ Multi-Market Monitoring
7 Forex Pairs (GBPUSD/DXY, EURUSD/GBPUSD, etc.)
6 Index/Stock Pairs (SPY/S&P500, DAX/NASDAQ, TSLA/NVDA, etc.)
Fully configurable - change any pair from inputs
📈 Dual Correlation Analysis
Long Period (90 bars): Identifies historically strong correlations
Short Period (6 bars): Detects recent breakdowns
Pearson Correlation using Pine Script v6 native functions
🎨 Intuitive Visualization
Real-time table with 6 information columns
Color coding: Green (correlated), Red (broken), Gray (normal)
Visual states: 🟢 OK, 🔴 BROKEN, ⚫ NORMAL
🚨 Smart Alert System
Only alerts previously correlated pairs (>80% historical)
Detects breakdowns when short correlation <80%
Consolidated alert with all affected pairs
🛠️ Flexible Configuration
Adjustable Parameters:
📅 Periods: Long (30-500), Short (2-50)
🎯 Threshold: 50%-99% (default 80%)
🎨 Table: Configurable position and size
📊 Symbols: All pairs are configurable
Default Pairs:
FOREX: INDICES/STOCKS:
- GBPUSD vs DXY • SPY vs S&P500
- EURUSD vs GBPUSD • DAX vs S&P500
- EURUSD vs DXY • DAX vs NASDAQ
- USDCHF vs DXY • TSLA vs NVDA
- GBPUSD vs USDCHF • MSFT vs NVDA
- EURUSD vs USDCHF • AAPL vs NVDA
- EURUSD vs EURCAD
💡 Practical Use Cases
🔄 Pairs Trading
Detects when strong correlations break for:
Statistical arbitrage
Mean reversion trading
Divergence opportunities
🛡️ Risk Management
Identifies when "safe" assets start moving independently:
Portfolio diversification
Smart hedging
Regime change detection
📊 Market Analysis
Understand underlying market structure:
Forex/DXY correlations
Tech sector rotation
Regional market disconnection
🎓 Results Interpretation
Reading Example:
EURUSD vs DXY: -98.57% → -98.27% | 🟢 OK
└─ Perfect negative correlation maintained (EUR rises when DXY falls)
TSLA vs NVDA: 78.12% → 0% | ⚫ NORMAL
└─ Lost tech correlation (divergence opportunity)
Trading Signals:
🟢 → 🔴: Broken correlation = Possible opportunity
Large difference: Indicates correlation tension
Multiple breaks: Market regime change
Super EMA PrismThis script implements the Binary Trade Logic (BTL) algorithm to calculate two distinct scores that range from 0 to 7. One score is calculated assigning a power of 2 weight to the positive sign of 3 Phi^3 distant Moving Average (MA) slopes. The other score is calculated assigning a power of 2 weight to the sign of the difference between the price and the value of 3 Phi^3 distant Moving Average (MA).
For the first score, hereafter called as the angle score (AS), the largest MA slope positive sign receives weight 4, the middle length MA slope positive sign receives weight 2 and the shortest MA slope positive sign receives weight 1. The positive sign of an MA is defined as 1 if the slope of the MA is positive and 0, otherwise. Therefore, for MAs 305, 72 and 17, if slope(MA305) > 0, slope(MA72) < 0 and slope(MA17) > 0, then score will be 4*1 + 2*0 + 1*1 = 5. Up to my knowledge, this score was first proposed by Bo Williams and named by him as Prisma.
For the second score, hereafter called as the value score (VS), if the price > largest MA, it receives weight 4. If the price > the middle length MA, it receives weight 2 and if the price > the the shortest MA, it receives weight 1. Therefore, for MAs 305, 72 and 17, if price < MA305, price > MA72 and price > MA17, then score will be 4*0 + 2*1 + 1*1 = 3. Up to my knowledge, this score was first proposed by Bo Williams and named by him as Prisma.
Both AS and VS are calculated for Phi^3 lengths (610, 144, 34) and for Phi^3/2 lengths (305, 72, 17). The scores of the same kind calculated for each set of length are combined multiplying the Phi^3 length score by 10 and adding with with the Phi^3/2 score, therefore providing a 2 digit score ranging from 0 to 77. For instance, if we have AS(610, 144, 34) = 7 and AS(305, 72, 17) = 5, we have AS=75. At the same time, if we have VS(610, 144, 34) = 6 and VS(305, 72, 17) = 4, we have VS=64.
VS score is plotted by default in black, but it can be on white for dark themes. AS is plotted with the color of the longest MA used.
Chart background is colored according to the range of values for AS and VS, checked in the following order:
if AS >= 13 and VS <= 13 then back color = red
if AS >= 13 or VS <= 13 then back color = orange
if AS >= 64 and VS >= 64 then back color = green
if AS >= 64 or VS >= 64 then back color = blue
otherwise back color = none (white o black)
Cross-Correlation Lead/Lag AnalyzerCross-Correlation Lead/Lag Analyzer (XCorr)
Discover which instrument moves first with advanced cross-correlation analysis.
This indicator analyzes the lead/lag relationship between any two financial instruments using rolling cross-correlation at multiple time offsets. Perfect for pairs trading, market timing, and understanding inter-market relationships.
Key Features:
Universal compatibility - Works with any two symbols (stocks, futures, forex, crypto, commodities)
Multi-timeframe analysis - Automatically adjusts lag periods based on your chart timeframe
Real-time correlation table - Shows current correlation values for all lag scenarios
Visual lead/lag detection - Color-coded plots make it easy to spot which instrument leads
Smart "Best" indicator - Automatically identifies the strongest relationship
How to Use:
Set your symbols in the indicator settings (default: NQ1! vs RTY1!)
Adjust correlation length (default: 20 periods for smooth but responsive analysis)
Watch the colored lines:
• Red/Orange: Symbol 2 leads Symbol 1 by 1-2 periods
• Blue: Instruments move simultaneously
• Green/Purple: Symbol 1 leads Symbol 2 by 1-2 periods
Check the table for exact correlation values and the "Best" relationship
Interpreting Results:
Correlation > 0.7: Strong positive relationship
Correlation 0.3-0.7: Moderate relationship
Correlation < 0.3: Weak/no relationship
Highest line indicates the optimal timing relationship
Popular Use Cases:
Index Futures : NQ vs ES, RTY vs IWM
Sector Rotation : XLF vs XLK, QQQ vs SPY
Commodities : GC vs SI, CL vs NG
Currency Pairs : EURUSD vs GBPUSD
Crypto : BTC vs ETH correlation analysis
Technical Notes:
Cross-correlation measures linear relationships between two time series at different time lags. This implementation uses Pearson correlation with adjustable periods, calculating correlations from -2 to +2 period offsets to detect leading/lagging behavior.
Perfect for quantitative analysts, pairs traders, and anyone studying inter-market relationships.
Ichimoku Power Indicator# Ichimoku Power Indicator
## Overview
The Ichimoku Power Indicator is an advanced tool that combines the traditional Ichimoku Cloud system with a unique power ranking mechanism. This indicator provides traders with a comprehensive view of market trends and potential reversal points, all while quantifying the strength of bullish and bearish signals.
## Key Features
1. **Full Ichimoku Cloud Visualization:** Displays all components of the Ichimoku Cloud system, including Conversion Line (Tenkan-sen), Base Line (Kijun-sen), Leading Span A and B (Kumo), and Lagging Span (Chikou Span).
2. **Power Ranking System:** Calculates and displays a bullish and bearish power score based on 11 different Ichimoku-derived conditions.
3. **Real-time Updates:** Power scores are updated in real-time as market conditions change.
4. **Easy-to-Read Display:** A clear, color-coded table shows the current bullish and bearish power scores.
5. **Customizable Parameters:** Allows adjustment of key Ichimoku settings to suit different trading styles and timeframes.
## How It Works
The indicator evaluates 11 different conditions derived from Ichimoku Cloud components:
1. Cloud color
2. Price position relative to the cloud
3. Tenkan-sen vs Kijun-sen
4. Price vs Tenkan-sen
5. Price vs Kijun-sen
6. Tenkan-sen vs Cloud
7. Kijun-sen vs Cloud
8. Chikou Span vs Cloud
9. Chikou Span vs Tenkan-sen
10. Chikou Span vs Kijun-sen
11. Chikou Span vs Price
Each bullish condition adds a point to the bullish power score, while each bearish condition adds a point to the bearish power score. The maximum score for each is 11.
## Interpretation
- Higher bullish scores suggest stronger upward trends or potential bullish reversals.
- Higher bearish scores indicate stronger downward trends or potential bearish reversals.
- When scores are close, it may indicate a period of consolidation or uncertainty.
## Use Cases
- Trend Confirmation: Use in conjunction with price action to confirm the strength of current trends.
- Reversal Detection: Watch for changes in power scores as early indicators of potential trend reversals.
- Entry and Exit Signals: High power scores can be used to identify optimal entry or exit points.
- Market Analysis: Gain a quick overview of market conditions across multiple assets or timeframes.
## Note
This indicator is designed to complement your existing trading strategy. Always use it in conjunction with other forms of analysis and proper risk management techniques.
Experiment with different timeframes and settings to find the configuration that best suits your trading style and the assets you trade.
Happy trading!
Price Divergence IndicatorThis Price Divergence Indicator indicator modifies the standard Divergence Indicator to look for price divergences between the current chart and any other selected TradingView chart.
The thesis that this indicator is built upon:
Prices on assets or indices that are normally correlated move in lock step. Where there are deviations between the confirmed highs or lows of two assets or indices it is likely that they will "catch up" in the near future.
By default it will load the price data for the SPX and look for price divergences on the current chart timeframe. Any TradingView Symbol can be selected as the 'Comparison Source' and any timeframe. Some of the options I've been trying out include:
SPX vs NDQ
XAO vs SPX
UK100 vs NDQM
MSFT vs NDQM
GOOG vs NDQM
AMZN vs MSFT
BTC vs ETH
BTC vs NDQ
BTC vs DXY
I've found looking for divergences on a longer timeframe can be useful and don't expect any meaningful results if you set it to shorter than chart timeframes.
Alerts can be created based on any of the divergences and the 'Backtest Buy Signal' can be used to send notification to a backtester (bull = 2, hidden bull = 1, neutral = 0, hidden bear = -1, bear = -2), this is plotted to display.none, so enable it in Settings - Style and disable all other plots to see it.
Divergences are measured between the CONFIRMED peaks of the two charts. The confirmation timeframe is set using 'Pivot Lookback Right'. The lower the lookback the quicker the signal and the more likely it is to not have hit an actual peak, a higher lookback will give a much more dependable signal but the move may be finished by the time the alert actually fires. The "Plot When Alerts Fire" option should give you an idea (top and bottom triangles) of what to expect, but you should watch bar replays to understand how your setting will impact when alerts are created and potential false positives.
Flux Power Dashboard (Updated and Renamed)Flux Power Dashboard is a compact market-state heads-up display for TradingView. It blends trend, momentum, and volume-flow into a single on-chart panel with color-coded cues and minimal lag. You get:
Clean visual trend via fast/slow MA with slope/debounce filters
MACD state and most recent cross (with “freshness” tint)
OBV confirmation and gating to reduce noise
Session awareness (Asia/London/New York + pre-sessions + overlap)
Optional HTF Regime row and regime gate to align signals to higher-timeframe bias
Context from VIX/VXN (volatility regime)
A single Flux Score (0–100) as a top-level read
It is deliberately “dashboard-first”: fast to read, consistent between symbols/timeframes, and designed to limit overtrading in chop.
What it can do (capabilities)
Signal gating: You can require multiple pillars to agree (Trend, MACD, OBV) before a “strong” bias is shown.
Debounced trend: Uses slope + confirmation bars to avoid flip-flopping.
Session presets: Auto-adjust the minimum confirmation bars by session (e.g., NY vs London vs Asia) to better match liquidity/volatility.
MACD presets: Quick switch between Scalp / Classic / Slow or roll your own custom speeds.
OBV confirmation: Volume flow must agree for trend/entries to “count” (optional).
HTF Regime awareness: Shows the higher-timeframe backdrop and (optionally) gates signals so you don’t fight the dominant trend.
Volatility context: VIX/VXN auto-colored cells based on your thresholds.
Top-center Session Title: Broadcasts the active session (or Overlap) with a matched background color.
Customizable UI: Column fonts, params font, transparency, dashboard corner, marker styles, colors, widths—tune it to your chart.
Practical use: Start with Flux Score + Summary for a snapshot, confirm with Trend & MACD, check OBV agreement (implicit in signal strength), glance at Regime to avoid counter-trend trades, and use Session + VIX/VXN for timing and risk context.
How it avoids common pitfalls
Repaint-aware: “Confirm on Close” can be enabled to read prior bar states, reducing intrabar noise.
Auto MA sanity: If fast ≥ slow length, it auto-swaps under the hood to keep calculations valid.
Debounce & confirm: Trend flips only after X bars satisfy conditions, cutting false flips in chop.
Freshness tint: New Cross/Signal rows tint slightly brighter for a few bars, so you can spot recency at a glance.
Every line of the dashboard (what it shows, how it’s colored)
Flux Score
What: Composite 0–100 built from three pillars: Trend (40%), MACD (30%), OBV (30%).
Read: ≥70 Bullish, ≤30 Bearish, else Neutral.
Use: Quick “state of play” gauge—stronger alignment pushes the score toward extremes.
Regime (optional row)
What: Higher-timeframe (your Regime TF) backdrop using the same MA pair with HTF slope/ATR buffer.
Values: Bull / Bear / Range.
Gate (optional): If Regime Gate is ON, Trend/Signals only go directional when HTF agrees.
Summary
What: One-line narrative combining the three pillars: MACD (up/down/flat), OBV (up/down/flat), Trend (up/down/flat).
Use: Human-readable cross-check; should rhyme with Flux Score.
Trend
What: Debounced MA relationship on the current chart.
Strict: needs fast > slow and slow rising (mirror for down) + slope debounce + confirmation bars.
Lenient: allows fast > slow or slow rising (mirror for down) with the same debounce/confirm.
Color: Green = UP, Red = DOWN, Gray = FLAT.
Use: Your structural bias on the trading timeframe.
MACD
What: Current MACD line vs signal, using your selected preset (or custom).
Values: Bull (line above), Bear (below), Flat (equal/indeterminate).
Color: Green/Red/Gray.
Cross
What: Most recent MACD cross and how many bars ago it occurred (e.g., “MACD XUP | 3 bars”).
Freshness: If the cross happened within Fresh Signal Tint bars, the cell brightens slightly.
Use: Timing helper for inflection points.
Signal
What: Latest directional shift (from short-bias to long-bias or vice versa) and age in bars.
Strength:
Strong = Trend + MACD + OBV all align
Weak = partial alignment (e.g., Trend + MACD, or Trend + OBV)
Color: Green for long bias, Red for short bias; fresh signals tint brighter.
Use: Action cue—treat Strong as higher quality; Weak as situational.
MA
What: Your slow MA type and length, plus slope direction (“up”/“down”).
Use: Context even when Trend is FLAT; slope often turns before full trend flips.
Session
What: Current market session by Eastern Time: New York / London / Asia, Pre- windows, Overlap, or Off-hours.
Logic: If ≥2 main sessions are active, shows Overlap (and grays the top title background).
Use: Timing and expectations for liquidity/volatility; also drives session-based confirmation presets if enabled.
VIX
What: Real-time CBOE:VIX on your chosen TF.
Auto-color (if on):
Calm (< Calm) → Green
Watch (< Watch) → Yellow
Elevated (< Elevated) → Orange
Very High (≥ Elevated) → Red
Use: Equity market–wide risk mood; higher = bigger moves, lower = quieter.
VXN
What: CBOE:VXN (Nasdaq volatility index) on your chosen TF.
Auto-color thresholds like VIX.
Use: Tech-heavy risk mood; helpful for growth/QQQ/NDX names.
Footer (params row, bottom-right)
What: Key live settings so you always know the context:
P= Trend Confirmation Bars
O= OBV Confirmation Bars
Strict/Lenient (trend mode)
MACD preset (or “Custom”)
swap if MA lengths were auto-swapped for validity
Regime gate if enabled
Candles for clarity
Use: Quick integrity check when comparing charts/screenshots or changing presets.
Recommended workflow
Start at Flux Score & Summary → snapshot of alignment.
Check Trend (color) and MACD (Bull/Bear).
Look at Signal (Strong vs Weak, and age).
Glance at Regime (and use gate if you’re trend-following).
Use Session + VIX/VXN to adjust expectations (breakout vs mean-revert, risk sizing, patience).
Keep Confirm on Close ON when you want stability; turn it OFF for faster (but noisier) reads.
Notes & limitations
Not advice: This is an informational tool; always combine with your own risk rules.
Repaint vs responsiveness: With “Confirm on Close” OFF you’ll see faster state changes but may get more churn intrabar.
Presets matter: Scalp MACD reacts fastest; Slow reduces whipsaw. Choose for your timeframe.
Session windows depend on the strings you set; adjust if your broker’s feed or DST handling needs tweaks.
Live Market - Performance MonitorLive Market — Performance Monitor
Study material (no code) — step-by-step training guide for learners
________________________________________
1) What this tool is — short overview
This indicator is a live market performance monitor designed for learning. It scans price, volume and volatility, detects order blocks and trendline events, applies filters (volume & ATR), generates trade signals (BUY/SELL), creates simple TP/SL trade management, and renders a compact dashboard summarizing market state, risk and performance metrics.
Use it to learn how multi-factor signals are constructed, how Greeks-style sensitivity is replaced by volatility/ATR reasoning, and how a live dashboard helps monitor trade quality.
________________________________________
2) Quick start — how a learner uses it (step-by-step)
1. Add the indicator to a chart (any ticker / timeframe).
2. Open inputs and review the main groups: Order Block, Trendline, Signal Filters, Display.
3. Start with defaults (OB periods ≈ 7, ATR multiplier 0.5, volume threshold 1.2) and observe the dashboard on the last bar.
4. Walk the chart back in time (use the last-bar update behavior) and watch how signals, order blocks, trendlines, and the performance counters change.
5. Run the hands-on labs below to build intuition.
________________________________________
3) Main configurable inputs (what you can tweak)
• Order Block Relevant Periods (default ~7): number of consecutive candles used to define an order block.
• Min. Percent Move for Valid OB (threshold): minimum percent move required for a valid order block.
• Number of OB Channels: how many past order block lines to keep visible.
• Trendline Period (tl_period): pivot lookback for detecting highs/lows used to draw trendlines.
• Use Wicks for Trendlines: whether pivot uses wicks or body.
• Extension Bars: how far trendlines are projected forward.
• Use Volume Filter + Volume Threshold Multiplier (e.g., 1.2): requires volume to be greater than multiplier × average volume.
• Use ATR Filter + ATR Multiplier: require bar range > ATR × multiplier to filter noise.
• Show Targets / Table settings / Colors for visualization.
________________________________________
4) Core building blocks — what the script computes (plain language)
Price & trend:
• Spot / LTP: current close price.
• EMA 9 / 21 / 50: fast, medium, slow moving averages to define short/medium trend.
o trend_bullish: EMA9 > EMA21 > EMA50
o trend_bearish: EMA9 < EMA21 < EMA50
o trend_neutral: otherwise
Volatility & noise:
• ATR (14): average true range used for dynamic target and filter sizing.
• dynamic_zone = ATR × atr_multiplier: minimum bar range required for meaningful move.
• Annualized volatility: stdev of price changes × sqrt(252) × 100 — used to classify volatility (HIGH/MEDIUM/LOW).
Momentum & oscillators:
• RSI 14: overbought/oversold indicator (thresholds 70/30).
• MACD: EMA(12)-EMA(26) and a 9-period signal line; histogram used for momentum direction and strength.
• Momentum (ta.mom 10): raw momentum over 10 bars.
Mean reversion / band context:
• Bollinger Bands (20, 2σ): upper, mid, lower.
o price_position measures where price sits inside the band range as 0–100.
Volume metrics:
• avg_volume = SMA(volume, 20) and volume_spike = volume > avg_volume × volume_threshold
o volume_ratio = volume / avg_volume
Support & Resistance:
• support_level = lowest low over 20 bars
• resistance_level = highest high over 20 bars
• current_position = percent of price between support & resistance (0–100)
________________________________________
5) Order Block detection — concept & logic
What it tries to find: a bar (the base) followed by N candles in the opposite direction (a classical order block setup), with a minimum % move to qualify. The script records the high/low of the base candle, averages them, and plots those levels as OB channels.
How learners should think about it (conceptual):
1. An order block is a signature area where institutions (theory) left liquidity — often seen as a large bar followed by a sequence of directional candles.
2. This indicator uses a configurable number of subsequent candles to confirm that the pattern exists.
3. When found, it stores and displays the base candle’s high/low area so students can see how price later reacts to those zones.
Implementation note for learners: the tool keeps a limited history of OB lines (ob_channels). When new OBs exceed the count, the oldest lines are removed — good practice to avoid clutter.
________________________________________
6) Trendline detection — idea & interpretation
• The script finds pivot highs and lows using a symmetric lookback (tl_period and half that as right/left).
• It then computes a trendline slope from successive pivots and projects the line forward (extension_bars).
• Break detection: Resistance break = close crosses above the projected resistance line; Support break = close crosses below projected support.
Learning tip: trendlines here are computed from pivot points and time. Watch how changing tl_period (bigger = smoother, fewer pivots) alters the trendlines and break signals.
________________________________________
7) Signal generation & filters — step-by-step
1. Primary triggers:
o Bullish trigger: order block bullish OR resistance trendline break.
o Bearish trigger: bearish order block OR support trendline break.
2. Filters applied (both must pass unless disabled):
o Volume filter: volume must be > avg_volume × volume_threshold.
o ATR filter: bar range (high-low) must exceed ATR × atr_multiplier.
o Not in an existing trade: new trades only start if trade_active is false.
3. Trend confirmation:
o The primary trigger is only confirmed if trend is bullish/neutral for buys or bearish/neutral for sells (EMA alignment).
4. Result:
o When confirmed, a long or short trade is activated with TP/SL calculated from ATR multiples.
________________________________________
8) Trade management — what the tool does after a signal
• Entry management: the script marks a trade as trade_active and sets long_trade or short_trade flags.
• TP & SL rules:
o Long: TP = high + 2×ATR ; SL = low − 1×ATR
o Short: TP = low − 2×ATR ; SL = high + 1×ATR
• Monitoring & exit:
o A trade closes when price reaches TP or SL.
o When TP/SL hit, the indicator updates win_count and total_pnl using a very simple calculation (difference between TP/SL and previous close).
o Visual lines/labels are drawn for TP and updated as the trade runs.
Important learner notes:
• The script does not store a true entry price (it uses close in its P&L math), so PnL is an approximation — treat this as a learning proxy, not a position accounting system.
• There’s no sizing, slippage, or fee accounted — students must manually factor these when translating to real trades.
• This indicator is not a backtesting strategy; strategy.* functions would be needed for rigorous backtest results.
________________________________________
9) Signal strength & helper utilities
• Signal strength is a composite score (0–100) made up of four signals worth 25 points each:
1. RSI extreme (overbought/oversold) → 25
2. Volume spike → 25
3. MACD histogram magnitude increasing → 25
4. Trend existence (bull or bear) → 25
• Progress bars (text glyphs) are used to visually show RSI and signal strength on the table.
Learning point: composite scoring is a way to combine orthogonal signals — study how changing weights changes outcomes.
________________________________________
10) Dashboard — how to read each section (walkthrough)
The dashboard is split into sections; here's how to interpret them:
1. Market Overview
o LTP / Change%: immediate price & daily % change.
2. RSI & MACD
o RSI value plus progress bar (overbought 70 / oversold 30).
o MACD histogram sign indicates bullish/bearish momentum.
3. Volume Analysis
o Volume ratio (current / average) and whether there’s a spike.
4. Order Block Status
o Buy OB / Sell OB: the average base price of detected order blocks or “No Signal.”
5. Signal Status
o 🔼 BUY or 🔽 SELL if confirmed, or ⚪ WAIT.
o No-trade vs Active indicator summarizing market readiness.
6. Trend Analysis
o Trend direction (from EMAs), market sentiment score (composite), volatility level and band/position metrics.
7. Performance
o Win Rate = wins / signals (percentage)
o Total PnL = cumulative PnL (approximate)
o Bull / Bear Volume = accumulated volumes attributable to signals
8. Support & Resistance
o 20-bar highest/lowest — use as nearby reference points.
9. Risk & R:R
o Risk Level from ATR/price as a percent.
o R:R Ratio computed from TP/SL if a trade is active.
10. Signal Strength & Active Trade Status
• Numeric strength + progress bar and whether a trade is currently active with TP/SL display.
________________________________________
11) Alerts — what will notify you
The indicator includes pre-built alert triggers for:
• Bullish confirmed signal
• Bearish confirmed signal
• TP hit (long/short)
• SL hit (long/short)
• No-trade zone
• High signal strength (score > 75%)
Training use: enable alerts during a replay session to be notified when the indicator would have signalled.
________________________________________
12) Labs — hands-on exercises for learners (step-by-step)
Lab A — Order Block recognition
1. Pick a 15–30 minute timeframe on a liquid ticker.
2. Use default OB periods (7). Mark each time the dashboard shows a Buy/Sell OB.
3. Manually inspect the chart at the base candle and the following sequence — draw the OB zone by hand and watch later price reactions to it.
4. Repeat with OB periods 5 and 10; note stability vs noise.
Lab B — Trendline break confirmation
1. Increase trendline period (e.g., 20), watch trendlines form from pivots.
2. When a resistance break is flagged, compare with MACD & volume: was momentum aligned?
3. Note false breaks vs confirmed moves — change extension_bars to see projection effects.
Lab C — Filter sensitivity
1. Toggle Use Volume Filter off, and record the number and quality of signals in a 2-day window.
2. Re-enable volume filter and change threshold from 1.2 → 1.6; note how many low-quality signals are filtered out.
Lab D — Trade management simulation
1. For each signalled trade, record the time, close entry approximation, TP, SL, and eventual hit/miss.
2. Compute actual PnL if you had entered at the open of the next bar to compare with the script’s PnL math.
3. Tabulate win rate and average R:R.
Lab E — Performance review & improvement
1. Build a spreadsheet of signals over 30–90 periods with columns: Date, Signal type, Entry price (real), TP, SL, Exit, PnL, Notes.
2. Analyze which filters or indicators contributed most to winners vs losers and adjust weights.
________________________________________
13) Common pitfalls, assumptions & implementation notes (things to watch)
• P&L simplification: total_pnl uses close as a proxy entry price. Real entry/exit prices and slippage are not recorded — so PnL is approximate.
• No position sizing or money management: the script doesn’t compute position size from equity or risk percent.
• Signal confirmation logic: composite "signal_strength" is a simple 4×25 point scheme — explore different weights or additional signals.
• Order block detection nuance: the script defines the base candle and checks the subsequent sequence. Be sure to verify whether the intended candle direction (base being bullish vs bearish) aligns with academic/your trading definition — read the code carefully and test.
• Trendline slope over time: slope is computed using timestamps; small differences may make lines sensitive on very short timeframes — using bar_index differences is usually more stable.
• Not a true backtester: to evaluate performance statistically you must transform the logic into a strategy script that places hypothetical orders and records exact entry/exit prices.
________________________________________
14) Suggested improvements for advanced learners
• Record true entry price & timestamp for accurate PnL.
• Add position sizing: risk % per trade using SL distance and account size.
• Convert to strategy. (Pine Strategy)* to run formal backtests with equity curves, drawdowns, and metrics (Sharpe, Sortino).
• Log trades to an external spreadsheet (via alerts + webhook) for offline analysis.
• Add statistics: average win/loss, expectancy, max drawdown.
• Add additional filters: news time blackout, market session filters, multi-timeframe confirmation.
• Improve OB detection: combine wick/body, volume spike at base bar, and liquidity sweep detection.
________________________________________
15) Glossary — quick definitions
• ATR (Average True Range): measure of typical range; used to size targets and stops.
• EMA (Exponential Moving Average): trend smoothing giving more weight to recent prices.
• RSI (Relative Strength Index): momentum oscillator; >70 overbought, <30 oversold.
• MACD: momentum oscillator using difference of two EMAs.
• Bollinger Bands: volatility bands around SMA.
• Order Block: a base candle area with subsequent confirmation candles; a zone of institutional interest (learning model).
• Pivot High/Low: local turning point defined by candles on both sides.
• Signal Strength: combined score from multiple indicators.
• Win Rate: proportion of signals that hit TP vs total signals.
• R:R (Risk:Reward): ratio of potential reward (TP distance) to risk (entry to SL).
________________________________________
16) Limitations & assumptions (be explicit)
• This is an indicator for learning — not a trading robot or broker connection.
• No slippage, fees, commissions or tie-in to real orders are considered.
• The logic is heuristic (rule-of-thumb), not a guarantee of performance.
• Results are sensitive to timeframe, market liquidity, and parameter choices.
________________________________________
17) Practical classroom / study plan (4 sessions)
• Session 1 — Foundations: Understand EMAs, ATR, RSI, MACD, Bollinger Bands. Run the indicator and watch how these numbers change on a single day.
• Session 2 — Zones & Filters: Study order blocks and trendlines. Test volume & ATR filters and note changes in false signals.
• Session 3 — Simulated trading: Manually track 20 signals, compute real PnL and compare to the dashboard.
• Session 4 — Improvement plan: Propose changes (e.g., better PnL accounting, alternative OB rule) and test their impact.
________________________________________
18) Quick reference checklist for each signal
1. Was an order block or trendline break detected? (primary trigger)
2. Did volume meet threshold? (filter)
3. Did ATR filter (bar size) show a real move? (filter)
4. Was trend aligned (EMA 9/21/50)? (confirmation)
5. Signal confirmed → mark entry approximation, TP, SL.
6. Monitor dashboard (Signal Strength, Volatility, No-trade zone, R:R).
7. After exit, log real entry/exit, compute actual PnL, update spreadsheet.
________________________________________
19) Educational caveat & final note
This tool is built for training and analysis: it helps you see how common technical building blocks combine into trade ideas, but it is not a trading recommendation. Use it to develop judgment, to test hypotheses, and to design robust systems with proper backtesting and risk control before risking capital.
________________________________________
20) Disclaimer (must include)
Training & Educational Only — This material and the indicator are provided for educational purposes only. Nothing here is investment advice or a solicitation to buy or sell financial instruments. Past simulated or historical performance does not predict future results. Always perform full backtesting and risk management, and consider seeking advice from a qualified financial professional before trading with real capital.
________________________________________
Chart-Only Scanner — Pro Table v2.5.1Chart-Only Scanner — Pro Table v2.5
User Manual (Pine Script v6)
What this tool does (in one line)
A compact, on-chart table that scores the current chart symbol (or an optional override) using momentum, volume, trend, volatility, and pattern checks—so you can quickly decide UP, DOWN, or WAIT.
Quick Start (90 seconds)
Add the indicator to any chart and timeframe (1m…1M).
Leave “Override chart symbol” = OFF to auto-use the chart’s symbol.
Choose your layout:
Row (wide horizontal strip), or Grid (title + labeled cells).
Pick a size preset (Micro, Small, Medium, Large, Mobile).
Optional: turn on “Use Higher TF (EMA 20/50)” and set HTF Multiplier (e.g., 4 ⇒ if chart is 15m, HTF is 60m).
Watch the table:
DIR (↑/↓/→), ROC%, MOM, VOL, EMA stack, HTF, REV, SCORE, ACT.
Add an alert if you want: the script fires when |SCORE| ≥ Action threshold.
What to expect
A small table appears on the chart corner you choose, updating each bar (or only at bar close if you keep default smart-update).
The ACT cell shows 🔥 (strong), 👀 (medium), or ⏳ (weak).
Panels & Settings (every option explained)
Core
Momentum Period: Lookback for rate-of-change (ROC%). Shorter = more reactive; longer = smoother.
ROC% Threshold: Minimum absolute ROC% to call direction UP (↑) or DOWN (↓); otherwise →.
Require Volume Confirmation: If ON and VOL ≤ 1.0, the SCORE is forced to 0 (prevents low-volume false positives).
Override chart symbol + Custom symbol: By default, the indicator uses the chart’s symbol. Turn this ON to lock to a specific ticker (e.g., a perpetual).
Higher TF
Use Higher TF (EMA 20/50): Compares EMA20 vs EMA50 on a higher timeframe.
HTF Multiplier: Higher TF = (chart TF × multiplier).
Example: on 3H chart with multiplier 2 ⇒ HTF = 6H.
Volatility & Oscillators
ATR Length: Used to show ATR% (ATR relative to price).
RSI Length: Standard RSI; colors: green ≤30 (oversold), red ≥70 (overbought).
Stoch %K Length: With %D = SMA(%K, 3).
MACD Fast/Slow/Signal: Standard MACD values; we display Line, Signal, Histogram (L/S/H).
ADX Length (Wilder): Wilder’s smoothing (internal derivation); also shows +DI / −DI if you enable the ADX column.
EMAs / Trend
EMA Fast/Mid/Slow: We compute EMA(20/50/200) by default (editable).
EMA Stack: Bull if Fast > Mid > Slow; Bear if Fast < Mid < Slow; Flat otherwise.
Benchmark (optional, OFF by default)
Show Relative Strength vs Benchmark: Displays RS% = ROC(symbol) − ROC(benchmark) over the Momentum Period.
Benchmark Symbol: Ticker used for comparison (e.g., BTCUSDT as a market proxy).
Columns (show/hide)
Toggle which fields appear in the table. Hiding unused fields keeps the layout clean (especially on mobile).
Display
Layout Mode:
Row = a single two-row strip; each column is a metric.
Grid = a title row plus labeled pairs (label/value) arranged in rows.
Size Preset: Micro, Small, Medium, Large, Mobile change text size and the grid density.
Table Corner: Where the panel sits (e.g., Top Right).
Opaque Table Background: ON = dark card; OFF = transparent(ish).
Update Every Bar: ON = update intra-bar; OFF = smart update (last bar / real-time / confirmed history).
Action threshold (|score|): The cutoff for 🔥 and alert firing (default 70).
How to read each field
CHART: The active symbol name (or your custom override).
DIR: ↑ (ROC% > threshold), ↓ (ROC% < −threshold), → otherwise.
ROC%: Rate of change over Momentum Period.
Formula: (Close − Close ) / Close × 100.
MOM: A scaled momentum score: min(100, |ROC%| × 10).
VOL: Volume ratio vs 20-bar SMA: Volume / SMA(Volume,20).
1.5 highlights as yellow (significant participation).
ATR%: (ATR / Close) × 100 (volatility relative to price).
RSI: Colored for extremes: ≤30 green, ≥70 red.
Stoch K/D: %K and %D numbers.
MACD L/S/H: Line, Signal, Histogram. Histogram color reflects sign (green > 0, red < 0).
ADX, +DI, −DI: Trend strength and directional components (Wilder). ADX ≥ 25 is highlighted.
EMA 20/50/200: Current EMA values (editable lengths).
STACK: Bull/Bear/Flat as defined above.
VWAP%: (Close − VWAP) / Close × 100 (premium/discount to VWAP).
HTF: ▲ if HTF EMA20 > EMA50; ▼ if <; · if flat/off.
RS%: Symbol’s ROC% − Benchmark ROC% (positive = outperforming).
REV (reversal):
🟢 Eng/Pin = bullish engulfing or bullish pin detected,
🔴 Eng/Pin = bearish engulfing or bearish pin,
· = none.
SCORE (absolute shown as a number; sign shown via DIR and ACT):
Components:
base = MOM × 0.4
volBonus = VOL > 1.5 ? 20 : VOL × 13.33
htfBonus = use_mtf ? (HTF == DIR ? 30 : HTF == 0 ? 15 : 0) : 0
trendBonus = (STACK == DIR) ? 10 : 0
macdBonus = 0 (placeholder for future versions)
scoreRaw = base + volBonus + htfBonus + trendBonus + macdBonus
SCORE = DIR ≥ 0 ? scoreRaw : −scoreRaw
If Require Volume Confirmation and VOL ≤ 1.0 ⇒ SCORE = 0.
ACT:
🔥 if |SCORE| ≥ threshold
👀 if 50 < |SCORE| < threshold
⏳ otherwise
Practical examples
Strong long (trend + participation)
DIR = ↑, ROC% = +3.2, MOM ≈ 32, VOL = 1.9, STACK = Bull, HTF = ▲, REV = 🟢
SCORE: base(12.8) + volBonus(20) + htfBonus(30) + trend(10) ≈ 73 → ACT = 🔥
Action idea: look for longs on pullbacks; confirm risk with ATR%.
Weak long (no volume)
DIR = ↑, ROC% = +1.0, but VOL = 0.8 and Require Volume Confirmation = ON
SCORE forced to 0 → ACT = ⏳
Action: wait for volume > 1.0 or turn off confirmation knowingly.
Bearish reversal warning
DIR = →, REV = 🔴 (bearish engulfing), RSI = 68, HTF = ▼
SCORE may be mid-range; ACT = 👀
Action: watch for breakdown and rising VOL.
Alerts (how to use)
The script calls alert() whenever |SCORE| ≥ Action threshold.
To receive pop-ups, sounds, or emails: click “⏰ Alerts” in TradingView, choose this indicator, and pick “Any alert() function call.”
The alert message includes: symbol, |SCORE|, DIR.
Layout, Size, and Corner tips
Row is best when you want a compact status ribbon across the top.
Grid is clearer on big screens or when you enable many columns.
Size:
Mobile = one pair per row (tall, readable)
Micro/Small = dense; good for many fields
Large = presentation/screenshots
Corner: If the table overlaps price, change the corner or set Opaque Background = OFF.
Repaint & timeframe behavior
Default smart update prefers stability (last bar / live / confirmed history).
For a stricter, “close-only” behavior (less repaint): turn Update Every Bar = OFF and avoid Heikin Ashi when you want raw market OHLC (HA modifies price inputs).
HTF logic is derived from a clean, integer multiple of your chart timeframe (via multiplier). It works with 3H/4H and any TF.
Performance notes
The script analyzes one symbol (chart or override) with multiple metrics using efficient tuple requests.
If you later want a multi-symbol grid, do it with pages (10–15 per page + rotate) to stay within platform limits (recommended future add-on).
Troubleshooting
No table visible
Ensure the indicator is added and not hidden.
Try toggling Opaque Background or switch Corner (it might be behind other drawings).
Keep Columns count reasonable for the chosen Size.
If you turned ON Override, verify the Custom symbol exists on your data provider.
Numbers look different on HA candles
Heikin Ashi modifies OHLC; switch to regular candles if you need raw price metrics.
3H/4H issues
Use integer HTF Multiplier (e.g., 2, 4). The tool builds the correct string internally; no manual timeframe strings needed.
Power user tips
Volume gating: keeping Require Volume Confirmation = ON filters most fake moves; if you’re a scalper, reduce strictness or turn it off.
Action threshold: 60–80 is typical. Higher = fewer but stronger signals.
Benchmark RS%: great for spotting leaders/laggards; positive RS% = outperformance vs benchmark.
Change policy & safety
This version doesn’t alter your historical logic you tested (no radical changes).
Any future “radical” change (score weights, HTF logic, UI hiding data) will ship with a toggle and an Impact Statement so you can keep old behavior if you prefer.
Glossary (quick)
ROC%: Percent change over N bars.
MOM: Scaled momentum (0–100).
VOL ratio: Volume vs 20-bar average.
ATR%: ATR as % of price.
ADX/DI: Trend strength / direction components (Wilder).
EMA stack: Relationship between EMAs (bullish/bearish/flat).
VWAP%: Premium/discount to VWAP.
RS%: Relative strength vs benchmark.
Asset Premium/Discount Monitor📊 Overview
The Asset Premium/Discount Monitor is a tool for analyzing the relative value between two correlated assets. It measures when one asset is trading at a premium or discount compared to its historical relationship with another asset, helping traders identify potential mean reversion opportunities, or pairs trading opportunities.
🎯 Use Cases
Perfect for analyzing:
NASDAQ:MSTR vs CRYPTO:BTCUSD - MicroStrategy's premium/discount to Bitcoin
NASDAQ:COIN vs BITSTAMP:BTCUSD - Coinbase's relative value to Bitcoin
NASDAQ:TSLA vs NASDAQ:QQQ - Tesla's premium to tech sector
Regional banks AMEX:KRE vs AMEX:XLF - Individual bank stocks vs financial sector
Any two correlated assets where relative value matters
Example of a trade: MSTR vs BTC - When indicator shows MSTR at 95% percentile (extreme premium): Short MSTR, Buy BTC. Then exit when the spread reverts to the mean, say 40-60% percentile.
🔧 How It Works
Core Calculation
Ratio Analysis: Calculates the price ratio between your asset and the correlated asset
Historical Baseline: Establishes the "normal" relationship using a 252-day moving average. You can change this.
Premium Measurement: Measures current deviation from historical average as a percentage
Statistical Context: Provides percentile rankings and standard deviation bands
The Math
Premium % = (Current Ratio / Historical Average Ratio - 1) × 100
🎨 Customization Options
Correlated Asset: Choose any symbol for comparison
Lookback Period: Adjust historical baseline (50-1000 days)
Smoothing: Reduce noise with moving average (1-50 days)
Visual Toggles: Show/hide bands and percentile lines
Color Themes: Customize premium/discount colors
📊 Interpretation Guide
Premium/Discount Reading
Positive %: Asset trading above historical relationship (premium)
Negative %: Asset trading below historical relationship (discount)
Near 0%: Asset at fair value relative to correlation
Percentile Ranking
90%+: Near recent highs - potential selling opportunity
10% and below: Near recent lows - potential buying opportunity
25-75%: Normal trading range
Signal Classifications
🔴 SELL PREMIUM: Asset expensive relative to recent range
🟡 Premium Rich: Moderately expensive, monitor for reversal
⚪ NEUTRAL: Fair value territory
🟡 Discount Opportunity: Moderately cheap, potential accumulation zone
🟢 BUY DISCOUNT: Asset cheap relative to recent range
🚨 Built-in Alerts
Extreme Premium Alert: Triggers when percentile > 95%
Extreme Discount Alert: Triggers when percentile < 5%
⚠️ Important Notes
Works best with highly correlated assets
Historical relationships can change - monitor correlation strength
Not investment advice - use as one factor in your analysis
Backtest thoroughly before implementing any strategy
🔄 Updates & Future Features
This indicator will be continuously improved based on user feedback. So... please give me your feedback!
SynchroTrend Oscillator (STO) [PhenLabs]📊 SynchroTrend Oscillator
Version: PineScript™ v5
📌 Description
The SynchroTrend Oscillator (STO) is a multi-timeframe synchronization tool that combines trend information from three distinct timeframes into a single, easy-to-interpret oscillator ranging from -100 to +100.
This indicator solves the common problem of having to analyze multiple timeframe charts separately by consolidating trend direction and strength across different time horizons. The STO helps traders identify when markets are truly synchronized across timeframes, potentially indicating stronger trend conditions and higher probability trading opportunities.
Using either Moving Average crossovers or RSI analysis as the trend definition metric, the STO provides a comprehensive view of market structure that adapts to various trading strategies and market conditions.
🚀 Points of Innovation
Triple-timeframe synchronization in a single view eliminates chart switching
Dual trend detection methods (MA vs Price or RSI) for flexibility across different markets
Dynamic color intensity that automatically increases with signal strength
Scaled oscillator format (-100 to +100) for intuitive trend strength interpretation
Customizable signal thresholds to match your risk tolerance and trading style
Visual alerts when markets reach full synchronization states
🔧 Core Components
Trend Scoring System: Calculates a binary score (+1, -1, or 0) for each timeframe based on selected metrics, providing clear trend direction
Multi-Timeframe Synchronization: Combines and scales trend scores from all three timeframes into a single oscillator
Dynamic Visualization: Adjusts color transparency based on signal strength, creating an intuitive visual guide
Threshold System: Provides customizable levels for identifying potentially significant trading opportunities
🔥 Key Features
Triple Timeframe Analysis: Synchronizes three user-defined timeframes (default: 60min, 15min, 5min) into one view
Dual Trend Detection Methods: Choose between Moving Average vs Price or RSI-based trend determination
Adjustable Signal Smoothing: Apply EMA, SMA, or no smoothing to the oscillator output for your preferred signal responsiveness
Dynamic Color Intensity: Colors become more vibrant as signal strength increases, helping identify strongest setups
Customizable Thresholds: Set your own buy/sell threshold levels to match your trading strategy
Comprehensive Alerts: Six different alert conditions for crossing thresholds, zero line, and full synchronization states
🎨 Visualization
Oscillator Line: The main line showing the synchronized trend value from -100 to +100
Dynamic Fill: Area between oscillator and zero line changes transparency based on signal strength
Threshold Lines: Optional dotted lines indicating buy/sell thresholds for visual reference
Color Coding: Green for bullish synchronization, red for bearish synchronization
📖 Usage Guidelines
Timeframe Settings
Timeframe 1: Default: 60 (1 hour) - Primary higher timeframe for trend definition
Timeframe 2: Default: 15 (15 minutes) - Intermediate timeframe for trend definition
Timeframe 3: Default: 5 (5 minutes) - Lower timeframe for trend definition
Trend Calculation Settings
Trend Definition Metric: Default: “MA vs Price” - Method used to determine trend on each timeframe
MA Type: Default: EMA - Moving Average type when using MA vs Price method
MA Length: Default: 21 - Moving Average period when using MA vs Price method
RSI Length: Default: 14 - RSI period when using RSI method
RSI Source: Default: close - Price data source for RSI calculation
Oscillator Settings
Smoothing Type: Default: SMA - Applies smoothing to the final oscillator
Smoothing Length: Default: 5 - Period for the smoothing function
Visual & Threshold Settings
Up/Down Colors: Customize colors for bullish and bearish signals
Transparency Range: Control how transparency changes with signal strength
Line Width: Adjust oscillator line thickness
Buy/Sell Thresholds: Set levels for potential entry/exit signals
✅ Best Use Cases
Trend confirmation across multiple timeframes
Finding high-probability entry points when all timeframes align
Early detection of potential trend reversals
Filtering trade signals from other indicators
Market structure analysis
Identifying potential divergences between timeframes
⚠️ Limitations
Like all indicators, can produce false signals during choppy or ranging markets
Works best in trending market conditions
Should not be used in isolation for trading decisions
Past performance is not indicative of future results
May require different settings for different markets or instruments
💡 What Makes This Unique
Combines three timeframes in a single visualization without requiring multiple chart windows
Dynamic transparency feature that automatically emphasizes stronger signals
Flexible trend definition methods suitable for different market conditions
Visual system that makes multi-timeframe analysis intuitive and accessible
🔬 How It Works
1. Trend Evaluation:
For each timeframe, the indicator calculates a trend score (+1, -1, or 0) using either:
MA vs Price: Comparing close price to a moving average
RSI: Determining if RSI is above or below 50
2. Score Aggregation:
The three trend scores are combined and then scaled to a range of -100 to +100
A value of +100 indicates all timeframes show bullish conditions
A value of -100 indicates all timeframes show bearish conditions
Values in between indicate varying degrees of alignment
3. Signal Processing:
The raw oscillator value can be smoothed using EMA, SMA, or left unsmoothed
The final value determines line color, fill color, and transparency settings
Threshold levels are applied to identify potential trading opportunities
💡 Note:
The SynchroTrend Oscillator is most effective when used as part of a comprehensive trading strategy that includes proper risk management techniques. For best results, consider using the oscillator in conjunction with support/resistance levels, price action analysis, and other complementary indicators that align with your trading style.
OverUnder Yield Spread🗺️ OverUnder is a structural regime visualizer , engineered to diagnose the shape, tone, and trajectory of the yield curve. Rather than signaling trades directly, it informs traders of the world they’re operating in. Yield curve steepening or flattening, normalizing or inverting — each regime reflects a macro pressure zone that impacts duration demand, liquidity conditions, and systemic risk appetite. OverUnder abstracts that complexity into a color-coded compression map, helping traders orient themselves before making risk decisions. Whether you’re in bonds, currencies, crypto, or equities, the regime matters — and OverUnder makes it visible.
🧠 Core Logic
Built to show the slope and intent of a selected rate pair, the OverUnder Yield Spread defaults to 🇺🇸US10Y-US2Y, but can just as easily compare global sovereign curves or even dislocated monetary systems. This value is continuously monitored and passed through a debounce filter to determine whether the curve is:
• Inverted, or
• Steepening
If the curve is flattening below zero: the world is bracing for contraction. Policy lags. Risk appetite deteriorates. Duration gets bid, but only as protection. Stocks and speculative assets suffer, regardless of positioning.
📍 Curve Regimes in Bull and Bear Contexts
• Flattening occurs when the short and long ends compress . In a bull regime, flattening may reflect long-end demand or fading growth expectations. In a bear regime, flattening often precedes or confirms central bank tightening.
• Steepening indicates expanding spread . In a bull context, this may signal healthy risk appetite or early expansion. In a bear or crisis context, it may reflect aggressive front-end cuts and dislocation between short- and long-term expectations.
• If the curve is steepening above zero: the world is rotating into early expansion. Risk assets behave constructively. Bond traders position for normalization. Equities and crypto begin trending higher on rising forward expectations.
🖐️ Dynamically Colored Spread Line Reflects 1 of 4 Regime States
• 🟢 Normal / Steepening — early expansion or reflation
• 🔵 Normal / Flattening — late-cycle or neutral slowdown
• 🟠 Inverted / Steepening — policy reversal or soft landing attempt
• 🔴 Inverted / Flattening — hard contraction, credit stress, policy lag
🍋 The Lemon Label
At every bar, an anchored label floats directly on the spread line. It displays the active regime (in plain English) and the precise spread in percent (or basis points, depending on resolution). Colored lemon yellow, neither green nor red, the label is always legible — a design choice to de-emphasize bias and center the data .
🎨 Fill Zones
These bands offer spatial, persistent views of macro compression or inversion depth.
• Blue fill appears above the zero line in normal (non-inverted) conditions
• Red fill appears below the zero line during inversion
🧪 Sample Reading: 1W chart of TLT
OverUnder reveals a multi-year arc of structural inversion and regime transition. From mid-2021 through late 2023, the spread remains decisively inverted, signaling persistent flattening and credit stress as bond prices trended sharply lower. This prolonged inversion aligns with a high-volatility phase in TLT, marked by lower highs and an accelerating downtrend, confirming policy lag and macro tightening conditions.
As of early 2025, the spread has crossed back above the zero baseline into a “Normal / Steepening” regime (annotated at +0.56%), suggesting a macro inflection point. Price action remains subdued, but the shift in yield structure may foreshadow a change in trend context — particularly if follow-through in steepening persists.
🎭 Different Traders Respond Differently:
• Bond traders monitor slope change to anticipate policy pivots or recession signals.
• Equity traders use regime shifts to time rotations, from growth into defense, or from contraction into reflation.
• Currency traders interpret curve steepening as yield compression or divergence depending on region.
• Crypto traders treat inversion as a liquidity vacuum — and steepening as an early-phase risk unlock.
🛡️ Can It Compare Different Bond Markets?
Yes — with caveats. The indicator can be used to compare distinct sovereign yield instruments, for example:
• 🇫🇷FR10Y vs 🇩🇪DE10Y - France vs Germany
• 🇯🇵JP10Y vs 🇺🇸US10Y - BoJ vs Fed policy curves
However:
🙈 This no longer visualizes the domestic yield curve, but rather the differential between rate expectations across regions
🙉 The interpretation of “inversion” changes — it reflects spread compression across nations , not within a domestic yield structure
🙊 Color regimes should then be viewed as relative rate positioning , not absolute curve health
🙋🏻 Example: OverUnder compares French vs German 10Y yields
1. 🇫🇷 Change the long-duration ticker to FR10Y
2. 🇩🇪 Set the short-duration ticker to DE10Y
3. 🤔 Interpret the result as: “How much higher is France’s long-term borrowing cost vs Germany’s?”
You’ll see steepening when the spread rises (France decoupling), flattening when the spread compresses (convergence), and inversions when Germany yields rise above France’s — historically rare and meaningful.
🧐 Suggested Use
OverUnder is not a signal engine — it’s a context map. Its value comes from situating any trade idea within the prevailing yield regime. Use it before entries, not after them.
• On the 1W timeframe, OverUnder excels as a macro overlay. Yield regime shifts unfold over quarters, not days. Weekly structure smooths out rate volatility and reveals the true curvature of policy response and liquidity pressure. Use this view to orient your portfolio, define directional bias, or confirm long-duration trend turns in assets like TLT, SPX, or BTC.
• On the 1D timeframe, the indicator becomes tactically useful — especially when aligning breakout setups or trend continuations with steepening or flattening transitions. Daily views can also identify early-stage regime cracks that may not yet be visible on the weekly.
• Avoid sub-daily use unless you’re anchoring a thesis already built on higher timeframe structure. The yield curve is a macro construct — it doesn’t oscillate cleanly at intraday speeds. Shorter views may offer clarity during event-driven spikes (like FOMC reactions), but they do not replace weekly context.
Ultimately, OverUnder helps you decide: What kind of world am I trading in? Use it to confirm macro context, avoid fighting the curve, and lean into trades aligned with the broader pressure regime.
See inside Candles: Directionality %; Constituent Bars & GapsSee inside candles based on user-input LTF setting: get data on 'Directionality' of your candle; Gaps (total and Sum; UP and DOWN); Number of Bull or Bear constituent candles
//Features:
-DIRECTIONALITY: compare length of the 'zig-zag' random walk of lower time frame constituent candles, to the full height of the current candle. Resulting % I refer to as 'directionality'.
-GAPs: what i refer to as 'gaps' are also known as Volume imbalances: the gap between previous candles close and current candle's open (if there is one).
--Gaps total (up vs down gaps). Number of Up gaps printed above bar in green, down gaps printed below bar in red.
--Gaps Sum (total summed UP gap, total summed down gaps. Sum of Up gaps printed above bar in green, Sum of down gaps printed below bar in red.
-Candles Total: Numer of LTF up vs down candles within current timeframe candle. Number of up candles printed above bar in green, Number of down candles printed below bar in red.
//USAGE:
-Primary purpose in this was the Directionality aspect. Wanted to get a measure of how choppy vs how directional the internals of a candle were. Idea being that a candle with high % directionality (approaching 100) would imply trending conditions; while a candle which was large range and full bodies but had a low % directionality would imply the internals were back-and-forth and => rebalanced, potentially indicating price may not need to retrace back into it and rebalance further. All rather experimental, please treat it as such: have a play around with it.
-Number of gaps, Sums of up and down gaps, ratio of up and down constituent candles also intended to serve a similar purpose as the above.
-Set the input lower timeframe; this must obviously be lower then your current timeframe. You will significant differences in results depending on the ratio your timeframes (chart timeframe vs user-input timeframe).
//User Inputs:
-Lower timeframe input (setting child candle size within current chart parent candle).
-Choose function from the four listed above.
-typical formating options: Bull color/bear color txt for gaps functions.
-display % unit or not.
-display vertical or horizontal text.
-Set min / max directionality thresholds; and color code results.
-Toggle on/off 'hide results outside of threshold' to declutter the chart.
-choose label style.
//NOTES:
-Directionality thresholds can be set manually; Max and Min thresholds can be set to filter out 'non-extreme' readings.
-Note that directionality % can sometimes exceed 100%, in cases where price trends very strongly and gaps up continuously such that sum of constituent candles is less than total range of parent candle.
-Personally i like the idea of seeking bold, large-range, full bodied candles, with a lower than typical directionality %; indicating that a price move is both significant and it's already done it's rebalancing; I would see this as potentially favourable for continuation (obviously depending on context).
---- Showcase of the other functions beyond Directionality percentage ----
Candles Total (bull vs Bear). ES1! Hourly; ltf = 5min: Candles total: LTF up candles and LTF down candles making up the current HTF candle (constituent number of UP candles printed above in green, Down candles printed below in red):
Gaps SUM. SPX hourly, ltf = 5min. Sum of 'UP' gaps within candle printed above in green, sum of 'DOWN' gaps printed below in red:
Gaps TOTAL: SPX hourly, ltf = 1min. Simply the total of 'up' gaps vs 'down' gaps withing our candle; based on the user input constituent candles within:
Correlation Coefficient: Visible Range Dynamic Average R -Correlation Coefficient with Dynamic Average R (shows R average for the visible chart only, changes as you zoom in or out)
-Label: Vis-Avg-R = Visable Average R
-the Correlation Coefficient function for Pearson's R is taken from "BA🐷 CC" indicator by @balipour (highly recommended; more thorough treatment of R and other stats, but without the dynamic average)
-I wrote this primarily to add a dynamic Average R, showing correlation for arbitrary start times/end times; whether it be the last month, last year, of some specific period from the past (backtest mode)
-I have been using this to get an idea of correlation regimes over time between Bonds vs Stocks (ZB1! vs ES1!).
-As you see from the above, most of 2022 has seen an unusually strong positive correlation between Bonds and Stocks
~~inputs:
-lookback length for calculation of R
-Backtest mode (true by default): displays Average R for ONLY the visible range displayed on any part of chart history (LHS to RHS of screen only)
-source for both Ticker and compared Asset (close, open, high, low, ohlc4.. etc)
~~some other assets worth comparing:
Aussie vs Gold; Aussie vs ES; Btc vs ES; Copper vs ES