leo.usdt RSIThis is a custom RSI-based indicator enhanced with Bollinger Band logic to give early visual signals and potential trading alerts. It’s designed to help traders identify:
• Overbought/oversold conditions
• Potential reversals
• Areas of market neutrality or retracement
• Strong or weak trade signal zones
• RSI-based alerts in combination with price volatility (via Bollinger Bands)
⸻
Key Components:
1. RSI Calculation
• Standard Relative Strength Index (RSI) with a default length of 21.
• Source: close price.
• Output RSI is color-coded:
• Red if RSI > 62 (overbought)
• Blue if RSI < 24 (oversold)
• Green otherwise
2. RSI Zones and Visual Labels
• Horizontal lines mark 6 key RSI zones:
• 80 = Upper Bound (extreme overbought)
• 62 = Strong Sell
• 50 = Possible Retrace
• 38 = Neutral
• 24 = Possible Reversal
• 16 = Strong Buy
• Backgrounds between these zones are color-shaded to visually differentiate them.
• Optional labels (controlled via checkbox) appear on the RSI chart to show zone names.
3. Bollinger Bands Logic
• Bollinger Bands use:
• Length = 20 (default)
• Multiplier = 2.0 (default)
• The BB logic categorizes price position relative to bands:
• BB = 71: Price above upper band
• BB = 56: Price in upper half
• BB = 44: Price in middle
• BB = 31: Price in lower half
• BB = 20: Price below lower band
4. Combined RSI + BB Signal Circles
• Two types of visual circles appear on the RSI chart:
• Small Signal (line width = 2):
• RSI > 50 and price > BB upper band → small sell signal (red)
• RSI < 38 and price < BB lower band → small buy signal (blue)
• Strong Signal (line width = 4):
• RSI > 62 and price > BB upper band → strong sell
• RSI < 24 and price < BB lower band → strong buy
5. Alerts
This script includes 4 alert conditions:
• Small Sell: RSI > 50 and price above BB upper band
• Small Buy: RSI < 38 and price below BB lower band
• Strong Sell: RSI > 62 and price above BB upper band
• Strong Buy: RSI < 24 and price below BB lower band
⸻
User Controls:
• Change RSI length.
• Change Bollinger Band length and multiplier.
• Toggle signals (circles) on/off.
• Toggle RSI zone labels on/off.
• Optional RSI zone background shading for easy visualization.
⸻
Use Case:
This script is ideal for:
• Traders looking to combine momentum (RSI) with volatility (BB) for better signal accuracy.
• Spotting potential trend reversals, retracement zones, and extreme conditions.
• Getting visual and audible alerts to act faster during key moments.
趨勢分析
TimeMapTimeMap is a visual price-reference indicator designed to help traders rapidly visualize how current price levels relate to significant historical closing prices. It overlays your chart with reference lines representing past weekly, monthly, quarterly (3-month), semi-annual (6-month), and annual closing prices. By clearly plotting these historical price references, TimeMap helps traders quickly gauge price position relative to historical market structure, aiding in the identification of trends, support/resistance levels, and potential reversals.
How it Works:
The indicator calculates the precise number of historical bars corresponding to weekly, monthly, quarterly, semi-annual, and annual intervals, dynamically adjusting according to your chart’s timeframe (intraday, daily, weekly, monthly) and chosen market type (Stocks US, Crypto, Forex, or Futures). Historical closing prices from these periods are plotted directly on your chart as horizontal reference lines.
For intraday traders, the script accurately calculates historical offsets considering regular and extended trading sessions (e.g., pre-market and after-hours sessions for US stocks), ensuring correct positioning of historical lines.
User-Configurable Inputs Explained in Detail:
Market Type:
Allows you to specify your trading instrument type, automatically adjusting calculations for:
- Stocks US (default): 390 minutes per regular session (780 minutes if extended hours enabled), 5 trading days/week.
- Crypto: 1440 minutes/day, 7 trading days/week.
- Forex: 1440 minutes/day, 5 trading days/week.
- Futures: 1320 minutes/day, 5 trading days/week.
Show Weekly Close:
When enabled, plots a line at the exact closing price from one week ago. Provides short-term context and helps identify recent price momentum.
Show Monthly Close:
When enabled, plots a line at the exact closing price from one month ago. Helpful for evaluating medium-term price positioning and monthly trend strength.
Show 3-Month Close:
When enabled, plots a line at the exact closing price from three months ago. Useful for assessing quarterly market shifts, intermediate trend changes, and broader market sentiment.
Show 6-Month Close:
When enabled, plots a line at the exact closing price from six months ago. Useful for identifying semi-annual trends, significant price pivots, and longer-term support/resistance levels.
Show 1-Year Close:
When enabled, plots a line at the exact closing price from one year ago. Excellent for assessing long-term market direction and key annual price levels.
Enable Smoothing:
Activates a Simple Moving Average (SMA) smoothing of historical reference lines, reducing volatility and providing clearer visual references. Recommended for traders preferring less volatile reference levels.
Smoothing Length:
Determines the number of bars used in calculating the SMA smoothing of historical lines. Higher values result in smoother but slightly delayed reference lines; lower values offer more immediate yet more volatile levels.
Use Extended Hours (Intraday Only):
When enabled (only applicable for Stocks US), it accounts for pre-market and after-hours trading sessions, providing accurate intraday historical line calculations based on extended sessions (typically 780 minutes/day total).
Important Notes and Compliance:
- This indicator does not provide trading signals, recommendations, or predictions. It serves purely as a visual analytical tool to supplement traders’ existing methods.
- Historical lines plotted are strictly based on past available price data; the indicator never accesses future data or data outside the scope of Pine Script’s standard capabilities.
- The script incorporates built-in logic to avoid runtime errors if insufficient historical data exists for a selected timeframe, ensuring robustness even with limited historical bars.
- TimeMap is original work developed exclusively by Julien Eche (@Julien_Eche). It does not reuse or replicate third-party or existing open-source scripts.
Recommended Best Practices:
- Use TimeMap as a complementary analytical reference, not as a standalone strategy or trade decision-making tool.
- Adapt displayed historical periods and smoothing settings based on your trading style and market approach.
- Default plot colors are optimized for readability on dark-background charts; adjust as necessary according to your preference and chart color scheme.
This script is published open-source to benefit the entire TradingView community and fully complies with all TradingView script publishing rules and guidelines.
Low Liquidity Zones [PhenLabs]📊 Low Liquidity Zones
Version: PineScript™ v6
📌 Description
Low Liquidity Zones identifies and highlights periods of unusually low trading volume on your chart, marking areas where price movement occurred with minimal participation. These zones often represent potential support and resistance levels that may be more susceptible to price breakouts or reversals when revisited with higher volume.
Unlike traditional volume analysis tools that focus on high volume spikes, this indicator specializes in detecting low liquidity areas where price moved with minimal resistance. Each zone displays its volume delta, providing insight into buying vs. selling pressure during these thin liquidity periods. This combination of low volume detection and delta analysis helps traders identify potential price inefficiencies and weak structures in the market.
🚀 Points of Innovation
• Identifies low liquidity zones that most volume indicators overlook but which often become significant technical levels
• Displays volume delta within each zone, showing net buying/selling pressure during low liquidity periods
• Dynamically adjusts to different timeframes, allowing analysis across multiple time horizons
• Filters zones by maximum size percentage to focus only on precise price levels
• Maintains historical zones until they expire based on your lookback settings, creating a cumulative map of potential support/resistance areas
🔧 Core Components
• Low Volume Detection: Identifies candles where volume falls below a specified threshold relative to recent average volume, highlighting potential liquidity gaps.
• Volume Delta Analysis: Calculates and displays the net buying/selling pressure within each low liquidity zone, providing insight into the directional bias during low participation periods.
• Dynamic Timeframe Adjustment: Automatically scales analysis periods to match your selected timeframe preference, ensuring consistent identification of low liquidity zones regardless of chart settings.
• Zone Management System: Creates, tracks, and expires low liquidity zones based on your configured settings, maintaining visual clarity on the chart.
🔥 Key Features
• Low Volume Identification: Automatically detects and highlights candles where volume falls below your specified threshold compared to the moving average.
• Volume Delta Visualization: Shows the net volume delta within each zone, providing insight into whether buyers or sellers were dominant despite the low overall volume.
• Flexible Timeframe Analysis: Analyze low liquidity zones across multiple predefined timeframes or use a custom lookback period specific to your trading style.
• Zone Size Filtering: Filters out excessively large zones to focus only on precise price levels, improving signal quality.
• Automatic Zone Expiration: Older zones are automatically removed after your specified lookback period to maintain a clean, relevant chart display.
🎨 Visualization
• Volume Delta Labels: Each zone displays its volume delta with “+” or “-” prefix and K/M suffix for easy interpretation, showing the strength and direction of pressure during the low volume period.
• Persistent Historical Mapping: Zones remain visible for your specified lookback period, creating a cumulative map of potential support and resistance levels forming under low liquidity conditions.
📖 Usage Guidelines
Analysis Timeframe
Default: 1D
Range/Options: 15M, 1HR, 3HR, 4HR, 8HR, 16HR, 1D, 3D, 5D, 1W, Custom
Description: Determines the historical period to analyze for low liquidity zones. Shorter timeframes provide more recent data while longer timeframes offer a more comprehensive view of significant zones. Use Custom option with the setting below for precise control.
Custom Period (Bars)
Default: 1000
Range: 1+
Description: Number of bars to analyze when using Custom timeframe option. Higher values show more historical zones but may impact performance.
Volume Analysis
Volume Threshold Divisor
Default: 0.5
Range: 0.1-1.0
Description: Maximum volume relative to average to identify low volume zones. Example: 0.5 means volume must be below 50% of the average to qualify as low volume. Lower values create more selective zones while higher values identify more zones.
Volume MA Length
Default: 15
Range: 1+
Description: Period length for volume moving average calculation. Shorter periods make the indicator more responsive to recent volume changes, while longer periods provide a more stable baseline.
Zone Settings
Zone Fill Color
Default: #2196F3 (80% transparency)
Description: Color and transparency of the low liquidity zones. Choose colors that stand out against your chart background without obscuring price action.
Maximum Zone Size %
Default: 0.5
Range: 0.1+
Description: Maximum allowed height of a zone as percentage of price. Larger zones are filtered out. Lower values create more precise zones focusing on tight price ranges.
Display Options
Show Volume Delta
Default: true
Description: Toggles the display of volume delta within each zone. Enabling this provides additional insight into buying vs. selling pressure during low volume periods.
Delta Text Position
Default: Right
Options: Left, Center, Right
Description: Controls the horizontal alignment of the delta text within zones. Adjust based on your chart layout for optimal readability.
✅ Best Use Cases
• Identifying potential support and resistance levels that formed during periods of thin liquidity
• Spotting price inefficiencies where larger players may have moved price with minimal volume
• Finding low-volume consolidation areas that may serve as breakout or reversal zones when revisited
• Locating potential stop-hunting zones where price moved on minimal participation
• Complementing traditional support/resistance analysis with volume context
⚠️ Limitations
• Requires volume data to function; will not work on symbols where the data provider doesn’t supply volume information
• Low volume zones don’t guarantee future support/resistance - they simply highlight potential areas of interest
• Works best on liquid instruments where volume data has meaningful fluctuations
• Historical analysis is limited by the maximum allowed box count (500) in TradingView
• Volume delta in some markets may not perfectly reflect buying vs. selling pressure due to data limitations
💡 What Makes This Unique
• Focus on Low Volume: Unlike some indicators that highlight high volume events particularly like our very own TLZ indicator, this tool specifically identifies potentially significant price zones that formed with minimal participation.
• Delta + Low Volume Integration: Combines volume delta analysis with low volume detection to reveal directional bias during thin liquidity periods.
• Flexible Lookback System: The dynamic timeframe system allows analysis across any timeframe while maintaining consistent zone identification criteria.
• Support/Resistance Zone Generation: Automatically builds a visual map of potential technical levels based on volume behavior rather than just price patterns.
🔬 How It Works
1. Volume Baseline Calculation:
The indicator calculates a moving average of volume over your specified period to establish a baseline for normal market participation. This adaptive baseline accounts for natural volume fluctuations across different market conditions.
2. Low Volume Detection:
Each candle’s volume is compared to the moving average and flagged when it falls below your threshold divisor. The indicator also filters zones by maximum size to ensure only precise price levels are highlighted.
3. Volume Delta Integration:
For each identified low volume candle, the indicator retrieves the volume delta from a lower timeframe. This delta value is formatted with appropriate scaling (K/M) and displayed within the zone.
4. Zone Management:
New zones are created and tracked in a dynamic array, with each zone extending rightward until it expires. The system automatically removes expired zones based on your lookback period to maintain a clean chart.
💡 Note:
Low liquidity zones often represent areas where price moved with minimal participation, which can indicate potential market inefficiencies. These zones frequently become important support/resistance levels when revisited, especially if approached with higher volume. Consider using this indicator alongside traditional technical analysis tools for comprehensive market context. For best results, experiment with different volume threshold settings based on the specific instrument’s typical volume patterns.
Majors Sync | QuantEdgeBIntroducing MajorsSyn c by QuantEdgeB
🔹 Overview
🚀 Dynamic Rotation System for BTC, ETH & SOL
MajorsSync is a powerful, rotation-based strategy designed to systematically identify the leading cryptocurrency among the top three majors: Bitcoin (BTC), Ethereum (ETH), and Solana (SOL).
By analyzing inter-market strength, pairwise trend dominance, and individual trend quality, MajorsSync dynamically shifts exposure toward the asset with the highest potential for outperformance, while de-risking during unfavorable conditions.
✨ Core Objective
📌 To allocate capital to the strongest-performing major—BTC, ETH, or SOL—while avoiding underperformers and unnecessary exposure during uncertain market phases.
🧠 How It Works
Majors Sync uses a multi-tiered decision structure:
🔹 1. Individual Asset Trend Evaluation
Each asset is scored using a Trend Performance Index (TPI). These are proprietary models capturing medium-term momentum and structure for:
• BTC
• ETH
• SOL
🔹 2. Pairwise Relative Strength Matrix
Compute TPI values between the asset pairs:
• ETHBTC → Is ETH stronger than BTC?
• SOLETH → Is SOL stronger than ETH?
• SOLBTC → Is SOL stronger than BTC?
These relative TPI readings help construct a score matrix to rank assets 0–2.
🔹 3. Signal Confirmation
Only when the top-ranked asset has a positive TPI, a Long signal is triggered on that asset.
Otherwise, if no asset meets the threshold, the system remains in Cash/Neutral mode to protect capital.
🧮 Capital Allocation Logic
📊 Allocation always rotates to:
• ✅ The strongest asset with a positive trend
• 🛑 Otherwise, goes neutral/cash (no trade)
This ensures capital is placed in high-probability zones only.
💼 Equity System
🧮 An internal equity engine simulates dynamic capital rotation by reallocating to the top-performing major (BTC, ETH, or SOL) at each bar. This allows for transparent tracking of historical strategy performance.
• 💡 If BTC is the top asset → System follows BTC's price change
• 💡 If ETH becomes dominant → It reallocates to ETH
• 💡 If SOL takes over → Position shifts to SOL
• 📉 No asset qualified? → Strategy holds cash
You also get a Buy & Hold BTC benchmark for direct comparison.
⚠️ This simulation reflects past behavior and is not indicative of future results.
📊 Dashboard & Visuals
The built-in dashboard table displays:
• 🧠 Asset Trends (BTC, ETH, SOL)
• 🧩 Matrix values (e.g., ETH vs BTC, SOL vs ETH)
• 🏁 Final Signal Output (which asset is selected)
• 🔁 Real-time Strategy Equity vs Buy & Hold
💪 Why It Works
Majors Sync blends:
• ✅ Inter-market structure (pairwise dominance)
• ✅ Intra-asset momentum (standalone TPI)
• ✅ Position filtering (only acts on positive signals)
• ✅ Capital efficiency (rotates rather than overtrades)
This design reduces drawdowns, avoids stagnation, and seeks to capture medium-term leadership shifts among the top crypto majors.
📊 MajorSync Backtest Metrics
🔹 Sharpe Ratio
Shows the risk-adjusted return by comparing the strategy's return to its overall volatility. Higher is better — it means you're getting more reward per unit of risk.
🔹 Sortino Ratio
Similar to Sharpe, but focuses only on downside volatility (the bad kind). This makes it a better reflection of how the system handles losses specifically.
🔹 Omega Ratio (Ω)
Measures how often the system generates profitable returns versus unprofitable ones. A value above 1 means it wins more than it loses — and the higher it goes, the better.
🔹 Equity Max Drawdown (Eq.Max DD)
This is the deepest decline from peak equity during the test. Lower drawdown means less risk of big losses.
📌 Disclaimer: Backtest results are based on historical data and past market behavior. Performance is not indicative of future results and should not be considered financial advice. Always conduct your own backtests and research before making any investment decisions. 🚀
🚀 Key Benefits
✔️ Trend-Following + Relative Strength Hybrid
✔️ Rotational Capital Efficiency
✔️ De-risking in Weak Conditions
✔️ Optimized for Swing and Medium-Term Positioning
✔️ Visual Clarity + Smart Allocation
🔧 Settings Overview
• Color Mode – Switch visual palette for the base Trend
• Trend Color – Toggle trend-based bar coloring
• Enable Backtest Table – Show historical performance metrics
• Start Date – Control backtest window
🏁 Conclusion
Majors Sync is your intelligent rotation engine for crypto majors.
Instead of guessing which coin to hold, let the system rotate for you—objectively, consistently, and visually.
📈 Be in BTC when it leads. Switch to ETH or SOL when strength shifts. Sit in cash when needed.
📌 Master the market with precision and confidence | QuantEdgeB
🔹 Disclaimer: Past performance is not indicative of future results. No trading strategy can guarantee success in financial markets.
🔹 Strategic Advice: Always backtest, optimize, and align parameters with your trading objectives and risk tolerance before live trading.
HEMA Trend Levels [AlgoAlpha]OVERVIEW
This script plots two Hull-EMA (HEMA) curves to define a color-coded dynamic trend zone and generate context-aware breakout levels, allowing traders to easily visualize prevailing momentum and identify high-probability breakout retests. The script blends smoothed price tracking with conditional box plotting, delivering both trend-following and mean-reversion signals within one system. It is designed to be simple to read visually while offering nuanced trend shifts and test confirmations.
█ CONCEPTS
The Hull-EMA (HEMA) is a hybrid moving average combining the responsiveness of short EMAs with the smoothness of longer ones. It applies layered smoothing: first by subtracting a full EMA from a half-length EMA (doubling the short EMA's weight), and then by smoothing the result again with the square root of the original length. This process reduces lag while maintaining clarity in direction changes. In this script, two HEMAs—fast and slow—are used to define the trend structure and trigger events when they cross. These crossovers generate "trend shift boxes"—temporary support or resistance zones drawn immediately after trend transitions—to detect price retests in the new direction. When price cleanly retests these levels, the script marks them as confirmations with triangle symbols, helping traders isolate better continuation setups. Color-coded bars further enhance visual interpretation: bullish bars when price is above both HEMAs, bearish when below, and neutral (gray) when indecisive.
█ FEATURES
Bullish and bearish bar coloring based on price and HEMA alignment.
Box plotting at each crossover (bullish or bearish) to create short-term decision zones.
Real-time test detection: price must cleanly test and bounce from box levels to be considered valid.
Multiple alert conditions: crossover alerts, test alerts, and trend continuation alerts.
█ USAGE
Use this indicator on any time frame and asset. Adjust HEMA lengths to match your trading style—shorter lengths for scalping or intraday, longer for swing trading. The shaded area between HEMAs helps visually define the current trend. Watch for crossovers: a bullish crossover plots a green support box just below price, and a bearish one plots a red resistance box just above. These zones act as short-term decision points. When price returns to test a box and confirms with strong rejection (e.g., closes above for bullish or below for bearish), a triangle symbol is plotted. These tests can signal strong trend continuation. For traders looking for clean entries, combining the crossover with a successful retest improves reliability. Alerts can be enabled for all key signals: trend shift, test confirmations, and continuation conditions, making it suitable for automated setups or discretionary traders tracking multiple charts.
Dynamic Momentum Bands | AlphaAlgosDynamic Momentum Bands | AlphaAlgos
Overview
The Dynamic Momentum Bands indicator is an advanced technical analysis tool that combines multiple analytical techniques to provide a comprehensive view of market momentum and trend dynamics. By integrating RSI (Relative Strength Index), volatility analysis, and adaptive moving averages, this indicator offers traders a nuanced perspective on market conditions.
Key Features
Adaptive band calculation based on price momentum
Integrated RSI-driven volatility scaling
Multiple moving average type options (EMA, SMA, VWMA)
Smooth, gradient-based band visualization
Optional price bar coloring for trend identification
Technical Methodology
The indicator employs a sophisticated approach to market analysis:
1. Momentum Calculation
Calculates RSI using a customizable length
Uses RSI to dynamically adjust band volatility
Scales band width based on distance from the 50 RSI level
2. Band Construction
Applies a selected moving average type to the price source
Calculates deviation using ATR (Average True Range)
Smooths band edges for improved visual clarity
Configuration Options
Core Settings:
Price Source: Choose the price data used for calculations
RSI Length: Customize the RSI calculation period (1-50)
Band Length: Adjust the moving average period (5-100)
Volatility Multiplier: Fine-tune band width
Band Type: Select between EMA, SMA, and VWMA
Visual Settings:
Bar Coloring: Toggle color-coded price bars
Gradient-based band visualization
Smooth color transitions for trend representation
Trend Identification
The indicator provides trend insights through:
Color-coded bands (blue for bullish, pink for bearish)
Smooth gradient visualization
Optional price bar coloring
Trading Applications
Trend Following:
- Use band position relative to price as trend indicator
- Identify momentum shifts through color changes
- Utilize gradient zones for trend strength assessment
Volatility Analysis:
Observe band width changes
Detect potential breakout or consolidation periods
Use RSI-driven volatility scaling for market context
Best Practices
Adjust RSI length to match trading timeframe
Experiment with different moving average types
Use in conjunction with other technical indicators
Consider volatility multiplier for different market conditions
This indicator is provided for informational purposes only. Always use proper risk management when trading. Past performance is not indicative of future results. Not financial Advise
Advanced ORB IndicatorAdvanced ORB (Opening Range Breakout) Indicator
Overview
The Advanced ORB Indicator is a sophisticated trading tool designed to capture high-probability breakout opportunities across multiple markets. By identifying the opening range of a trading session and detecting meaningful breakouts, this indicator helps traders enter trending moves with strong momentum while filtering out false signals.
Core Concept
The Opening Range Breakout strategy is based on the principle that the initial trading range of a session often defines key support and resistance levels. When price breaks convincingly beyond this range with proper confirmation, it frequently indicates the beginning of a directional move that can persist throughout the session.
Key Features
### Intelligent Market Detection
- Automatically identifies market type (US Stocks, Forex, Crypto, EU/Asia Stocks)
- Applies optimal default timings based on market characteristics
- Configurable time zones (Exchange, UTC, Local) for precise session timing
Customizable Session Settings
- Adjustable opening range duration (15-240 minutes)
- Flexible reset periods (Daily, Weekly, Monthly, or Never)
- Custom session start times to match specific market opens or pre-market periods
Advanced Signal Filtering
- Multi-factor confirmation system requiring strong candle bodies, proper wick ratios, and minimum breakout percentages
- Smart cooldown periods preventing clustered signals
- Retracement detection that resets signals after meaningful pullbacks
Quality Control Mechanisms
- Volume threshold filter for stronger conviction entries
- RSI-based filters to avoid overbought/oversold conditions
- Trend alignment validation using EMA and directional analysis
- Consecutive candle confirmation for higher reliability
Visual Clarity
- Clear high/low boundary visualization
- Comprehensive status panel showing current levels, trend status, and filter conditions
- Clean, non-repainting signal triangles at breakout points
Trading Applications
Stocks & ETFs
Perfect for capturing morning momentum after market open, especially effective on US equities where the first 30-60 minutes often set the tone for the day. Excellent for gap fills, trend continuations, and reversal confirmations.
Forex & Futures
Ideal for session-based strategies around London/New York opens, capturing institutional order flow as major players enter the market. Can be configured for H4/H1 longer-term breakouts in 24-hour markets.
Cryptocurrency
Powerful for identifying key breakout levels in volatile crypto markets, with adjustable parameters to filter out noise while catching significant moves. Especially effective during high-volume periods following consolidation.
Strategic Implementation
The indicator excels when used as part of a complete trading system. Consider these approaches:
1. Pure Momentum Strategy: Enter on signal, exit at fixed R:R or end of session
2. Trend Continuation: Only take signals in the direction of the higher timeframe trend
3. Support/Resistance Validation: Combine with key S/R levels for higher probability entries
4. Volume Profile Confirmation: Use in conjunction with volume profile to verify breakout significance
Optimization Tips
- Adjust Opening Range Duration based on market volatility (shorter for choppy markets, longer for trending)
- Increase filter requirements during uncertain market conditions
- Loosen filters during strong trending environments
- Use longer durations (120+ minutes) for swing trading setups
- Consider Weekly/Monthly reset periods for positional trading approaches
Performance Notes
The Advanced ORB Indicator is designed to produce fewer, higher-quality signals rather than frequent low-conviction entries. The multiple confirmation requirements mean you'll catch fewer false breakouts at the expense of occasionally later entries.
For best results, combine with proper risk management, position sizing, and an understanding of the broader market context.
*This indicator works on all timeframes but performs optimally on 1-minute to 15-minute charts for intraday trading and 1-hour to 4-hour charts for swing trading opportunities.*
// @version=5
indicator("Advanced ORB Indicator", overlay=true)
// ===================================================================
// SIGNAL REQUIREMENTS DOCUMENTATION
// ===================================================================
//
// BULL SIGNAL REQUIREMENTS:
// - ORB period must be completed (not in the opening range duration anymore)
// - Price must close above the ORB high (if waitForClose is enabled)
// - Candle must have a strong body (body to range ratio >= minBodyToRangeRatio)
// - Valid upper wick (upper wick to body ratio <= wickThreshold)
// - Bullish candle (close > open)
// - Consecutive candle confirmation (if enabled, requires multiple candles meeting criteria)
// - Volume filter (if enabled, volume > average volume * threshold)
// - RSI filter (if enabled, RSI must not be overbought)
// - EMA filter (if enabled, price must be above short EMA)
// - Trend filter (if enabled, must be in an uptrend)
// - Cooldown period satisfied (minimum bars between signals)
// - Not already signaled a bull breakout for this ORB (unless reset by retracement)
//
// BEAR SIGNAL REQUIREMENTS:
// - ORB period must be completed (not in the opening range duration anymore)
// - Price must close below the ORB low (if waitForClose is enabled)
// - Candle must have a strong body (body to range ratio >= minBodyToRangeRatio)
// - Valid lower wick (lower wick to body ratio <= wickThreshold)
// - Bearish candle (close < open)
// - Consecutive candle confirmation (if enabled, requires multiple candles meeting criteria)
// - Volume filter (if enabled, volume > average volume * threshold)
// - RSI filter (if enabled, RSI must not be oversold)
// - EMA filter (if enabled, price must be below short EMA)
// - Trend filter (if enabled, must be in a downtrend)
// - Cooldown period satisfied (minimum bars between signals)
// - Not already signaled a bear breakout for this ORB (unless reset by retracement)
//
// SIGNAL RESET CONDITIONS (for both bull and bear):
// - A significant price retracement happens (determined by retracePercent)
// - Cooldown period expires (minimum bars between signals)
// ===================================================================
// ===================================================================
// SETTINGS GUIDE - DETAILED EXPLANATION
// ===================================================================
//
// MARKET SETTINGS
// ---------------------------------------------------------------------
// Market Type: Select your market or use auto-detection
// - US Stocks: NYSE, NASDAQ, etc. (9:30 AM default open)
// - Forex: Currency pairs (uses midnight or London open)
// - Crypto: Digital currencies (uses midnight UTC)
// - EU Stocks: European exchanges (9:00 AM default)
// - Asia Stocks: Asian exchanges (9:00 AM default)
// - Custom: Manually set your preferred session time
//
// Auto-Detect Market Type: Automatically identifies the market from symbol
// - Enable for convenience when switching between different markets
// - Disable to manually set your preferred market type
//
// Use Market Default Timing: Applies optimal session start times for selected market
// - Enable to use proven default timings for the market
// - Disable to set custom session start times
//
// Time Zone: Sets the reference time zone for session calculations
// - Exchange: Uses the exchange's native time zone (recommended)
// - UTC: Uses Coordinated Universal Time
// - Local: Uses your local computer's time zone
//
// TIME SETTINGS
// ---------------------------------------------------------------------
// Session Start Hour/Minute: Sets when the opening range begins
// - Only active when "Use Market Default Timing" is disabled
// - US Stocks typically use 9:30 AM
// - For pre-market analysis, try 4:00 AM (US) or 8:00 AM (EU)
//
// Opening Range Duration: How long to measure the initial range (minutes)
// - 30-60 mins: Standard for daily ORB strategies
// - 15 mins: More responsive, good for volatile markets
// - 120 mins: More stable, fewer false signals
//
// Reset Period: When to calculate a new opening range
// - Daily: Most common, resets each trading day
// - Weekly: Weekly opening range breakout strategy
// - Monthly: Long-term support/resistance levels
// - Never: Continuous tracking without resetting
//
// SIGNAL QUALITY SETTINGS
// ---------------------------------------------------------------------
// Minimum Bars Between Signals: Prevents clustering of multiple signals
// - Higher values (8-10): Fewer signals, better quality
// - Lower values (3-5): More signals, requires more filtering
//
// Required Retracement % Before New Signal: How far price must pull back
// - Higher values (50-60%): Only signals after significant pullbacks
// - Lower values (20-30%): More signals, may include false breakouts
//
// Minimum Breakout % Required: Strength needed for valid breakout
// - Higher values (0.5-1.0%): Stronger confirmation, fewer false breakouts
// - Lower values (0.1-0.3%): More sensitive, good for low-volatility
//
// Minimum Body to Range Ratio %: Requires strong candles for signals
// - Higher values (70-80%): Only strong momentum candles trigger signals
// - Lower values (40-50%): More signals, includes weaker breakouts
//
// BREAKOUT SETTINGS
// ---------------------------------------------------------------------
// Max Wick to Body Ratio: Controls acceptable candle shape
// - Lower values (0.2-0.3): Only clean breakout candles
// - Higher values (0.5-0.6): More signals, includes wicks
//
// Use Close Price: Uses close instead of High/Low for breakouts
// - Enable for more reliable but delayed confirmation
// - Disable for earlier signals using High/Low prices
//
// Wait for Candle Close: Only signals after candle completes
// - Enable to avoid false breakouts (recommended)
// - Disable for earlier entry but higher risk
//
// FILTER SETTINGS
// ---------------------------------------------------------------------
// Filter Signals Based on Trend: Aligns signals with the overall trend
// - Enable to filter out counter-trend signals (recommended)
// - Disable for range-bound markets or counter-trend strategies
//
// Trend Detection Period: Lookback period for trend calculation
// - Longer periods (50-100): Identifies major trends
// - Shorter periods (20-30): More responsive to recent price action
//
// Trend Strength Threshold: How strong trend must be
// - Higher values (0.7-0.8): Only strong trends generate signals
// - Lower values (0.5-0.6): More signals in choppy markets
//
// Use Volume Filter: Requires above-average volume for signals
// - Enable for stocks and futures (recommended)
// - May disable for some forex pairs with unreliable volume data
//
// Volume Threshold: How much above average volume is required
// - Higher values (2.0-3.0x): Only significant volume spikes
// - Lower values (1.2-1.5x): More signals, less volume confirmation
//
// Use RSI Filter: Prevents signals in overbought/oversold conditions
// - Enable to avoid exhausted moves
// - Disable for strong trend following
//
// Use EMA Alignment Filter: Ensures price is in the right direction
// - Enable for trend confirmation (recommended)
// - Disable for early reversal signals
//
// Require Consecutive Candle Confirmation: Needs multiple confirming candles
// - Enable for higher quality signals
// - Disable for faster but riskier entries
//
// DISPLAY SETTINGS
// ---------------------------------------------------------------------
// Show Label with Values: Displays current ORB levels and status
// Show Range Boundaries: Displays high/low lines on chart
// High/Low Boundary Color: Customize appearance
//
// ===================================================================
// RECOMMENDED SETTINGS BY MARKET TYPE
// ===================================================================
//
// US STOCKS - STANDARD
// ---------------------------------------------------------------------
// - Market Type: US Stocks
// - Opening Range Duration: 30 minutes
// - Reset Period: Daily
// - Wait for Candle Close: Enabled
// - Use Volume Filter: Enabled (Volume Threshold: 1.5-2.0x)
// - Use Trend Filter: Enabled
// - Minimum Breakout %: 0.3-0.5%
//
// US STOCKS - EARNINGS/HIGH VOLATILITY
// ---------------------------------------------------------------------
// - Opening Range Duration: 60 minutes (more stable)
// - Minimum Breakout %: 0.7-1.0% (stronger moves required)
// - Minimum Bars Between Signals: 8-10 (avoid whipsaws)
// - Required Retracement %: 40-50% (deeper pullbacks)
// - Volume Threshold: 2.5-3.0x (higher volume confirmation)
//
// CRYPTO
// ---------------------------------------------------------------------
// - Market Type: Crypto
// - Opening Range Duration: 120 minutes (crypto needs longer)
// - Reset Period: Daily
// - Minimum Breakout %: 1.0-1.5% (higher volatility needs stronger breakouts)
// - Volume Threshold: 2.0-2.5x
// - Consider disabling RSI Filter (trending crypto often stays overbought/oversold)
//
// FOREX - MAJOR PAIRS
// ---------------------------------------------------------------------
// - Market Type: Forex
// - Session Start: Consider 8:00 AM (London open) or 5:00 PM (Asian open)
// - Opening Range Duration: 60-120 minutes
// - Min Body to Range Ratio: 50-60% (forex can have smaller bodies)
// - Consider disabling Volume Filter (unreliable on some platforms)
// - Trend Strength Threshold: 0.6-0.7 (forex tends to trend well)
//
// EU STOCKS
// ---------------------------------------------------------------------
// - Market Type: EU Stocks
// - Opening Range Duration: 60 minutes
// - Reset Period: Daily
// - Use EMA Alignment: Enabled
// - Use Volume Filter: Enabled
//
// SMALL CAP/VOLATILE STOCKS
// ---------------------------------------------------------------------
// - Opening Range Duration: 15-30 minutes (captures early moves)
// - Minimum Breakout %: 1.0-2.0% (needs stronger breakouts)
// - Volume Threshold: 3.0x (needs significant volume)
// - Max Wick to Body Ratio: 0.3 (cleaner breakouts)
// - Use Consecutive Candle Confirmation: Enabled (2-3 candles)
//
// LOW VOLATILITY ENVIRONMENT
// ---------------------------------------------------------------------
// - Opening Range Duration: 30-60 minutes
// - Minimum Breakout %: 0.2-0.3% (lower threshold for tight ranges)
// - Required Retracement %: 20-30% (smaller pullbacks)
// - Consider disabling Consecutive Candle Confirmation
//
// HIGH VOLATILITY ENVIRONMENT
// ---------------------------------------------------------------------
// - Opening Range Duration: 60-120 minutes (more stable)
// - Minimum Breakout %: 0.8-1.5% (stronger confirmation)
// - Required Retracement %: 50-60% (deeper pullbacks)
// - Minimum Bars Between Signals: 8-10 (avoid choppy signals)
// - Use Consecutive Candle Confirmation: Enabled (2-3 candles)
// ===================================================================
Trend Magnet ProTrend Magnet Pro – Advanced Adaptive Trend & Oscillator Indicator
Overview:
Trend Magnet Pro is a powerful, fully customizable indicator that combines adaptive moving averages with a dynamic oscillator to provide a comprehensive view of market trends and potential reversal points. It integrates multiple analytical layers—volatility, volume, multi-timeframe analysis, and divergence detection—to help traders make informed decisions.
Key Features & Competitive Advantages:
Adaptive Moving Average (MA):
The indicator calculates an adaptive MA by blending your chosen MA type (SMA, EMA, WMA, VWMA, KAMA, or LSMA) with Kaufman’s Adaptive Moving Average (KAMA). This hybrid approach adjusts dynamically to market volatility, ensuring smoother trend detection and reducing noise during erratic periods.
Custom Oscillator Calculation:
A separate oscillator is computed based on the difference between the closing price and a dedicated oscillator MA. This difference is normalized using an ATR-based volatility measure and then smoothed with the Hull MA. This process enhances signal precision by filtering out minor fluctuations.
ATR & Volume Integration:
Using the Average True Range (ATR) for volatility and a volume spike detection mechanism, the indicator filters out weak signals. These features ensure that only significant market moves trigger trading signals.
Multi-Timeframe Analysis:
By incorporating an oscillator analysis on a higher timeframe, Trend Magnet Pro provides an extra layer of confirmation. This multi-timeframe approach improves the reliability of signals, making it easier to identify sustained trends.
Divergence Detection:
The indicator automatically detects bullish and bearish divergences between price movements and the oscillator. These divergences can serve as early warnings for potential trend reversals, adding further depth to your market analysis.
Visual Clarity & Customization:
Trend Magnet Pro offers:
A separate oscillator panel with color-coded histograms.
Overlay plots of the adaptive MA on the price chart.
Clear visual markers for buy and sell signals.
Adjustable parameters for pivot detection and oscillator pressure thresholds.
How to Use Trend Magnet Pro:
Main MA Settings:
Choose your preferred MA type and set the MA length for the main trend analysis.
The adaptive algorithm will blend this with KAMA based on current volatility.
Oscillator Settings:
Set the oscillator’s MA type and its smoothing length.
Fine-tune the oscillator parameters to match your trading style and market conditions.
Common Settings:
Define the ATR length for volatility measurement.
Adjust the volume multiplier and volume SMA period to enable volume spike detection.
Set the low and high pressure thresholds to determine oscillator color changes, reflecting different market pressures.
Multi-Timeframe & Divergence:
Optionally, select a higher timeframe for the oscillator to provide additional confirmation.
Enable divergence detection to highlight potential trend reversals based on price and oscillator pivots.
Signal Interpretation:
Buy Signal: Triggered when the oscillator crosses above zero, accompanied by volume spikes and confirmed by both multi-timeframe analysis and price being above the adaptive MA.
Sell Signal: Triggered under opposite conditions, where the oscillator crosses below zero and the price is below the adaptive MA.
By adjusting these settings, you can tailor Trend Magnet Pro to your specific market and trading strategy, making it an invaluable tool for both trend-following and reversal trading.
Русское Описание
Trend Magnet Pro – Индикатор Адаптивного Тренда и Осциллятора
Обзор:
Trend Magnet Pro – это мощный и полностью настраиваемый индикатор, который объединяет адаптивные скользящие средние с динамическим осциллятором для комплексного анализа рыночных трендов и потенциальных точек разворота. Он интегрирует несколько аналитических слоёв — волатильность, объём, мультитаймфреймовый анализ и детекцию дивергенций — что позволяет принимать обоснованные торговые решения.
Основные преимущества и функциональные возможности:
Адаптивная Скользящая Средняя (MA):
Индикатор рассчитывает адаптивную MA, комбинируя выбранный тип (SMA, EMA, WMA, VWMA, KAMA или LSMA) с Kaufman’s Adaptive Moving Average (KAMA). Такой гибридный подход динамически подстраивается под рыночную волатильность, обеспечивая более плавное определение трендов и снижая уровень шума в нестабильные периоды.
Кастомизированный Расчёт Осциллятора:
Осциллятор вычисляется отдельно на основе разницы между ценой закрытия и специально рассчитанной MA для осциллятора. Эта разница нормализуется с использованием ATR (Average True Range) для оценки волатильности и сглаживается при помощи Hull MA, что позволяет точнее фиксировать значимые сигналы и исключать мелкие колебания.
Интеграция ATR и Объёма:
Применение ATR для измерения волатильности в сочетании с механизмом обнаружения всплесков объёма позволяет отсеивать слабые сигналы. Эти функции гарантируют, что торговые сигналы возникают только при значительных движениях рынка.
Мультитаймфреймовый Анализ:
Встроенный анализ осциллятора на старшем таймфрейме даёт дополнительное подтверждение сигналов. Такой подход повышает надёжность сигналов, помогая выявлять устойчивые тренды.
Детекция Дивергенций:
Индикатор автоматически обнаруживает бычьи и медвежьи дивергенции между движением цены и осциллятором. Эти дивергенции могут служить ранним предупреждением о потенциальном развороте тренда, что добавляет глубины вашему анализу.
Удобство Визуализации и Настройки:
Trend Magnet Pro предлагает:
Отдельную панель осциллятора с цветными гистограммами.
Наложение адаптивной MA на график цены.
Чёткие визуальные сигналы для покупки и продажи.
Настраиваемые параметры для обнаружения пивотов и уровней давления осциллятора.
Как работать с Trend Magnet Pro:
Настройки Основной MA:
Выберите предпочитаемый тип MA и установите период для анализа основного тренда.
Адаптивный алгоритм объединит выбранную MA с KAMA на основе текущей волатильности.
Настройки Осциллятора:
Задайте тип MA для осциллятора и установите период сглаживания.
Подберите параметры осциллятора, чтобы он соответствовал вашему стилю торговли и рыночным условиям.
Общие Настройки:
Определите период ATR для измерения волатильности.
Настройте множитель объёма и период SMA объёма для обнаружения всплесков.
Установите пороги низкого и высокого давления, которые будут влиять на цветовую индикацию осциллятора и отражать рыночное давление.
Мультитаймфреймовый Анализ и Дивергенции:
При необходимости выберите старший таймфрейм для осциллятора, чтобы обеспечить дополнительное подтверждение сигналов.
Включите функцию детекции дивергенций для выявления потенциальных разворотов тренда на основе пивотов цены и осциллятора.
Интерпретация Сигналов:
Сигнал на покупку: Формируется, когда осциллятор пересекает ноль снизу вверх, подтверждаясь всплеском объёма, анализом на старшем таймфрейме и положением цены выше адаптивной MA.
Сигнал на продажу: Формируется при обратных условиях – когда осциллятор пересекает ноль сверху вниз, а цена находится ниже адаптивной MA.
Настройка параметров позволяет адаптировать Trend Magnet Pro под конкретный рынок и торговую стратегию, делая его незаменимым инструментом как для трендового анализа, так и для поиска разворотных сигналов.
Multi-Anchored Linear Regression Channels [TANHEF]█ Overview:
The 'Multi-Anchored Linear Regression Channels ' plots multiple dynamic regression channels (or bands) with unique selectable calculation types for both regression and deviation. It leverages a variety of techniques, customizable anchor sources to determine regression lengths, and user-defined criteria to highlight potential opportunities.
Before getting started, it's worth exploring all sections, but make sure to review the Setup & Configuration section in particular. It covers key parameters like anchor type, regression length, bias, and signal criteria—essential for aligning the tool with your trading strategy.
█ Key Features:
⯁ Multi-Regression Capability:
Plot up to three distinct regression channels and/or bands simultaneously, each with customizable anchor types to define their length.
⯁ Regression & Deviation Methods:
Regressions Types:
Standard: Uses ordinary least squares to compute a simple linear trend by averaging the data and deriving a slope and endpoints over the lookback period.
Ridge: Introduces L2 regularization to stabilize the slope by penalizing large coefficients, which helps mitigate multicollinearity in the data.
Lasso: Uses L1 regularization through soft-thresholding to shrink less important coefficients, yielding a simpler model that highlights key trends.
Elastic Net: Combines L1 and L2 penalties to balance coefficient shrinkage and selection, producing a robust weighted slope that handles redundant predictors.
Huber: Implements the Huber loss with iteratively reweighted least squares (IRLS) and EMA-style weights to reduce the impact of outliers while estimating the slope.
Least Absolute Deviations (LAD): Reduces absolute errors using iteratively reweighted least squares (IRLS), yielding a slope less sensitive to outliers than squared-error methods.
Bayesian Linear: Merges prior beliefs with weighted data through Bayesian updating, balancing the prior slope with data evidence to derive a probabilistic trend.
Deviation Types:
Regressive Linear (Reverse): In reverse order (recent to oldest), compute weighted squared differences between the data and a line defined by a starting value and slope.
Progressive Linear (Forward): In forward order (oldest to recent), compute weighted squared differences between the data and a line defined by a starting value and slope.
Balanced Linear: In forward order (oldest to newest), compute regression, then pair to source data in reverse order (newest to oldest) to compute weighted squared differences.
Mean Absolute: Compute weighted absolute differences between each data point and its regression line value, then aggregate them to yield an average deviation.
Median Absolute: Determine the weighted median of the absolute differences between each data point and its regression line value to capture the central tendency of deviations.
Percent: Compute deviation as a percentage of a base value by multiplying that base by the specified percentage, yielding symmetric positive and negative deviations.
Fitted: Compare a regression line with high and low series values by computing weighted differences to determine the maximum upward and downward deviations.
Average True Range: Iteratively compute the weighted average of absolute differences between the data and its regression line to yield an ATR-style deviation measure.
Bias:
Bias: Applies EMA or inverse-EMA style weighting to both Regression and/or Deviation, emphasizing either recent or older data.
⯁ Customizable Regression Length via Anchors:
Anchor Types:
Fixed: Length.
Bar-Based: Bar Highest/Lowest, Volume Highest/Lowest, Spread Highest/Lowest.
Correlation: R Zero, R Highest, R Lowest, R Absolute.
Slope: Slope Zero, Slope Highest, Slope Lowest, Slope Absolute.
Indicator-Based: Indicators Highest/Lowest (ADX, ATR, BBW, CCI, MACD, RSI, Stoch).
Time-Based: Time (Day, Week, Month, Quarter, Year, Decade, Custom).
Session-Based: Session (Tokyo, London, New York, Sydney, Custom).
Event-Based: Earnings, Dividends, Splits.
External: Input Source Highest/Lowest.
Length Selection:
Maximum: The highest allowed regression length (also fixed value of “Length” anchor).
Minimum: The shortest allowed length, ensuring enough bars for a valid regression.
Step: The sampling interval (e.g., 1 checks every bar, 2 checks every other bar, etc.). Increasing the step reduces the loading time, most applicable to “Slope” and “R” anchors.
Adaptive lookback:
Adaptive Lookback: Enable to display regression regardless of too few historical bars.
⯁ Selecting Bias:
Bias applies separately to regression and deviation.
Positive values emphasize recent data (EMA-style), negative invert, and near-zero maintains balance. (e.g., a length 100, bias +1 gives the newest price ~7× more weight than the oldest).
It's best to apply bias to both (regression and deviation) or just the deviation. Biasing only regression may distort deviation visually, while biasing both keeps their relationship intuitive. Using bias only for deviation scales it without altering regression, offering unique analysis.
⯁ Scale Awareness:
Supports linear and logarithmic price scaling, the regression and deviations adjust accordingly.
⯁ Signal Generation & Alerts:
Customizable entry/exit signals and alerts, detailed in the dedicated section below.
⯁ Visual Enhancements & Real-World Examples:
Optional on-chart table display summarizing regression input criteria (display type, anchor type, source, regression type, regression bias, deviation type, deviation bias, deviation multiplier) and key calculated metrics (regression length, slope, Pearson’s R, percentage position within deviations, etc.) for quick reference.
█ Understanding R (Pearson Correlation Coefficient):
Pearson’s R gauges data alignment to a straight-line trend within the regression length:
Range: R varies between –1 and +1.
R = +1 → Perfect positive correlation (strong uptrend).
R = 0 → No linear relationship detected.
R = –1 → Perfect negative correlation (strong downtrend).
This script uses Pearson’s R as an anchor, adjusting regression length to target specific R traits. Strong R (±1) follows the regression channel, while weak R (0) shows inconsistency.
█ Understanding the Slope:
The slope is the direction and rate at which the regression line rises or falls per bar:
Positive Slope (>0): Uptrend – Steeper means faster increase.
Negative Slope (<0): Downtrend – Steeper means sharper drop.
Zero or Near-Zero Slope: Sideways – Indicating range-bound conditions.
This script uses highest and lowest slope as an anchor, where extremes highlight strong moves and trend lines, while values near zero indicate sideways action and possible support/resistance.
█ Setup & Configuration:
Whether you’re new to this script or want to quickly adjust all critical parameters, the panel below shows the main settings available. You can customize everything from the anchor type and maximum length to the bias, signal conditions, and more.
Scale (select Log Scale for logarithmic, otherwise linear scale).
Display (regression channel and/or bands).
Anchor (how regression length is determined).
Length (control bars analyzed):
• Max – Upper limit.
• Min – Prevents regression from becoming too short.
• Step – Controls scanning precision; increasing Step reduces load time.
Regression:
• Type – Calculation method.
• Bias – EMA-style emphasis (>0=new bars weighted more; <0=old bars weighted more).
Deviation:
• Type – Calculation method.
• Bias – EMA-style emphasis (>0=new bars weighted more; <0=old bars weighted more).
• Multiplier - Adjusts Upper and Lower Deviation.
Signal Criteria:
• % (Price vs Deviation) – (0% = lower deviation, 50% = regression, 100% = upper deviation).
• R – (0 = no correlation, ±1 = perfect correlation; >0 = +slope, <0 = -slope).
Table (analyze table of input settings, calculated results, and signal criteria).
Adaptive Lookback (display regression while too few historical bars).
Multiple Regressions (steps 2 to 7 apply to #1, #2, and #3 regressions).
█ Signal Generation & Alerts:
The script offers customizable entry and exit signals with flexible criteria and visual cues (background color, dots, or triangles). Alerts can also be triggered for these opportunities.
Percent Direction Criteria:
(0% = lower deviation, 50% = regression line, 100% = upper deviation)
Above %: Triggers if price is above a specified percent of the deviation channel.
Below %: Triggers if price is below a specified percent of the deviation channel.
(Blank): Ignores the percent‐based condition.
Pearson's R (Correlation) Direction Criteria:
(0 = no correlation, ±1 = perfect correlation; >0 = positive slope, <0 = negative slope)
Above R / Below R: Compares the correlation to a threshold.
Above│R│ / Below│R│: Uses absolute correlation to focus on strength, ignoring direction.
Zero to R: Checks if R is in the 0-to-threshold range.
(Blank): Ignores correlation-based conditions.
█ User Tips & Best Practices:
Choose an anchor type that suits your strategy, “Bar Highest/Lowest” automatically spots commonly used regression zones, while “│R│ Highest” targets strong linear trends.
Consider enabling or disabling the Adaptive Lookback feature to ensure you always have a plotted regression if your chart doesn’t meet the maximum-length requirement.
Use a small Step size (1) unless relying on R-correlation or slope-based anchors as the are time-consuming to calculate. Larger steps speed up calculations but reduce precision.
Fine-tune settings such as lookback periods, regression bias, and deviation multipliers, or trend strength. Small adjustments can significantly affect how channels and signals behave.
To reduce loading time , show only channels (not bands) and disable signals, this limits calculations to the last bar and supports more extreme criteria.
Use the table display to monitor anchor type, calculated length, slope, R value, and percent location at a glance—especially if you have multiple regressions visible simultaneously.
█ Conclusion:
With its blend of advanced regression techniques, flexible deviation options, and a wide range of anchor types, this indicator offers a highly adaptable linear regression channeling system. Whether you're anchoring to time, price extremes, correlation, slope, or external events, the tool can be shaped to fit a variety of strategies. Combined with customizable signals and alerts, it may help highlight areas of confluence and support a more structured approach to identifying potential opportunities.
LinearRegressionLibrary "LinearRegression"
Calculates a variety of linear regression and deviation types, with optional emphasis weighting. Additionally, multiple of slope and Pearson’s R calculations.
calcSlope(_src, _len, _condition)
Calculates the slope of a linear regression over the specified length.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The length of the lookback period for the linear regression.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast for efficiency.
Returns: (float) The slope of the linear regression.
calcReg(_src, _len, _condition)
Calculates a basic linear regression, returning y1, y2, slope, and average.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) An array of 4 values: .
calcRegStandard(_src, _len, _emphasis, _condition)
Calculates an Standard linear regression with optional emphasis.
Parameters:
_src (float) : (series float) The source data series.
_len (int) : (int) The length of the lookback period.
_emphasis (float) : (float) The emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRegRidge(_src, _len, lambda, _emphasis, _condition)
Calculates a ridge regression with optional emphasis.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
lambda (float) : (float) The ridge regularization parameter.
_emphasis (float) : (float) The emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRegLasso(_src, _len, lambda, _emphasis, _condition)
Calculates a Lasso regression with optional emphasis.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
lambda (float) : (float) The Lasso regularization parameter.
_emphasis (float) : (float) The emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcElasticNetLinReg(_src, _len, lambda1, lambda2, _emphasis, _condition)
Calculates an Elastic Net regression with optional emphasis.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
lambda1 (float) : (float) L1 regularization parameter (Lasso).
lambda2 (float) : (float) L2 regularization parameter (Ridge).
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRegHuber(_src, _len, delta, iterations, _emphasis, _condition)
Calculates a Huber regression using Iteratively Reweighted Least Squares (IRLS).
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
delta (float) : (float) Huber threshold parameter.
iterations (int) : (int) Number of IRLS iterations.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRegLAD(_src, _len, iterations, _emphasis, _condition)
Calculates a Least Absolute Deviations (LAD) regression via IRLS.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
iterations (int) : (int) Number of IRLS iterations for LAD.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRegBayesian(_src, _len, priorMean, priorSpan, sigma, _emphasis, _condition)
Calculates a Bayesian linear regression with optional emphasis.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
priorMean (float) : (float) The prior mean for the slope.
priorSpan (float) : (float) The prior variance (or span) for the slope.
sigma (float) : (float) The assumed standard deviation of residuals.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRFromLinReg(_src, _len, _slope, _average, _y1, _condition)
Calculates the Pearson correlation coefficient (R) based on linear regression parameters.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_average (float) : (float) The average value of the source data series.
_y1 (float) : (float) The starting point (y-intercept of the oldest bar) for the linear regression.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast for efficiency.
Returns: (float) The Pearson correlation coefficient (R) adjusted for the direction of the slope.
calcRFromSource(_src, _len, _condition)
Calculates the correlation coefficient (R) using a specified length and source data.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The length of the lookback period.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast for efficiency.
Returns: (float) The correlation coefficient (R).
calcSlopeLengthZero(_src, _len, _minLen, _step, _condition)
Identifies the length at which the slope is flattest (closest to zero).
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length to consider (minimum of 2).
_minLen (int) : (int) The minimum length to start from (cannot exceed the max length).
_step (int) : (int) The increment step for lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length at which the slope is flattest.
calcSlopeLengthHighest(_src, _len, _minLen, _step, _condition)
Identifies the length at which the slope is highest.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length at which the slope is highest.
calcSlopeLengthLowest(_src, _len, _minLen, _step, _condition)
Identifies the length at which the slope is lowest.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length at which the slope is lowest.
calcSlopeLengthAbsolute(_src, _len, _minLen, _step, _condition)
Identifies the length at which the absolute slope value is highest.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length at which the absolute slope value is highest.
calcRLengthZero(_src, _len, _minLen, _step, _condition)
Identifies the length with the lowest absolute R value.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length with the lowest absolute R value.
calcRLengthHighest(_src, _len, _minLen, _step, _condition)
Identifies the length with the highest R value.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length with the highest R value.
calcRLengthLowest(_src, _len, _minLen, _step, _condition)
Identifies the length with the lowest R value.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length with the lowest R value.
calcRLengthAbsolute(_src, _len, _minLen, _step, _condition)
Identifies the length with the highest absolute R value.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length with the highest absolute R value.
calcDevReverse(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates the regressive linear deviation in reverse order, with optional emphasis on recent data.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The y-intercept (oldest bar) of the linear regression.
_inputDev (float) : (float) The input deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevForward(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates the progressive linear deviation in forward order (oldest to most recent bar), with optional emphasis.
Parameters:
_src (float) : (float) The source data array, where _src is oldest and _src is most recent.
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The y-intercept of the linear regression (value at the most recent bar, adjusted by slope).
_inputDev (float) : (float) The input deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevBalanced(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates the balanced linear deviation with optional emphasis on recent or older data.
Parameters:
_src (float) : (float) Source data array, where _src is the most recent and _src is the oldest.
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The y-intercept of the linear regression (value at the oldest bar).
_inputDev (float) : (float) The input deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevMean(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates the mean absolute deviation from a forward-applied linear trend (oldest to most recent), with optional emphasis.
Parameters:
_src (float) : (float) The source data array, where _src is the most recent and _src is the oldest.
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The y-intercept (oldest bar) of the linear regression.
_inputDev (float) : (float) The input deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevMedian(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates the median absolute deviation with optional emphasis on recent data.
Parameters:
_src (float) : (float) The source data array (index 0 = oldest, index _len - 1 = most recent).
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The y-intercept (oldest bar) of the linear regression.
_inputDev (float) : (float) The deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns:
calcDevPercent(_y1, _inputDev, _condition)
Calculates the percent deviation from a given value and a specified percentage.
Parameters:
_y1 (float) : (float) The base value from which to calculate deviation.
_inputDev (float) : (float) The deviation percentage.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevFitted(_len, _slope, _y1, _emphasis, _condition)
Calculates the weighted fitted deviation based on high and low series data, showing max deviation, with optional emphasis.
Parameters:
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The Y-intercept (oldest bar) of the linear regression.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevATR(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates an ATR-style deviation with optional emphasis on recent data.
Parameters:
_src (float) : (float) The source data (typically close).
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The Y-intercept (oldest bar) of the linear regression.
_inputDev (float) : (float) The input deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcPricePositionPercent(_top, _bot, _src)
Calculates the percent position of a price within a linear regression channel. Top=100%, Bottom=0%.
Parameters:
_top (float) : (float) The top (positive) deviation, corresponding to 100%.
_bot (float) : (float) The bottom (negative) deviation, corresponding to 0%.
_src (float) : (float) The source price.
Returns: (float) The percent position within the channel.
plotLinReg(_len, _y1, _y2, _slope, _devTop, _devBot, _scaleTypeLog, _lineWidth, _extendLines, _channelStyle, _colorFill, _colUpLine, _colDnLine, _colUpFill, _colDnFill)
Plots the linear regression line and its deviations, with configurable styles and fill.
Parameters:
_len (int) : (int) The lookback period for the linear regression.
_y1 (float) : (float) The starting y-value of the regression line.
_y2 (float) : (float) The ending y-value of the regression line.
_slope (float) : (float) The slope of the regression line (used to determine line color).
_devTop (float) : (float) The top deviation to add to the line.
_devBot (float) : (float) The bottom deviation to subtract from the line.
_scaleTypeLog (bool) : (bool) Use a log scale if true; otherwise, linear scale.
_lineWidth (int) : (int) The width of the plotted lines.
_extendLines (string) : (string) How lines should extend (none, left, right, both).
_channelStyle (string) : (string) The style of the channel lines (solid, dashed, dotted).
_colorFill (bool) : (bool) Whether to fill the space between the top and bottom deviation lines.
_colUpLine (color) : (color) Line color when slope is positive.
_colDnLine (color) : (color) Line color when slope is negative.
_colUpFill (color) : (color) Fill color when slope is positive.
_colDnFill (color) : (color) Fill color when slope is negative.
Nef33-Volume Footprint ApproximationDescription of the "Volume Footprint Approximation" Indicator
Purpose
The "Volume Footprint Approximation" indicator is a tool designed to assist traders in analyzing market volume dynamics and anticipating potential trend changes in price. It is inspired by the concept of a volume footprint chart, which visualizes the distribution of trading volume across different price levels. However, since TradingView does not provide detailed intrabar data for all users, this indicator approximates the behavior of a footprint chart by using available volume and price data (open, close, volume) to classify volume as buy or sell, calculate volume delta, detect imbalances, and generate trend change signals.
The indicator is particularly useful for identifying areas of high buying or selling activity, imbalances between supply and demand, delta divergences, and potential reversal points in the market. It provides specific signals for bullish and bearish trend changes, making it suitable for traders looking to trade reversals or confirm trends.
How It Works
The indicator uses volume and price data from each candlestick to perform the following calculations:
Volume Classification:
Classifies the volume of each candlestick as "buy" or "sell" based on price movement:
If the closing price is higher than the opening price (close > open), the volume is classified as "buy."
If the closing price is lower than the opening price (close < open), the volume is classified as "sell."
If the closing price equals the opening price (close == open), it compares with the previous close to determine the direction:
If the current close is higher than the previous close, it is classified as "buy."
If the current close is lower than the previous close, it is classified as "sell."
If the current close equals the previous close, the classification from the previous bar is used.
Delta Calculation:
Calculates the volume delta as the difference between buy volume and sell volume (buyVolume - sellVolume).
A positive delta indicates more buy volume; a negative delta indicates more sell volume.
Imbalance Detection:
Identifies imbalances between buy and sell volume:
A buy imbalance occurs when buy volume exceeds sell volume by a defined percentage (default is 300%).
A sell imbalance occurs when sell volume exceeds buy volume by the same percentage.
Delta Divergence Detection:
Positive Delta Divergence: Occurs when the price is falling (for at least 2 bars) but the delta is increasing or becomes positive, indicating that buyers are entering despite the price decline.
Negative Delta Divergence: Occurs when the price is rising (for at least 2 bars) but the delta is decreasing or becomes negative, indicating that sellers are entering despite the price increase.
Trend Change Signals:
Bullish Signal (trendChangeBullish): Generated when the following conditions are met:
There is a positive delta divergence.
The delta has moved from a negative value (e.g., -500) to a positive value (e.g., +200) over the last 3 bars.
There is a buy imbalance.
The price is near a historical support level (approximated as the lowest low of the last 50 bars).
Bearish Signal (trendChangeBearish): Generated when the following conditions are met:
There is a negative delta divergence.
The delta has moved from a positive value (e.g., +500) to a negative value (e.g., -200) over the last 3 bars.
There is a sell imbalance.
The price is near a historical resistance level (approximated as the highest high of the last 50 bars).
Visual Elements
The indicator is displayed in a separate panel below the price chart (overlay=false) and includes the following elements:
Volume Histograms:
Buy Volume: Represented by a green histogram. Shows the volume classified as "buy."
Sell Volume: Represented by a red histogram. Shows the volume classified as "sell."
Note: The histograms overlap, and the last plotted histogram (red) takes visual precedence, meaning the sell volume may cover the buy volume if it is larger.
Delta Line:
Delta Volume: Represented by a blue line. Shows the difference between buy and sell volume.
A line above zero indicates more buy volume; a line below zero indicates more sell volume.
A dashed gray horizontal line marks the zero level for easier interpretation.
Imbalance Backgrounds:
Buy Imbalance: Light green background when buy volume exceeds sell volume by the defined percentage.
Sell Imbalance: Light red background when sell volume exceeds buy volume by the defined percentage.
Divergence Backgrounds:
Positive Delta Divergence: Lime green background when a positive delta divergence is detected.
Negative Delta Divergence: Fuchsia background when a negative delta divergence is detected.
Trend Change Signals:
Bullish Signal: Green label with the text "Bullish Trend Change" when the conditions for a bullish trend change are met.
Bearish Signal: Red label with the text "Bearish Trend Change" when the conditions for a bearish trend change are met.
Information Labels:
Below each bar, a label displays:
Total Vol: The total volume of the bar.
Delta: The delta volume value.
Alerts
The indicator generates the following alerts:
Positive Delta Divergence: "Positive Delta Divergence Detected! Price is falling, but delta is increasing."
Negative Delta Divergence: "Negative Delta Divergence Detected! Price is rising, but delta is decreasing."
Bullish Trend Change Signal: "Bullish Trend Change Signal! Positive Delta Divergence, Delta Rise, Buy Imbalance, and Near Support."
Bearish Trend Change Signal: "Bearish Trend Change Signal! Negative Delta Divergence, Delta Drop, Sell Imbalance, and Near Resistance."
These alerts can be configured in TradingView to receive real-time notifications.
Adjustable Parameters
The indicator allows customization of the following parameters:
Imbalance Threshold (%): The percentage required to detect an imbalance between buy and sell volume (default is 300%).
Lookback Period for Divergence: Number of bars to look back for detecting price and delta trends (default is 2 bars).
Support/Resistance Lookback Period: Number of bars to look back for identifying historical support and resistance levels (default is 50 bars).
Delta High Threshold (Bearish): Minimum delta value 2 bars ago for the bearish signal (default is +500).
Delta Low Threshold (Bearish): Maximum delta value in the current bar for the bearish signal (default is -200).
Delta Low Threshold (Bullish): Maximum delta value 2 bars ago for the bullish signal (default is -500).
Delta High Threshold (Bullish): Minimum delta value in the current bar for the bullish signal (default is +200).
Practical Use
The indicator is useful for the following purposes:
Identifying Trend Changes:
The trend change signals (trendChangeBullish and trendChangeBearish) indicate potential price reversals. For example, a bullish signal near a support level may be an opportunity to enter a long position.
Detecting Divergences:
Delta divergences (positive and negative) can anticipate trend changes by showing a disagreement between price movement and underlying buying/selling pressure.
Finding Key Levels:
Imbalances (green and red backgrounds) often coincide with support and resistance levels, helping to identify areas where the market might react.
Confirming Trends:
A consistently positive delta in an uptrend or a negative delta in a downtrend can confirm the strength of the trend.
Identifying Failed Auctions:
Although not detected automatically, you can manually identify failed auctions by observing a price move to new highs/lows with decreasing volume in the direction of the move.
Limitations
Intrabar Data: It does not use detailed intrabar data, making it less precise than a native footprint chart.
Approximations: Volume classification and support/resistance detection are approximations, which may lead to false signals.
Volume Dependency: It requires reliable volume data, so it may be less effective on assets with inaccurate volume data (e.g., some forex pairs).
False Signals: Divergences and imbalances do not always indicate a trend change, especially in strongly trending markets.
Recommendations
Combine with Other Indicators: Use tools like RSI, MACD, support/resistance levels, or candlestick patterns to confirm signals.
Trade on Higher Timeframes: Signals are more reliable on higher timeframes like 1-hour or 4-hour charts.
Perform Backtesting: Evaluate the indicator's accuracy on historical data to adjust parameters and improve effectiveness.
Adjust Parameters: Modify thresholds (e.g., imbalanceThreshold or supportResistanceLookback) based on the asset and timeframe you are trading.
Conclusion
The "Volume Footprint Approximation" indicator is a powerful tool for analyzing volume dynamics and anticipating price trend changes. By classifying volume, calculating delta, detecting imbalances and divergences, and generating trend change signals, it provides traders with valuable insights into market buying and selling pressure. While it has limitations due to the lack of intrabar data, it can be highly effective when used in combination with other technical analysis tools and on assets with reliable volume data.
Momentum Trend Strength (MTS) *Julian_Acunja*Momentum Trend Strength (MTS)
The Momentum Trend Strength (MTS) indicator visually represents market momentum directly on your chart. By clearly highlighting momentum direction and intensity, traders can easily recognize shifts in market sentiment and anticipate potential turning points.
Traders can easily adjust the sensitivity and smoothing parameters, making it adaptable to diverse market conditions and trading strategies.
🔹 USAGE
The Momentum Trend Strength indicator helps traders intuitively detect market momentum, enhancing their ability to anticipate and respond dynamically to changing market conditions. Traders typically interpret three main scenarios using this indicator:
🚀 Momentum Acceleration:
An expanding green line above recent price action signals increasing bullish momentum, suggesting buyers are gaining strength. Conversely, a downward-expanding red line below price action indicates stronger bearish momentum, signifying increasing selling pressure.
🔄 Momentum Reversal:
A clear shift from red to green (or vice versa) often signals potential momentum reversals, providing traders with timely indications of possible market turns or shifts in sentiment.
⚖️ Momentum Consolidation:
When the indicator remains near the price line, it suggests weak momentum and potential market consolidation. Traders might interpret this as a range-bound market environment, adjusting their strategies accordingly.
By carefully monitoring these momentum shifts, traders can gain deeper insights into the underlying market dynamics and better prepare for future price movements.
🔹 DETAILS
The indicator’s momentum visualization is presented directly over the current price action, enhancing traders' ability to rapidly interpret momentum without additional chart clutter:
✅ Green Line: Positive momentum (bullish bias).
❌ Red Line: Negative momentum (bearish bias).
The vertical distance between the Momentum Trend Strength line and price visually indicates momentum intensity:
Larger distance: Signifies stronger market momentum.
Smaller distance: Suggests weakening momentum or neutral conditions.
🔹 Interpretation
Key interpretations include:
Bullish Confirmation: Sustained green lines indicate robust buying activity and confirm bullish trends.
Bearish Confirmation: Persistent red lines suggest strong selling pressure and validate bearish market sentiment.
Early Reversal Signals: Color transitions alert traders to potential market reversals, providing early opportunities to reassess trades.
🔹 Practical Application
Traders commonly integrate Momentum Trend Strength (MTS) into their broader trading strategies by:
Confirming directional trends alongside price action analysis.
Identifying optimal trade entry and exit points during momentum shifts.
Reducing market noise through customizable smoothing, enhancing clarity of momentum signals.
🔹 SETTINGS
📌 Momentum Parameters
Length: Adjusts sensitivity for momentum detection, influencing how quickly momentum shifts are identified.
EMA Smoothing: Determines the level of noise filtering, balancing signal responsiveness and smoothness.
📌 Visualization
Automatic color adaptation clearly signals bullish or bearish momentum.
Simple default visualization settings optimize usability for traders across various markets and timeframes.
🔹 ADDITIONAL NOTES
The Momentum Trend Strength (MTS) indicator provides traders with a straightforward yet powerful visualization of momentum directly on the price chart. Its intuitive nature and adaptive settings make it a valuable addition to various trading approaches and analytical methods, helping traders confidently interpret market movements and momentum dynamics in real-time.
Forexsom MA Crossover SignalsA Trend-Following Trading Indicator for TradingView
Overview
This indicator plots two moving averages (MA) on your chart and generates visual signals when they cross, helping traders identify potential trend reversals. It is designed to be simple yet effective for both beginners and experienced traders.
Key Features
✅ Dual Moving Averages – Plots a Fast MA (default: 9-period) and a Slow MA (default: 21-period)
✅ Customizable MA Types – Choose between EMA (Exponential Moving Average) or SMA (Simple Moving Average)
✅ Clear Buy/Sell Signals – Displays "BUY" (green label) when the Fast MA crosses above the Slow MA and "SELL" (red label) when it crosses below
✅ Alerts – Get notified when new signals appear (compatible with TradingView alerts)
✅ Clean Visuals – Easy-to-read moving averages with adjustable colors
How It Works
Bullish Signal (BUY) → Fast MA crosses above Slow MA (suggests uptrend)
Bearish Signal (SELL) → Fast MA crosses below Slow MA (suggests downtrend)
Best Used For
✔ Trend-following strategies (swing trading, day trading)
✔ Confirming trend reversals
✔ Filtering trade entries in combination with other indicators
Customization Options
Adjust Fast & Slow MA lengths
Switch between EMA or SMA for smoother or more responsive signals
Why Use This Indicator?
Simple & Effective – No clutter, just clear signals
Works on All Timeframes – From scalping (1M, 5M) to long-term trading (4H, Daily)
Alerts for Real-Time Trading – Never miss a signal
Overlay Hourly Candle [odnac] * This script overlays 1-hour candlestick representations on the chart.
* It captures the open, close, high, and low prices for each hourly period.
* The script dynamically updates as new hourly candles form and adjusts the
* box and wick positions accordingly.
*
* Features:
* - Draws an hourly candle with body and wicks.
* - Colors bullish candles in green and bearish candles in red.
* - Updates dynamically as new hourly candles form.
* - Uses TradingView's box and line functions to represent candle structures.
*
* Usage:
* - Add the script to your TradingView chart as an overlay.
* - Observe how the hourly candles appear distinctly on any timeframe.
Internal BOS X FVG Algorithms - 1 Visi TraderInternal BOS X FVG Algorithms,
This strategy is based on 2 momentum combinations:
• Internal Break of Structure was formed together with Fair Value Gap (FVG)
Formula of Internal BOS X FVG Algorithms:
1. Break (Internal BOS) X Bullish FVG = Zone for BUY Setup
2. Break (Internal BOS) X Bearish FVG = Zone for SELL Setup
// ----------- Add-ons Setting ----------- //
Setting for Internal BOS X FVG Algorithms:
---------
#1: Internal Break of Structure Settings,
• Internal Swing:
The number of left and right Swing Intervals that are checked when searching for Swing Points. More Values = Less Swing Points plotted to be potential Internal BOS and Less Values = More Swing Points plotted to be potential Internal BOS.
• Internal BOS Color:
You can change the color of dotted line and text for Internal BOS ("Break") according to your favorites layout.
#2: Fair Value Gap Settings,
• FVG Min. Range (In Pips):
Input minimum range of Fair Value Gap in Pips, more value = less zone results.
• FVG Max. Range (In Pips):
Input maximum range of Fair Value Gap in Pips, less value = less zone results.
• Extended Right - FVG:
You can change the value of extended fair value gap zone according to your best preferences.
#3: FVG Color Settings,
• Bullish FVG:
Change color FVG for Bullish Fair Value Gap Zone.
• Bearish FVG:
Change color FVG for Bearish Fair Value Gap Zone.
#4: Mode FVG,
• FVG Variations:
- Global FVG = All Variations of Fair Value Gap Category
- Specific FVG = Variation based on last of 2 FVG's Candles in same color
#5: Trading Session,
• Session Hours:
You can adjust the trading hour according to the best session and volatility of pair assets that you want to trades.
---------
How to Entry (Instructions):
1. Buy Positions = Internal BOS ("Break") form together with Bullish FVG, wait for pullback on FVG Zone and then you can open positions. Set Stop Loss (SL) below FVG Zone and set Take Profit (TP) in minimum 1:2 RR - if price hit 1:1 RR you can set Breakeven for managing the trading risk.
2. Sell Positions = Internal BOS ("Break") form together with Bearish FVG, wait for pullback on FVG Zone and then you can open positions. Set Stop Loss (SL) above FVG Zone and set Take Profit (TP) in minimum 1:2 RR - if price hit 1:1 RR you can set Breakeven for managing the trading risk.
*Notes:
The best pair asset for this strategy is on Gold (XAU/USD) at NY Sessions (19.00 - 22.00 GMT+7) - Timeframe M1 (1 Minute).
--------
Best Regards,
- 1 VISI TRADER
Trading for Prosperity!
--------
DISCLAIMER: No reselling or any other forms of use are authorized for our documents, script / strategy, and the information published with them. This informational planning script / strategy is strictly for individual use and educational purposes only. This is not financial or investment advice. Investments are always made at your own risk and are based on your personal judgement. I am not responsible for any losses you may incur. Please invest wisely.*
9 by 21(high & low) GSK-VIZAG-AP-INDIA21 EMA High & Low + 9 EMA Crossover with Volume & Wick Confirmation
🔹 What Does This Indicator Do?
This indicator is designed for momentum-based trend trading by combining exponential moving averages (EMAs), price action filters, and volume analysis. It provides traders with high-probability buy and sell signals while filtering out weak trends and false breakouts.
🔹 How Is It Different from Other Indicators?
Unlike traditional EMA crossover strategies that rely only on moving averages, this indicator enhances reliability by incorporating custom volume conditions, price action validation, and wick-based filtering.
Key Features That Make It Unique:
Dynamic EMA Bands for Trend Identification
Uses 21 EMA High & 21 EMA Low as dynamic support & resistance levels, creating a flexible trading range.
Helps traders identify trend strength and potential reversals without relying on static levels.
Enhanced EMA Crossover System
Includes a 9 EMA crossover signal to detect momentum shifts before traditional EMAs react.
Avoids lagging signals often seen in standard moving average crossovers.
Smart Volume-Based Confirmation
Uses a custom volume multiplier to detect significant market participation.
Filters out low-volume breakouts that may lead to false signals.
Wick-Based Filtering for Precision
Identifies candles with no lower wick (for buy signals) and no upper wick (for sell signals) to confirm strong price movements.
Helps traders avoid weak reversals and focus only on strong momentum shifts.
🔹 How to Use This Indicator in Trading?
Buy Conditions:
Bullish candle (green) with no lower wick, confirming strong buying pressure.
Price is above the 21 EMA High and remains above 21 EMA Low.
Volume shows an increase, confirming market participation.
Sell Conditions:
Bearish candle (red) with no upper wick, signaling strong selling pressure.
Price is below the 21 EMA Low and remains under the 21 EMA High.
Volume confirms strong momentum in the downward direction.
Bonus: The indicator also highlights 9 EMA & 21 EMA crossovers to provideearly trend confirmations.
Who Should Use This Indicator?
✅ Intraday Traders – Looking for quick entry and exit signals based on price momentum.
✅ Swing Traders – Who want to identify medium-term trend shifts with volume confirmation.
✅ Trend Followers – Seeking a robust moving average system to avoid false breakouts.
✅ Momentum Traders – Who need price-action-based confirmation before taking a trade.
Why This Indicator Stands Out?
Unlike standard EMA-based indicators that often generate false breakouts, this tool:
✔️ Filters low-quality signals using smart volume analysis.
✔️ Enhances trend confirmation with wick-based filtering.
✔️ Detects momentum early using a unique EMA crossover combination.
This makes it more reliable than traditional moving average-based systems and highly adaptable for different market conditions.
Note: The logic behind this indicator is proprietary and non-repainting, making it a powerful tool for traders who rely on EMA-based trend strategies.
Try it out and see how it improves your trading decisions!
Why This Description Works?
✔ No code exposure – The logic is explained in concept but not in detail.
✔ Clear differentiation – Shows why this is better than other indicators.
✔ Compliant with TradingView rules – No vague claims, but precise explanations.
Would you like to add any specific trading examples or screenshots to further enhance it? Let me know!
Share Your Experience!
Your feedback is valuable! If you find this indicator useful, leave a comment with your experience—how it worked for you, any improvements you suggest, or the best settings you discovered.
Let’s build a community of traders refining strategies together!
Disclaimer:
This indicator is for educational and informational purposes only. It does not guarantee profitable trades and should be used with proper risk management. Always conduct your own research before making trading decisions.
ICT Breakers (BOS / MSS - Market Structure) [ICTProTools]The Breakers (Market Structure) indicator is designed to help traders identify true breaker structures , a key concept in Inner Circle Trader (ICT) methodology. In market structure, Breakers represent powerful shifts where a key high or low is broken, leading to a reversal in market direction. Most tools misinterpret structure shifts, using internal structure , leading to fake breakouts. This tool solves that problem by filtering out false signals , providing clear & structured insights , all with multi-timeframe compatibility.
💎 Key Features
⚡️ Breakers in action
The indicator shows the structure following ICT instructions. A breaker is defined by two lines:
The first line confirms the previous trend (it could be interpreted as a BOS).
The second line highlights the moment price breaks structure (with candle body or wick based on your chosen settings), signaling a shift in trend direction (like an MSS).
Furthermore, it’s important to note that a breaker not only shows the structure, but also defines a potential Point of Interest (POI), an area where price may retrace before continuing its trend.
Here, we can observe two clear structure shifts.
On the far left, the market was in a bearish trend, illustrated by the first visible (dotted and red) line. Shortly after, the second (solid and green) line appears, showing a break that initiates a new bullish trend.
This upward movement continues, with the last confirmation marked by a top structure line. And finally, the structure is broken once again indicating a transition back into a bearish trend.
💪 Real Structure with True Highs / Lows
Unlike many indicators that detect internal breakouts , this tool follows ICT’s true market structure rules .
In a bearish trend , a bullish breaker is only confirmed when the high that created the low is broken , and conversely for a bullish scenario.
Fake breakouts are ignored, preventing misleading signals.
In the image above, the white breakout is correctly ignored by the indicator, as it doesn't align with ICT’s structural rules. That white high is simply part of the internal structure, not the true swing point. Instead, the green line highlights the key level that truly matters, the one whose rupture would have confirmed a real change in market structure.
🔔 Smart Alerts for Structure Updates
Stay one step ahead with customizable alerts designed to notify you instantly when market structure changes occur.
Get notified for BOS (Continuation) and / or MSS (Breaker) events.
Set alerts for bullish , bearish , or both directions.
Choose between once or repeated alerts , based on your strategy.
This feature allows traders to remain focused and reactive , even when monitoring multiple markets.
In the alert settings, select which structure shifts you want to be notified of. Whether you're a scalper or a swing trader, the alerts keep you connected to key moments without needing to constantly monitor the chart.
⏳ Multi-Timeframe Structure
All features of the indicator are fully compatible with higher timeframes .
Get a broader view of market structure without switching timeframes.
Monitor higher timeframe structures and receive alerts, all without leaving your analysis chart .
In this example, the market structure of the 30m timeframe is displayed while on a 5m chart, providing a clearer perspective.
✨ Customization & User Control
Make it yours! The indicator allows full customization:
Swing bars (to confirm high / low)
Select your mode for Breakers (MSS) , using the candle body only or body / wick
Line style (type, width, color)
Choice of displayed timeframe
Activate any alert , with the frequency you want
🎯 Conclusion
✅ Avoid false signals by focusing on true ICT Breakers
✅ Smart alerts to never miss a structural shift
✅ Multi-timeframe support for enhanced analysis
✅ Clean & professional design for an optimal trading experience
Correlation TableThis indicator displays a vertical table that shows the correlation between the asset currently loaded on the chart and up to 32 selected trading pairs. It offers the following features:
Chart-Based Correlation: Correlations are calculated based on the asset you have loaded in your chart, providing relevant insights for your current market focus.
Configurable Pairs: Choose from a list of 32 symbols (e.g., AUDUSD, EURUSD, GBPUSD, etc.) with individual checkboxes to include or exclude each pair in the correlation analysis.
Custom Correlation Length: Adjust the lookback period for the correlation calculation to suit your analysis needs.
Optional EMA Smoothing: Enable an Exponential Moving Average (EMA) on the price data, with a configurable EMA length, to smooth the series before calculating correlations.
Color-Coded Output: The table cells change color based on the correlation strength and direction—neutral, bullish (green), or bearish (red)—making it easy to interpret at a glance.
Clear Table Layout: The indicator outputs a neatly organized vertical table with headers for "Pair" and "Correlation," ensuring the information is displayed cleanly and is easy to understand.
Ideal for traders who want a quick visual overview of how different instruments correlate with their current asset, this tool supports informed multi-asset analysis
ITALIANO:
Questo indicatore visualizza una tabella verticale che mostra la correlazione tra l'asset attualmente caricato sul grafico e fino a 32 coppie di trading selezionate. Offre le seguenti funzionalità:
Correlazione basata sul grafico: le correlazioni vengono calcolate in base all'asset caricato nel grafico, fornendo informazioni pertinenti per il tuo attuale focus di mercato.
Coppie configurabili: scegli da un elenco di 32 simboli (ad esempio, AUDUSD, EURUSD, GBPUSD, ecc.) con caselle di controllo individuali per includere o escludere ciascuna coppia nell'analisi della correlazione.
Lunghezza di correlazione personalizzata: regola il periodo di lookback per il calcolo della correlazione in base alle tue esigenze di analisi.
Smoothing EMA opzionale: abilita una media mobile esponenziale (EMA) sui dati dei prezzi, con una lunghezza EMA configurabile, per smussare la serie prima di calcolare le correlazioni.
Output codificato a colori: le celle della tabella cambiano colore in base alla forza e alla direzione della correlazione, neutra, rialzista (verde) o ribassista (rosso), rendendola facile da interpretare a colpo d'occhio.
Clear Table Layout: l'indicatore genera una tabella verticale ordinatamente organizzata con intestazioni per "Coppia" e "Correlazione", assicurando che le informazioni siano visualizzate in modo chiaro e siano facili da comprendere.
Ideale per i trader che desiderano una rapida panoramica visiva di come diversi strumenti siano correlati con il loro asset corrente, questo strumento supporta un'analisi multi-asset informata
Stacked EMA Candle Colors - Enhanced📊 Stacked EMA Candle Colors – Trend Strength Visualizer
Description:
🚀 Overview:
The Stacked EMA Candle Colors – Trend Strength Visualizer is a simple yet powerful indicator that helps traders identify market trends using Exponential Moving Averages (EMAs). By dynamically coloring candles based on the strength and alignment of multiple EMAs, this tool makes it easier to spot bullish and bearish trends at a glance, without cluttering your chart with multiple EMA lines.
🔹 Key Features:
✅ Four Customizable EMA lengths (adjust in settings)
✅ Candles change color based on EMA stacking (adjustable)
✅ Four-part gradient-based strength visualization for momentum confirmation (adjustable)
✅ Works on all timeframes and asset classes
🎨 How It Works:
When shorter EMAs (e.g., 9, 21) are above longer EMAs (e.g., 50, 200), the trend is bullish, and candles turn green/lime based on momentum strength.
When shorter EMAs are below longer EMAs, the trend is bearish, and candles turn red/pink depending on trend intensity.
If no clear trend is detected, candles remain gray for neutrality.
📈 Ideal for:
✔️ Trend traders who want a clear visual representation of momentum
✔️ Scalpers, day traders, and swing traders looking for quick trend confirmation
✔️ Anyone who wants to enhance their chart readability
🔧 Customization:
Easily adjust the EMA periods in the settings menu to fit your preferred trading strategy!
🚀 Add this indicator to your TradingView chart and spot trends with confidence!
Trendline Breaks with Multi Fibonacci Supertrend StrategyTMFS Strategy: Advanced Trendline Breakouts with Multi-Fibonacci Supertrend
Elevate your algorithmic trading with institutional-grade signal confluence
Strategy Genesis & Evolution
This advanced trading system represents the culmination of a personal research journey, evolving from my custom " Multi Fibonacci Supertrend with Signals " indicator into a comprehensive trading strategy. Built upon the exceptional trendline detection methodology pioneered by LuxAlgo in their " Trendlines with Breaks " indicator, I've engineered a systematic framework that integrates multiple technical factors into a cohesive trading system.
Core Fibonacci Principles
At the heart of this strategy lies the Fibonacci sequence application to volatility measurement:
// Fibonacci-based factors for multiple Supertrend calculations
factor1 = input.float(0.618, 'Factor 1 (Weak/Fibonacci)', minval = 0.01, step = 0.01)
factor2 = input.float(1.618, 'Factor 2 (Medium/Golden Ratio)', minval = 0.01, step = 0.01)
factor3 = input.float(2.618, 'Factor 3 (Strong/Extended Fib)', minval = 0.01, step = 0.01)
These precise Fibonacci ratios create a dynamic volatility envelope that adapts to changing market conditions while maintaining mathematical harmony with natural price movements.
Dynamic Trendline Detection
The strategy incorporates LuxAlgo's pioneering approach to trendline detection:
// Pivotal swing detection (inspired by LuxAlgo)
pivot_high = ta.pivothigh(swing_length, swing_length)
pivot_low = ta.pivotlow(swing_length, swing_length)
// Dynamic slope calculation using ATR
slope = atr_value / swing_length * atr_multiplier
// Update trendlines based on pivot detection
if bool(pivot_high)
upper_slope := slope
upper_trendline := pivot_high
else
upper_trendline := nz(upper_trendline) - nz(upper_slope)
This adaptive trendline approach automatically identifies key structural market boundaries, adjusting in real-time to evolving chart patterns.
Breakout State Management
The strategy implements sophisticated state tracking for breakout detection:
// Track breakouts with state variables
var int upper_breakout_state = 0
var int lower_breakout_state = 0
// Update breakout state when price crosses trendlines
upper_breakout_state := bool(pivot_high) ? 0 : close > upper_trendline ? 1 : upper_breakout_state
lower_breakout_state := bool(pivot_low) ? 0 : close < lower_trendline ? 1 : lower_breakout_state
// Detect new breakouts (state transitions)
bool new_upper_breakout = upper_breakout_state > upper_breakout_state
bool new_lower_breakout = lower_breakout_state > lower_breakout_state
This state-based approach enables precise identification of the exact moment when price breaks through a significant trendline.
Multi-Factor Signal Confluence
Entry signals require confirmation from multiple technical factors:
// Define entry conditions with multi-factor confluence
long_entry_condition = enable_long_positions and
upper_breakout_state > upper_breakout_state and // New trendline breakout
di_plus > di_minus and // Bullish DMI confirmation
close > smoothed_trend // Price above Supertrend envelope
// Execute trades only with full confirmation
if long_entry_condition
strategy.entry('L', strategy.long, comment = "LONG")
This strict requirement for confluence significantly reduces false signals and improves the quality of trade entries.
Advanced Risk Management
The strategy includes sophisticated risk controls with multiple methodologies:
// Calculate stop loss based on selected method
get_long_stop_loss_price(base_price) =>
switch stop_loss_method
'PERC' => base_price * (1 - long_stop_loss_percent)
'ATR' => base_price - long_stop_loss_atr_multiplier * entry_atr
'RR' => base_price - (get_long_take_profit_price() - base_price) / long_risk_reward_ratio
=> na
// Implement trailing functionality
strategy.exit(
id = 'Long Take Profit / Stop Loss',
from_entry = 'L',
qty_percent = take_profit_quantity_percent,
limit = trailing_take_profit_enabled ? na : long_take_profit_price,
stop = long_stop_loss_price,
trail_price = trailing_take_profit_enabled ? long_take_profit_price : na,
trail_offset = trailing_take_profit_enabled ? long_trailing_tp_step_ticks : na,
comment = "TP/SL Triggered"
)
This flexible approach adapts to varying market conditions while providing comprehensive downside protection.
Performance Characteristics
Rigorous backtesting demonstrates exceptional capital appreciation potential with impressive risk-adjusted metrics:
Remarkable total return profile (1,517%+)
Strong Sortino ratio (3.691) indicating superior downside risk control
Profit factor of 1.924 across all trades (2.153 for long positions)
Win rate exceeding 35% with balanced distribution across varied market conditions
Institutional Considerations
The strategy architecture addresses execution complexities faced by institutional participants with temporal filtering and date-range capabilities:
// Time Filter settings with flexible timezone support
import jason5480/time_filters/5 as time_filter
src_timezone = input.string(defval = 'Exchange', title = 'Source Timezone')
dst_timezone = input.string(defval = 'Exchange', title = 'Destination Timezone')
// Date range filtering for precise execution windows
use_from_date = input.bool(defval = true, title = 'Enable Start Date')
from_date = input.time(defval = timestamp('01 Jan 2022 00:00'), title = 'Start Date')
// Validate trading permission based on temporal constraints
date_filter_approved = time_filter.is_in_date_range(
use_from_date, from_date, use_to_date, to_date, src_timezone, dst_timezone
)
These capabilities enable precise execution timing and market session optimization critical for larger market participants.
Acknowledgments
Special thanks to LuxAlgo for the pioneering work on trendline detection and breakout identification that inspired elements of this strategy. Their innovative approach to technical analysis provided a valuable foundation upon which I could build my Fibonacci-based methodology.
This strategy is shared under the same Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license as LuxAlgo's original work.
Past performance is not indicative of future results. Conduct thorough analysis before implementing any algorithmic strategy.
Dynamic Heat Levels [BigBeluga]This indicator visualizes dynamic support and resistance levels with an adaptive heatmap effect. It helps traders identify key price interaction zones and potential mean reversion opportunities by displaying multiple levels that react to price movement.
🔵Key Features:
Multi-Level Heatmap Channel:
- The indicator plots multiple dynamic levels forming a structured channel.
- Each level represents a historical price interaction zone, helping traders identify critical areas.
- The channel expands or contracts based on market conditions, adapting dynamically to price movements.
Heatmap-Based Strength Indication:
- Levels change in transparency and color intensity based on price interactions for the length period .
- The more frequently price interacts with a level, the more visible and intense the color becomes.
- When a level reaches a threshold (count > 10), it starts to turn red, signaling a high-heat zone with significant price activity.
🔵Usage:
Support & Resistance Analysis: Identify price levels where the market frequently interacts, making them strong areas for trade decisions.
Heatmap Strength Assessment: More intense red levels indicate areas with heavy price activity, useful for detecting key liquidity zones.
Dynamic Heat Levels is a powerful tool for traders looking to analyze price interaction zones with a heatmap effect. It offers a structured visualization of market dynamics, allowing traders to gauge the significance of key levels and detect mean reversion setups effectively.
Original Gann Swing Chart Rules [AlgoFuego]🔵 Original Gann Swing Chart Rules
An advanced indicator built on W.D. Gann’s original rules, enhanced with innovative mechanical trend-following methods.
🔹 Description
This indicator functions by balancing short-term adaptability with long-term trend analysis.
The indicator incorporates Gann’s principles alongside mechanical trend-following techniques to offer a structured method for analyzing trends and detecting potential market reversals.
Golden Rule: Non-trend bars are excluded from analysis, and each new bar is compared with the previous trend bar, it highlights significant swing points with greater clarity.
🔸 The core concept behind the golden rule on which this indicator is built.
The person watching the tide coming, wanting to pinpoint the exact spot that signals the high tide, places a stick in the sand at the points where the incoming waves reach until the stick reaches a position where the waves no longer rise, and eventually recedes enough to show that the tide has shifted.
This method is effective for monitoring and identifying tides and floods in the stock market.
🔸Rule 1: The trend bar is everything.
→It is a bar that forms a new high, low, or both.
🔸Rule 2: The professional traders track new highs and lows.
🔸Rule 3: The hidden bar is nothing.
→It is a bar that does not form a new high, low, or both.
🔸Rule 4: The sea has a wavy nature, and the market as well.
🔸Rule 5: The slope is the immediate direction of the swing.
Downward slope
→The downslope is the descending slope of a swing, shows a decline, reflecting a bearish price trend.
Upward slope
→The upslope is the ascending slope of a swing, shows an incline, reflecting a bullish price trend.
🔸Rule 6: The start and end of the movement are the swing points.
→The lowest or highest price of the last bar in the direction of the slope represents the swing point after the slopes direction changes.
Valley
→It is the lowest price of the last bar in a downslope before the market turns to a upslope.
End=> Downward slope and Start=> Upward slope
Peak
→It is the highest price of the last bar in a upslope before the market turns to an downslope.
End=> Upward slope and Start=> Downward slope
🔸Rule 7: The Golden Rule: Ignore all no-trend bars and compare the new bar with the previous trend bar.
→Applying the golden rule in upward slope
→Applying the golden rule in downward slope
🔸 Related content: Personal words of W.D Gann from the book Wall Street Stock Selector.
→"This was only one month's reaction the same as March 1925. The market held in a dull narrow range for about 2 months while accumulation was taking place and in June the main trend turned up again."
→The beginning of the main trend and the formation of the Valley.
→The beginning of the main trend and the formation of the Peak.
🔸 Rule 8: The Closing Price of the Bar to Understand Movement Direction.
Sequence is important
→ Downward bar
→ Upward bar
🔸 Outside Bar Rules
→Explanation of rules and calculations.
🔸 How does a trend start?
Upward trend
Trend change from Downward to Upward.
Prices must take out the nearest 'Peak' and the Trend was previously Downward.
A breakout above the previous peak signals a bullish reversal.
→ Model 1 - Dropping Valley Reversal
The market forms a dropping valley, followed by a breakout above the previous peak.
→ Model 2 - Equal Valley Reversal
The market forms an equal valley, followed by a breakout above the previous peak.
→ Model 3 - Rising Valley Reversal
The market forms a rising valley, followed by a breakout above the previous peak.
Downward trend
Trend change from Upward to Downward.
Prices must take out the nearest ‘Valley' and the Trend was previously Upward.
A breakdown below the previous valley signals a bearish reversal.
→ Model 1 - Rising Peak Reversal
The market forms a rising peak, followed by a breakdown below the previous valley.
→ Model 2 - Equal Peak Reversal
The market forms an equal peak, followed by a breakdown below the previous valley.
→ Model 3 - Dropping Peak Reversal
The market forms a dropping peak, followed by a breakdown below the previous valley.
🔸 The fractal nature of markets
Rising wave
→ The rising wave is the entire bull market between turning points
High point : When the Main trend turns from upward to downward, the peak of the primary trend is formed.
Dropping wave
→ The Dropping wave is the entire bear market between turning points.
Low point : When the Main trend turns from downward to upward, the primary trend valley is formed.
Fractal nature application.
Everything in one picture.
🔹 Features
Strict adherence to the rules: Follows the Original Gann Swing Chart Rules to detect swing points.
Fractal analysis: Uses trend bars and fractal analysis to identify swing points.
Robust functionality: Engineered to handle complex market conditions with advanced logic.
Custom alerts: Alerts for peak/valley completion, main and primary trend reversals & continuations.
Golden rule application: Filters out non-trend bars by comparing only with the last trend bar.
Reversal & trend detection: Applies eight outside bar rules to detect trend reversals and continuations.
Dynamic customization: Fully customizable settings.
🔹 Settings overview
Fine-tune the indicator to match your unique trading strategy by adjusting trend settings, customizing alerts, and modifying visualization options.
1. Main trend settings
Hide/Show Main trend options: Instantly hide all main trend options (alerts remain separate).
Main trendline display & alerts: Toggle trendline visibility and set alerts for peaks and valleys.
Trendline customization: Adjust styles, colors, and slopes for upward/downward trends.
Peaks & Valleys markers: Show/hide points and customize their color and size.
Opposite Main trend turning points: Enable alerts and modify style, width, color, and offset.
Breakout/Breakdown points: Set alerts and customize their appearance.
2. Primary trend settings
Hide/Show primary trend options: Instantly hide all primary trend options (alerts remain separate).
Primary trendline display & alerts: Toggle trendline visibility and set alerts for peaks and valleys.
Trendline customization: Adjust styles, colors, and slopes for upward/downward trends.
Peaks & Valleys markers: Show/hide points and customize their color and size.
Opposite primary trend turning points: Enable alerts and modify style, width, color, and offset.
Breakout/Breakdown points: Set alerts and customize their appearance.
3. Additional options
Tooltips display: Control tooltip visibility for labels and languages.
Candle/Bar coloring: Customize candle and bar colors based on algorithm-selected trends.
🔸 Additional features
🔹Custom reading of bars.
The arrow represents the direction of the slope, the dot is the type of trend, and the line is the closing price.
🔹 Advanced Moving Average Activator
The Advanced Moving Average Activator, this setting calculates the average closing prices of trend bars only, which are the only bars considered by Gann.
The advantage of this method is that it helps avoid hidden bars that are not accounted for, making the difference more evident in a ranging market. The values are updated only when new highs or lows occur.
Additionally, you can set alerts when the price closes above or below the moving average.
🔹 Bar Counter
After a trend change, you can see exactly when the shift occurred and customize the type of trend you want to track.
For example, by conducting your own research on the assets you trade, based on historical data, you might discover valuable insights, such as the primary trend possibly lasting longer than 20 bars!
You can use these insights to refine your trading strategy and make more data-driven decisions.
🔹 How to use
Step 1: Configure the settings and choose your trading approach
Adjust the indicator settings to match your trading style and market conditions.
Effectively using the indicator starts with selecting your preferred trading style.
You can trade in alignment with the primary trend, capitalize on market reversals, or take advantage of breakouts.
Trading with the primary trend: Best for traders who prefer longer-term positions with higher stability.
Trading reversals: Ideal for those looking to enter at potential turning points but requires additional confirmation.
Trading breakouts: Suitable for traders targeting strong price movements after key level breakouts.
Adapting to market volatility: Monitor changing volatility and adjust your strategy accordingly for optimal results.
Step 2: Analyze the chart
Apply the indicator to your TradingView chart and interpret swing signals for informed decisions.
Carefully study the chart patterns to detect subtle signals.
Check if similar signals worked well in past market conditions.
Use multi-timeframe analysis for a broader perspective.
Step 3: Trade with the primary trend
Utilize trend direction to align trades with prevailing market movements.
Always trade in the direction of the primary trend.
Confirm the trend direction using multiple indicators or by relying on the primary trend as confirmation!.
Avoid trading against strong market momentum.
Step 4: Identify entry signals
Use indicator signals to identify ideal trade entry points.
Look for confirmation before entering a trade.
Wait for clear signals to avoid false entries.
Practice on a demo account to build confidence in your entry strategy.
Step 5: Apply risk management
Define stop-loss and take-profit levels to protect your capital effectively.
Set stop-loss orders at strategic levels to limit potential losses.
Risk only a small percentage of your capital per trade.
Adjust risk levels based on your overall portfolio performance.
Step 6: Confirm with trend analysis
Validate trends using additional indicators for a higher probability of success.
Use complementary tools to confirm trend direction.
Monitor trend changes to adjust your strategy promptly.
Keep an eye on volume indicators for added confirmation.
Step 7: Execute the trade
Enter trades based on confirmed signals and predefined strategy rules.
Ensure all your criteria are met before executing a trade.
Stay disciplined and stick to your strategy.
Review market conditions right before execution.
Step 8: Monitor the trade
Track trade performance and make adjustments as necessary.
Keep an eye on market conditions throughout the trade.
Be ready to adjust your strategy if unexpected events occur.
Use trailing stops to secure profits while allowing for gains.
Step 9: Implement exit strategy
Close trades strategically based on your pre-established exit plan.
Plan your exit strategy in advance and adhere to it.
Consider partial exits to secure profits along the way.
Avoid emotional decisions when closing trades.
Step 10: Review performance
Analyze past trades to continuously refine and improve your strategy.
Regularly review and document your trades for insights.
Identify patterns in both your successes and mistakes.
Update your strategy based on comprehensive performance reviews.
🔹 Disclosure
While this script is useful and provides insight into market tops, bottoms, and trend trading, it's critical to understand that past performance is not necessarily indicative of future results and there are many more factors that go into being a profitable trader.
TR FVG & Swing High Low FinderTR FVG & Swing Level Finder
Overview:
The TR FVG & Swing Level Finder is a powerful Pine Script indicator designed for traders who want to identify Fair Value Gaps (FVGs) and Swing Highs/Lows on their charts. This indicator combines two essential technical analysis tools into one, helping traders spot potential areas of support, resistance, and trend reversals. FVGs are price gaps that often act as areas of interest for price to return to, while swing highs and lows help identify key turning points in the market. The indicator is highly customizable, allowing users to adjust colors, limits, and display options to suit their trading style.
Key Features:
1: Fair Value Gap (FVG) Detection:
- Identifies Bullish FVGs: Occur when the high of two candles ago is lower than the low of the current candle, indicating a potential upward price movement.
- Identifies Bearish FVGs: Occur when the low of two candles ago is higher than the high of the current candle, indicating a potential downward price movement.
- Displays FVGs as colored boxes on the chart, with customizable border and fill colors based on the timeframe.
- Labels each FVG box with the corresponding timeframe (e.g., "1m FVG", "1h FVG", "Daily FVG").
2: Swing High and Swing Low Detection:
- Detects Swing Highs: A 3-candle pattern where the middle candle's high is higher than the highs of the candles on either side.
- Detects Swing Lows: A 3-candle pattern where the middle candle's low is lower than the lows of the candles on either side.
- Draws a solid black line with 50% opacity at each swing high and low, extending 5 bars to the right for better visibility.
- Adds a small Swing High or Swing Low label at the right end of each line, colored according to user-defined settings.
3: Timeframe-Specific FVG Visualization:
- FVGs are color-coded based on the chart's timeframe, making it easy to distinguish between FVGs on different timeframes.
- Each timeframe has its own fill color for bullish and bearish FVGs, with adjustable transparency for better chart clarity.
- A dashed black line is drawn in the middle of each FVG box to highlight the midpoint of the gap.
4: Customizable Display Options:
- FVG Limit: Control the maximum number of FVGs displayed on the chart (from 1 to 20).
- Extend Options for FVG Boxes:
- "None": FVG boxes extend only 2 bars to the right.
- "Limited": FVG boxes extend a user-defined number of candles to the right (1 to 100 candles).
- "Default": FVG boxes extend 3 bars to the right of the current bar.
- Color Customization:
- Set border colors for bullish and bearish FVGs.
- Adjust fill colors for FVGs on different timeframes (1m, 5m, 15m, 30m, 1h, 4h, Daily, Weekly, Monthly).
- Customize the colors of swing high and swing low labels.
5: Performance Optimization:
- The indicator only plots FVGs and swings on the last confirmed bar (barstate.islastconfirmedhistory), ensuring efficient performance and reducing chart clutter.
- Limits the number of displayed FVGs and swings to the user-defined fvgLimit, keeping the chart clean and focused on the most recent price action.
6: Inputs and Customization:
- Number of FVGs to Show (fvgLimit): Set the maximum number of FVGs and swings to display (default: 3, range: 1 to 20).
- Bullish FVG Border Color (bullishColor): Choose the border color for bullish FVGs (default: green).
- Bearish FVG Border Color (bearishColor): Choose the border color for bearish FVGs (default: red).
- Swing High Color (swingHighColor): Set the color for swing high labels (default: blue).
- Swing Low Color (swingLowColor): Set the color for swing low labels (default: purple).
- Extend Options:
- Extend Option (extendOption): Choose how far FVG boxes extend to the right ("None", "Limited", or "Default"; default: "Default").
- Extend Candles (extendCandles): If "Limited" is selected, specify the number of candles to extend FVG boxes (default: 8, range: 1 to 100).
- Timeframe-Specific Fill Colors:
- Customize fill colors for bullish and bearish FVGs on various timeframes (1m, 5m, 15m, 30m, 1h, 4h, Daily, Weekly, Monthly).
- Each fill color has a default transparency (e.g., 93% for most timeframes, 90% for 30m), which can be adjusted as needed.
How to Use:
1: Add the Indicator to Your Chart:
- Open TradingView, go to the Pine Editor, and paste the script.
- Click "Add to Chart" to apply the indicator to your current chart.
2: Adjust Settings:
- Open the indicator settings by clicking the gear icon next to the indicator name on your chart.
- Modify the inputs to suit your preferences:
- Set the number of FVGs and swings to display.
- Choose your preferred colors for FVGs and swings.
- Adjust the extend options for FVG boxes.
3: Interpret the Indicator:
- FVG Boxes: Look for colored boxes on the chart, which represent Fair Value Gaps. Bullish FVGs (green borders by default) suggest potential buying opportunities, while bearish FVGs (red borders by default) suggest potential selling opportunities. The label inside each box indicates the timeframe of the FVG.
- Swing Highs and Lows: Identify key turning points with solid black lines (50% opacity) at swing highs and lows. Each line extends 5 bars to the right, with an "SH" (Swing High) or "SL" (Swing Low) label at the end. Swing highs can act as resistance levels, while swing lows can act as support levels.
4: Combine with Your Strategy:
- Use FVGs to identify areas where price might return to fill the gap, often acting as support or resistance.
- Use swing highs and lows to spot potential trend reversals or to set stop-loss and take-profit levels.
- Combine the indicator with other tools (e.g., trendlines, moving averages) for a more comprehensive trading strategy.
Notes:
- The indicator works on all timeframes, but the appearance of FVGs and swings will vary depending on the chart's timeframe.
- For best results, use the indicator on a clean chart to avoid visual clutter, especially if you increase the fvgLimit.
- The swing high/low lines are drawn with 50% opacity to ensure they don’t overpower other chart elements, but they are still clearly visible.
Author’s Note:
This script was developed to help traders identify key price levels with ease. I hope it adds value to your trading! If you have any feedback or suggestions for improvement, feel free to leave a comment. Happy trading!