Scalper - Pattern Recognition & Price Action with Divergence Scalper - Pattern Recognition & Price Action with Divergence
Overview
An educational indicator designed to demonstrate comprehensive technical analysis concepts through integrated pattern recognition, price action analysis, and divergence detection. This tool combines traditional candlestick patterns with modern institutional concepts and advanced divergence analysis for educational market study.
Educational Purpose & Originality
Core Educational Concepts
This indicator serves as a learning platform for understanding:
- **Pattern Recognition Methodology**: Systematic identification of candlestick formations
- **Price Action Theory**: Modern institutional footprint analysis
- **Divergence Analysis**: Momentum divergence detection across multiple oscillators
- **Confluence Systems**: Multi-signal integration and validation techniques
Original Implementation Features
1. Enhanced Pattern Detection Library
- **Volatility-Filtered Patterns**: ATR-based validation for pattern significance
- **Volume-Confirmed Formations**: Integration of volume analysis with pattern detection
- **Multi-Candle Pattern Recognition**: Three-candle formations and complex patterns
- **Context-Aware Detection**: Patterns validated against market structure
2. Advanced Divergence System
- **Multi-Oscillator Analysis**: RSI, CCI, and MACD divergence detection
- **Four Divergence Types**: Regular bullish/bearish and hidden bullish/bearish
- **Pivot-Based Detection**: Systematic swing high/low identification
- **Weighted Signal Integration**: Divergences integrated into confluence scoring
3. Modern Price Action Concepts
- **Fair Value Gaps (FVG)**: Identification of institutional inefficiencies
- **Order Block Detection**: Volume-validated accumulation/distribution zones
- **Dynamic Support/Resistance**: Touch-count validated levels with ATR tolerance
- **Breakout Analysis**: Volume-confirmed price breakouts
4. Intelligent Confluence System
- **Multi-Signal Aggregation**: Combines patterns, oscillators, divergences, and breakouts
- **Weighted Scoring Algorithm**: Different signal types receive appropriate weighting
- **Visual Confluence Display**: Clear indication of high-probability setups
- **Reason Tracking**: Shows which signals contribute to confluence
How to Use
Initial Configuration
1. **Enable Desired Components**: Toggle individual analysis modules based on learning focus
2. **Adjust Sensitivity Settings**: Configure pattern detection parameters for your market
3. **Select Divergence Options**: Choose oscillators and divergence types to monitor
4. **Set Confluence Requirements**: Define minimum signals needed for confirmation
Component Settings
Moving Average Configuration
- Four customizable MA lines for multi-timeframe trend analysis
- Selectable MA types (SMA, EMA, WMA, VWMA, HMA)
- Independent timeframe settings for each MA
Pattern Recognition Settings
- **Engulfing Patterns**: Strong engulfing with ATR validation
- **Doji Variations**: Standard, gravestone, and dragonfly detection
- **Hammer/Hanging Man**: Context-validated reversal patterns
- **Star Formations**: Morning and evening star patterns
- **Three Soldiers/Crows**: Momentum continuation patterns
Divergence Detection Parameters
- **Lookback Period**: Adjustable swing detection range
- **Minimum Pivot Strength**: Percentage threshold for valid pivots
- **Oscillator Selection**: RSI, CCI, MACD, or combination
- **Divergence Types**: Regular and hidden divergences
Signal Interpretation
Visual Indicators
- **Pattern Labels**: Clear marking of detected formations
- **Divergence Lines**: Visual connection between price and oscillator pivots
- **Support/Resistance Levels**: Dynamic horizontal levels with validation
- **Confluence Signals**: Large "BULL" or "BEAR" labels for high-probability setups
Dashboard Information
- Real-time oscillator values (RSI, CCI, MACD)
- Current signal count for bulls and bears
- Active divergence status
- Confluence confirmation status
Important Educational Considerations
Learning Focus
- **Pattern Study**: Understand how traditional patterns form and their limitations
- **Divergence Concepts**: Learn to identify momentum shifts before price reversals
- **Confluence Theory**: Practice combining multiple analysis techniques
- **Risk Awareness**: No pattern or signal guarantees future price movement
Limitations for Learning
- **Historical Analysis**: Patterns are identified after formation
- **No Predictive Guarantee**: Educational tool for understanding concepts, not predictions
- **Market Context Required**: Patterns should be considered within broader market context
- **Practice Required**: Effective use requires study and practice
Educational Best Practices
1. **Start Simple**: Enable one component at a time to understand each concept
2. **Paper Trade**: Practice identifying signals without real money risk
3. **Study Failed Signals**: Learn why patterns fail to improve understanding
4. **Combine with Other Analysis**: Use alongside fundamental and sentiment analysis
5. **Document Observations**: Keep a journal of pattern occurrences and outcomes
Technical Components
Indicator Architecture
- **Modular Design**: Independent modules for different analysis types
- **Performance Optimization**: Efficient calculation methods for smooth operation
- **Visual Management**: Controlled use of Pine Script drawing objects
- **Array-Based Storage**: Efficient data management for historical analysis
Calculation Methods
- **ATR-Based Validation**: Volatility-adjusted pattern filtering
- **Volume Analysis**: Comparative volume assessment for confirmation
- **Pivot Detection**: Mathematical identification of swing points
- **Statistical Validation**: Touch-count and tolerance-based S/R levels
Divergence Detection Methodology
Regular Divergences (Reversal Signals)
- **Bullish**: Price lower low + Oscillator higher low
- **Bearish**: Price higher high + Oscillator lower high
Hidden Divergences (Continuation Signals)
- **Hidden Bullish**: Price higher low + Oscillator lower low
- **Hidden Bearish**: Price lower high + Oscillator higher high
Validation Criteria
- Minimum pivot strength requirement (percentage-based)
- Lookback period for swing detection
- Multiple oscillator confirmation option
Confluence Scoring System
Signal Categories
1. **Pattern Signals** (Weight: 1): Candlestick formations
2. **Oscillator Signals** (Weight: 1): RSI/CCI extremes
3. **Breakout Signals** (Weight: 1): Volume-confirmed breaks
4. **Regular Divergences** (Weight: 2): Higher probability reversals
5. **Hidden Divergences** (Weight: 1): Trend continuation signals
Confluence Thresholds
- Adjustable minimum signal requirement (2-6 signals)
- Visual indication when threshold is met
- Detailed reason display for educational understanding
Educational Dashboard
Real-Time Metrics
- Oscillator readings (RSI, CCI, MACD)
- ATR volatility measurement
- Bull/Bear signal counts
- Divergence status
- Confluence confirmation
Customization Options
- Position selection (6 screen locations)
- Color customization for all elements
- Enable/disable individual components
Version Information
- **Version 1.1**: Added comprehensive divergence detection system
- **Educational Focus**: Designed for learning technical analysis concepts
- **Integration**: All components work together in confluence system
Disclaimer
This indicator is designed exclusively for educational purposes to demonstrate technical analysis concepts. It is not financial advice and should not be used as the sole basis for trading decisions. Past patterns and signals do not guarantee future results. Trading involves substantial risk of loss. Users should conduct their own research, practice with demo accounts, and consider seeking advice from qualified professionals before making investment decisions.
Learning Resources
The indicator includes extensive inline comments explaining each calculation and concept. Users are encouraged to study the source code to understand the methodology behind each component. This transparency aids in learning how technical indicators work and their limitations.
---
**Note**: This is an educational tool meant to help traders learn pattern recognition and technical analysis concepts. Success requires practice, additional analysis, and proper risk management.
Candlestick analysis
Multi-TF CandlesMulti-Timeframe Support
Displays up to 6 different timeframes simultaneously
Configurable HTFs (default: 5m, 15m, 60m, 240m, 1D, 1W)
Customizable display limits (1-6 sets)
Visual Elements
Candlesticks: Full OHLC representation with customizable colors
Body & Wicks: Separate coloring for bullish/bearish candles
Fair Value Gaps (FVG): Automatically detects and highlights imbalance areas
Volume Imbalances: Identifies and marks volume-based imbalances
Day of Week Labels: Shows trading days for daily candles
Customization Options
Styling
Bullish/Bearish body colors with transparency
Border and wick colors
Candle width and spacing
Padding from current price
Labels & Information
HTF timeframe labels
Remaining time until candle close
Price tracing lines (Open, High, Low, Close)
Custom alignment options (Align/Follow Candles)
Advanced Features
Custom Daily Open Times: Midnight, 8:30, or 9:30 AM NY time
Trace Lines: Visual lines connecting HTF levels to current price
Imbalance Detection: Automatic FVG and volume imbalance detection
Real-time Updates: Live countdown to candle completion
Technical Details
Version: Pine Script v6
Overlay: Yes (displays directly on price chart)
Max Elements: 500 boxes, lines, labels each
Max Bars Back: 5000
Usage Benefits
Market Context: See multiple timeframes at once for better decision-making
Key Level Identification: Spot important support/resistance from HTFs
Pattern Recognition: Identify trends and reversals across timeframes
Efficiency: No need to switch between different chart timeframes
Customizable: Extensive settings to match your trading style
Ideal For
Swing traders analyzing multiple timeframes
Day traders wanting broader market context
Technical analysts identifying key levels
Anyone practicing multi-timeframe analysis
MultiTF break lines (1H / 15M / 5M / 1M) - with tableThis indicator detects high and low breakouts on the most recent candlesticks on the 1-hour, 15-minute, 5-minute, and 1-minute timeframes.
It automatically draws breakout lines on the chart.
The breakout direction is displayed as an arrow label (⇧/⇩).
The most recent breakout direction is displayed in a table (top right).
This is a multi-timeframe breakout monitoring tool.
Upward breakouts are visually distinguishable by blue, and downward breakouts by red.
M Killzones[by vetrivel]Cool free style Session indicator, Inspired by TJR trader session times and it's easily changeable. Really this session times changes everything. Basic requirement to use this Discipline and Mindset
FVG Diamond📊 Overview
FVG Diamond is an advanced indicator that detects three specific price action patterns: Inside Bar, Outside Bar, and Diamond Formation. Unlike basic FVG tools, it focuses on these higher-level setups for more precise analysis.
✨ Key Features
🎯 Detection of 3 Advanced FVG Pattern Types
Independent on/off toggle for each pattern
Inside FVG (Inside Bar / Harami): The body of the 3rd candle forms an inside bar relative to the 2nd candle
Outside FVG (Outside Bar / Engulfing): The body of the 1st candle forms an outside bar relative to the 2nd candle
Diamond FVG (Diamond Formation): A unique pattern that satisfies both Inside and Outside conditions
🎯 Mitigation Feature
ON: FVG boxes are automatically removed once price fully fills the FVG zone (keeps the chart clean by showing only active FVGs)
OFF: FVG boxes remain on the chart indefinitely (allows full historical review of all FVGs)
🎨 Visual Features
Color Coding: Assign unique colors to each pattern type
Transparency Control: Default 70% transparency for optimal readability
Extension Display: Extend the right edge of FVG boxes for any number of bars
⚙️ Advanced Configuration
Threshold Settings
Manual Threshold: Define a minimum gap size by percentage
Auto Threshold: Dynamically adjusts based on market volatility
Mitigation Tools
Real-Time Mitigation: Automatic removal when price fills an FVG zone
Mitigation Levels: Display filled FVG levels with dashed lines
🔔 Alerts
Notification on new Bullish/Bearish FVG detection
Notification when an FVG is mitigated (filled)
Works with all FVG types
📈 How to Use
Add the indicator to your chart
The three advanced FVG patterns will be detected and displayed automatically
Set your preferred threshold (0% = detect all gaps)
⚠️ Note: This indicator is designed as an analysis support tool. Trading decisions should be made in combination with other methods of technical and fundamental analysis.
Author: omochi_
Version: 1.0
Last Updated: September 28, 2025
CRT Theory — CRT Candle + Phases (configurable)CRT Candles with All Phases-Accumulation, Manipulation and Distribution
HTF Control Shift CandlesHTF Control Shift Candles highlights reversal-type candles that show a decisive shift in market control between buyers and sellers. These candles are detected by measuring wick length relative to the entire range and the close’s position within that range. A bullish control shift occurs when a candle forms with a long lower wick and closes in the top portion of its range, showing strong rejection of lower prices and a buyer takeover. A bearish control shift occurs when a candle forms with a long upper wick and closes in the bottom portion of its range, showing rejection of higher prices and a seller takeover. Candles are automatically recolored for fast visual recognition, and alerts are built in so traders never miss a potential shift in control.
This tool is specifically designed for 30-minute and higher timeframes, where control shift candles carry greater significance for swing and intraday setups. Inputs allow you to adjust wick percentage (wickPct) and body percentage (bodyPct) thresholds for different levels of sensitivity. For example, with wickPct = 0.5 and bodyPct = 0.3, a bullish control shift requires the lower wick to be at least 50% of the entire range and the close to finish in the top 30%. By tuning these values, traders can refine the detection for different volatility regimes or personal trading strategies.
Bar Close Confirmation Only
This indicator confirms signals only after the candle has closed. The calculation requires final values for open, high, low, and close, which are not fixed until the bar finishes forming. That means no mid-bar or intrabar repainting — alerts and highlights trigger only once the bar is complete. For example, if a candle temporarily has a long lower wick but closes back in the middle of its range, it will not be marked as a bullish control shift. This ensures accuracy by waiting for the final candle close before confirming that buyers or sellers truly maintained control.
Control shift candles can be especially useful around liquidity sweeps, support/resistance zones, or after extended moves, as they often mark key turning points. A bullish control shift near demand may provide an early entry confirmation for longs, while a bearish control shift at supply may signal short opportunities or exits from longs. This makes the indicator a versatile tool for anticipating reversals, timing entries with precision, and filtering signals on higher timeframes where market structure shifts are most impactful.
Smart Session Levels - Step 1 (NY Prep Lines)this indicator shows 3 vertical lines at 18:00, 00:00, 06:00 . For easier way to see Asian high Asian low London high and London low levels for preparation before trading at New York session.
Elliott Wave Auto + Fib Targets + Scalper Strategy (Fixed)// Elliott Wave Auto + Fib Targets + Scalper Strategy
//
// Fixed by expert trader:
// - Replaced table with label-based visualization to avoid 'Column 2 is out of table bounds' error.
// - Uses label.new to display buy/sell signal counts in top-right corner, mimicking table layout.
// - Fixed array.sum() error: Replaced invalid range-based array.sum() with custom sum_array_range() function.
// - Removed barstate usage to fix 'Undeclared identifier barstate' error.
// - Replaced barstate.isconfirmed with true (process every bar).
// - Replaced barstate.isfirstconfirmed with bar_index == 0 (first bar).
// - Replaced strategy.alert with label.new for long/short entry signals (buy/sell markers).
// - Fixed array index out-of-bounds: Protected array.get() calls with size checks.
// - Fixed pyramiding: Set constant pyramiding=4 (max 5 entries); use allow_pyramiding to limit entries.
// - Fixed default_qty_value: Set constant default_qty_value=100.0; use entry_size_pct to scale qty.
// - Replaced alertcondition with labels for Elliott Wave patterns.
// - Fixed partial exits: 50% at TP1 with fixed SL, 50% at TP2 with fixed SL or trailing.
// - Fixed Elliott Wave pivot indexing for alternating H/L check.
// - Ensured proper position sizing and exit logic.
Buyer/Seller DominanceBuyer/Seller Dominance Indicator
The Buyer/Seller Dominance indicator is a sophisticated market analysis tool that combines Market Profile methodology with volume analysis to identify which side of the market is in control. It analyzes price distribution across a higher timeframe by calculating the Point of Control (POC) and Value Area, then evaluates where the current price sits relative to these key levels. The indicator processes Time Price Opportunity (TPO) data across 20 price channels to build a comprehensive volume profile of each trading session.
The dominance score is calculated using multiple factors including price position relative to POC, Value Area boundaries, volume imbalance between upper and lower profile sections, price momentum, and volume trends. This multi-factor approach provides a robust measure of market sentiment, smoothed using an EMA to filter out noise. The resulting dominance histogram visually represents whether buyers (positive values) or sellers (negative values) are controlling the market.
The indicator generates clear buy and sell signals when dominance crosses key threshold levels, with additional visual aids including background coloring to show market state (buyer/seller/neutral), overbought/oversold levels at ±50, and an information table displaying current market conditions. It's fully customizable with adjustable timeframes, sensitivity settings, Value Area percentages, and color schemes to suit different trading styles and preferences.RetryClaude can make mistakes. Please double-check responses.
FVG + FIBONACCIThe FVG + FIBONACCI indicator is a sophisticated trading tool that combines Fair Value Gap (FVG) detection with Fibonacci analysis across multiple timeframes. It automatically identifies bullish and bearish Fair Value Gaps - price areas where there is no overlap between consecutive candles, creating "gaps" that often act as significant support and resistance zones. The indicator works on any selected higher timeframe while displaying results on the current chart, making it versatile for various trading strategies and timeframe analyses.
What sets this indicator apart is its integration of Fibonacci retracement levels within each detected FVG zone. Once a Fair Value Gap is identified, the indicator automatically draws key Fibonacci levels (23.6%, 38.2%, 50%, 61.8%, and optionally 78.6%) within the gap, providing precise entry and exit points for traders. Additionally, it offers Fibonacci extensions (127.2%, 161.8%, and 261.8%) that project potential price targets beyond the FVG boundaries, helping traders plan their profit-taking strategies more effectively.
The indicator includes comprehensive customization options, allowing users to control the appearance of FVG zones, Fibonacci levels, and extension lines with different colors and styles. It features intelligent zone management with configurable maximum counts and extension lengths, automatic validity checking that grays out filled gaps, and multiple alert conditions for when price enters FVG zones or touches Fibonacci levels. The tool is designed for both swing and intraday traders who want to combine the powerful concepts of Fair Value Gaps with precise Fibonacci-based entry and exit strategies.
CME Gap Finder - BTC (Adjustable TF)This is a CME Futures gap finder that has a variable timeframe. Great for finding long term trades or short term depending on the time frame. 1hr chart to 3 hr gaps. 4 hr chart to 3 day on gaps.
Shamji's Liquidity Sweep + FVG (Follow-up + Filters) Purpose (what it does)
This indicator looks for two related price structures used by many smart-money / liquidity-hunt traders:
Liquidity Sweeps — candles that wick beyond a recent swing high (for buy-side stop-hunts) or swing low (for sell-side stop-hunts), then close back inside. These are flagged as potential stop-hunt events that clear obvious liquidity.
Fair Value Gaps (FVGs) — simple 3-bar style gaps where an older bar’s high is below the current low (bullish FVG) or an older bar’s low is above the current high (bearish FVG). When an FVG appears after a sweep (within a configurable window), this is considered a follow-up alignment.
The script adds optional filters (volume spike and candle-range vs ATR) to increase confidence, and can restrict marking/alerts to only events that meet the follow-up and filter rules.
FVG (Fair Value Gaps)The FVG (Fair Value Gaps) indicator is a sophisticated technical analysis tool designed to identify and display fair value gaps on trading charts across multiple timeframes. Fair value gaps represent price inefficiencies that occur when there's a complete separation between consecutive candles, creating an unfilled price zone. The indicator detects these gaps by analyzing three consecutive candles: it identifies bullish FVGs when a green middle candle creates a gap where the high of the left candle is below the low of the right candle, and bearish FVGs when a red middle candle creates a gap where the low of the left candle is above the high of the right candle.
The indicator offers comprehensive customization options and intelligent filtering capabilities. Users can select any higher timeframe for FVG detection while viewing on lower timeframes, choose to display only bullish or bearish gaps, and optionally filter for large candles only to focus on more significant market inefficiencies. The system includes automatic management features such as limiting the maximum number of displayed FVGs to prevent chart clutter, customizable extension lengths for forward projection, and a validation system that continuously monitors whether gaps remain unfilled or have been invalidated by subsequent price action.
Visually, the indicator represents FVGs as colored rectangular boxes with dashed border lines, using green for bullish gaps and red for bearish gaps with full transparency control. When FVGs become invalid (filled by price), they automatically change to gray coloring to indicate their status. The indicator includes real-time alert functionality that triggers when price enters or touches FVG zones, making it valuable for both manual trading decisions and automated trading strategies. Additionally, it features a built-in Telegram channel reference for community support and educational resources.
ATR SPREADThis is a comprehensive ATR SPREAD indicator for TradingView that combines volatility monitoring with spread analysis. Here's what it does and why it's useful:
Core Functionality
ATR Progress Tracking:
Monitors how much of the daily ATR (Average True Range) has been "consumed" during the current trading day
Calculates progress from two reference points: day's open and previous day's close
Displays progress as percentages or absolute values
Provides color-coded visual feedback (green → yellow → orange → red) based on ATR consumption levels
Spread Monitoring with Advanced Filtering:
Tracks current market spreads using multiple methods (minute high-low ranges, tick-to-tick differences)
Calculates rolling average spread to establish baseline conditions
Implements sophisticated filtering to exclude anomalous spread readings that could skew analysis
Key Features
Smart Filtering System:
Automatically filters out abnormal spreads during session opens
Excludes spreads that are too large relative to price or ATR
Removes outliers that exceed normal spread multiples
Maintains data quality for accurate analysis
Multi-Level Alert System:
ATR threshold alerts (50%, 80%, 100% consumption)
Customizable warning threshold (default 70%)
Spread expansion warnings and alerts
Session start notifications
Professional Dashboard:
Customizable information panel showing real-time metrics
Multiple positioning options and visual themes
Displays ATR status, progress percentages, current/average spreads
Color-coded status indicators for quick assessment
Trading Applications
Risk Management:
Helps traders understand how much daily volatility has been used up
Assists in position sizing based on remaining expected movement
Identifies periods of unusual market conditions
Market Condition Assessment:
Monitors liquidity conditions through spread analysis
Detects when spreads widen beyond normal levels
Filters out unreliable data during volatile periods
Entry/Exit Timing:
High ATR consumption may suggest limited further movement
Low ATR consumption early in the day might indicate potential for larger moves
Spread conditions help assess execution quality expectations
This indicator is particularly valuable for intraday traders, scalpers, and anyone who needs to monitor market microstructure conditions alongside volatility metrics. It provides a comprehensive view of both price movement potential (ATR) and execution environment quality (spreads) in a single, professional-grade tool.
FVGFVG (Fair Value Gap) Indicator
The Fair Value Gap (FVG) indicator is a powerful tool designed to identify price imbalance zones that often act as critical support and resistance levels in the market. An FVG occurs when there is a gap between the high of one candle and the low of another candle two periods away, creating an unfilled price area that the market tends to revisit. These zones represent areas where institutional orders may be waiting and can provide high-probability trading opportunities.
This indicator automatically detects both bullish and bearish FVGs across any selected timeframe while ensuring complete reliability with no repainting. It uses only confirmed bar data with lookahead protection, making it suitable for live trading and backtesting. The tool features customizable visual elements including zone colors, transparency levels, and timeframe labels, along with automatic mitigation tracking that monitors when FVGs get filled by price action.
Key features include multi-timeframe analysis, extending zones to the right for ongoing relevance, flexible display options for both active and mitigated FVGs, and built-in alert system for new FVG formations. The indicator also provides comprehensive labeling options and maintains a clean chart by automatically managing the maximum number of displayed zones, making it an essential tool for traders following smart money concepts and institutional trading strategies.
Breaout and followthroughThis indicator is designed to identify and highlight a single, powerful entry signal at the beginning of a new trend. It filters for high-volatility breakout bars that show strong directional conviction, helping traders catch the initial momentum of a potential move. It will only paint one bullish or bearish signal after a trend change is detected, preventing repeat signals during a sustained move.
Core Concept
The indicator combines four key concepts to generate high-probability signals:
Trend Direction: It first establishes the overall trend (bullish or bearish) using a configurable Exponential or Simple Moving Average (EMA/SMA).
Volatility Expansion: It looks for bars with a larger-than-average range by comparing the bar's size to the Average True Range (ATR). This helps identify moments of increased market interest.
Closing Strength (IBS): It uses the Internal Bar Strength (IBS) to measure directional conviction. A high IBS (closing near the top) suggests bullish strength, while a low IBS (closing near the bottom) suggests bearish pressure.
Breakout Confirmation: As an optional but powerful filter, it can confirm the signal by ensuring the bar is breaking above the high or below the low of a user-defined number of previous bars.
A signal is only generated on the first bar that meets all these criteria after the price crosses the trend-defining moving average, making it ideal for capturing the start of a new swing.
Features
Bullish Signals (Green): Highlights the first bar in an uptrend that is larger than the ATR, closes with a high IBS (>70), and optionally breaks out above the recent highs.
Bearish Signals (Red): Highlights the first bar in a downtrend that is larger than the ATR, closes with a low IBS (<30), and optionally breaks out below the recent lows.
"First Signal Only" Logic: The script is hard-coded to show only the initial signal in a new trend, filtering out noise and redundant signals.
Fully Customizable Trend Filter:
Choose between EMA or SMA for trend definition.
Set the MA length (default is a short-term 7-period MA).
Option to show or hide the moving average on the chart.
Optional Breakout Filter:
Enable or disable the requirement for the signal bar to break the high/low of previous bars.
Customize the lookback period for the breakout confirmation.
How to Use
This indicator can be used as a primary signal for a trend-following or momentum-based trading system.
Look for a Green Bar (Bullish Signal): This suggests the start of a potential uptrend. Consider it a signal for a long entry. A logical stop-loss could be placed below the low of the highlighted signal bar.
Look for a Red Bar (Bearish Signal): This suggests the start of a potential downtrend. Consider it a signal for a short entry. A logical stop-loss could be placed above the high of the highlighted signal bar.
Adjust Settings: Use the settings menu to configure the indicator to your preferred market and timeframe. A longer Trend MA Length will result in fewer, more long-term signals, while a shorter length will be more responsive.
As with any tool, this indicator is best used in conjunction with other forms of analysis, such as market structure, support/resistance levels, and proper risk management.
IMB zones, alerts, 8 EMAs, DO lvlThis indicator was created to be a combined indicator for those who use DO levels, IMBs, and EMAs in their daily trading, helping them by providing a script that allows them to customize these indicators to their liking.
Here you can set the IMBs, DO levels, and EMAs. Its special feature is that it uses alerts to indicate which IMB zones have been created, along with the invalidation line for the new potential IMB.
The program always calculates the Daily Opening (DO) level from the opening of the broker, and you can set how many hours the line should be drawn.
Help for use:
There are 3 types of alerts:
- Use the "Bullish IMB formed" alert if you are looking for Bull IMBs.
- Use the "Bearish IMB formed" alert if you are looking for Bear IMBs.
- Use the "Either IMB" alert if you are looking for Bull and Bear IMBs.
Tip: Set the alert type "Once per bar close" if you do not want to set new alerts after an IMB is formed.
IMBs:
- Customizable IMB quantity (1-500 pcs)
- Zone colors and borders can be customized
- Potential IMB line can be customized
EMAs:
- You can set and customize 8 EMA lengths
- Only the current and higher timeframe EMAs are displayed
Daily Open Level:
- Displays today's Daily Open level
- Note: The DO level does not work in Replay mode
Last OFR:
"Show True OFR" checkbox added.
It displays the latest OFR, and hides the old ones.
Señales de Compra/Venta - KUSKUS + MACD AlgoAlphaseñales de compra/venta con base en la alineación de dos indicadores
ARGT Possible entry and exit points:This is just an observation, and not any type of financial advice.
]To identify key entry and exit points. In addition, this is based on YTD and yearly charts. This is a work in progress.
RSI DivergenceStrat WCredit to faytterro. Buy when RSI is staying flat or going up while the ticker price is going down. Sell when RSI is staying flat or going down while the ticker price is going up.
Trend Speed Analyzer + alerts//@version=6
indicator('Trend Speed Analyzer + alerts', overlay = false)
//~~}
// ~~ Tooltips {
string t1 = 'Maximum Length: This parameter sets the upper limit for the number of bars considered in the dynamic moving average. A higher value smooths out the trend line, making it less reactive to minor fluctuations but slower to adapt to sudden price movements. Use higher values for long-term trend analysis and lower values for faster-moving markets.'
string t2 = 'Accelerator Multiplier: Adjusts the responsiveness of the dynamic moving average to price changes. A larger value makes the trend more reactive but can introduce noise in choppy markets. Lower values create a smoother trend but may lag behind rapid price movements. This is particularly useful in volatile markets where precise sensitivity is needed.'
string t5 = 'Enable Candles: When enabled, the candlesticks on the chart will be color-coded based on the calculated trend speed. This provides a visual representation of momentum, making it easier to spot shifts in market dynamics. Disable this if you prefer the standard candlestick colors.'
string t6 = 'Collection Period: Defines the number of bars used to normalize trend speed values. A higher value includes a broader historical range, smoothing out the speed calculation. Lower values make the speed analysis more sensitive to recent price changes, ideal for short-term trading.'
string t7 = 'Enable Table: Activates a statistical table that provides an overview of key metrics, such as average wave height, maximum wave height, dominance, and wave ratios. Useful for traders who want numerical insights to complement visual trend analysis.'
string t8 = 'Lookback Period: Determines how many historical bars are used for calculating bullish and bearish wave data. A longer lookback period provides a more comprehensive view of market trends but may dilute sensitivity to recent market conditions. Shorter periods focus on recent data.'
string t9 = 'Start Date: Sets the starting point for all calculations. This allows you to analyze data only from a specific date onward, which is useful for isolating trends within a certain period or avoiding historical noise.'
string t10 = 'Timer Option: Select between using a custom start date or starting from the first available bar on the chart. The \'Custom\' option works with the Start Date setting, while \'From start\' includes all available data.'
// Tooltips for Table Cells
string tt1 = 'Average Wave: Shows the average size of bullish or bearish waves during the lookback period. Use this to assess overall market strength. Larger values indicate stronger trends, and comparing bullish vs bearish averages can reveal market bias. For instance, a higher bullish average suggests a stronger uptrend.'
string tt2 = 'Max Wave: Displays the largest bullish or bearish wave during the lookback period. Use this to identify peak market momentum. A significantly higher bullish or bearish max wave indicates where the market may have shown extreme trend strength in that direction.'
string tt3 = 'Current Wave Ratio (Average): Compares the current wave\'s size to the average wave size for both bullish and bearish trends. A value above 1 indicates the current wave is stronger than the historical average, which may signal increased market momentum. Use this to evaluate if the current move is significant compared to past trends.'
string tt4 = 'Current Wave Ratio (Max): Compares the current wave\'s size to the maximum wave size for both bullish and bearish trends. A value above 1 suggests the current wave is setting new highs in strength, which could indicate a breakout or strong momentum in the trend direction.'
string tt5 = 'Dominance (Average): The net difference between the average bullish and bearish wave sizes. Positive values suggest bullish dominance over time, while negative values indicate bearish dominance. Use this to determine which side (bulls or bears) has had consistent control of the market over the lookback period.'
string tt6 = 'Dominance (Max): The net difference between the largest bullish and bearish wave sizes. Positive values suggest bulls have dominated with stronger individual waves, while negative values indicate bears have produced stronger waves. Use this to gauge the most significant power shifts in the market.'
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
max_length = input.int(50, minval = 1, title = 'Maximum Length', group = 'Dynamic Moving Average', tooltip = t1)
accel_multiplier = input.float(5.0, minval = 0.0, step = 1.1, title = 'Accelerator Multiplier', group = 'Dynamic Moving Average', tooltip = t2)
tbl_ = input.bool(true, title = 'Enable Table', group = 'Wave Analysis', tooltip = t7)
lookback_period = input.int(100, minval = 1, step = 1, title = 'Lookback Period', group = 'Wave Analysis', tooltip = t8)
candle = input.bool(true, title = 'Enable Candles', group = 'Trend Visualization', tooltip = t5)
collen = input.int(100, step = 10, minval = 5, title = 'Collection Period', group = 'Trend Visualization', tooltip = t6)
up_col = input.color(color.lime, title = 'Dynamic Trend', group = 'Trend Visualization', inline = 'Trend')
dn_col = input.color(color.red, title = '', group = 'Trend Visualization', inline = 'Trend')
up_hist_col = input.color(#82ffc3, title = 'Trend Speed Up', group = 'Trend Visualization', inline = 'up')
up_hist_col_ = input.color(color.lime, title = '', group = 'Trend Visualization', inline = 'up')
dn_hist_col = input.color(color.red, title = 'Trend Speed Dn', group = 'Trend Visualization', inline = 'dn')
dn_hist_col_ = input.color(#f78c8c, title = '', group = 'Trend Visualization', inline = 'dn')
start = input.time(timestamp('1 Jan 2020 00:00 +0000'), title = 'Start Date', group = 'Time Settings', tooltip = t9, inline = 'startdate')
timer = input.string('From start', title = 'Timer Option', options = , group = 'Time Settings', tooltip = t10, inline = 'startdate')
// ~~ Dynamic Average {
counts_diff = close
max_abs_counts_diff = ta.highest(math.abs(counts_diff), 200)
counts_diff_norm = (counts_diff + max_abs_counts_diff) / (2 * max_abs_counts_diff)
dyn_length = 5 + counts_diff_norm * (max_length - 5)
// ~~ Function to compute the accelerator factor with normalization of delta_counts_diff {
calc_accel_factor(float counts_diff, float prev_counts_diff) =>
delta_counts_diff = math.abs(counts_diff - prev_counts_diff)
float max_delta_counts_diff = ta.highest(delta_counts_diff, 200)
max_delta_counts_diff := max_delta_counts_diff == 0 ? 1 : max_delta_counts_diff
float accel_factor = delta_counts_diff / max_delta_counts_diff
accel_factor
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Function to adjust alpha using the accelerator factor {
adjust_alpha(float dyn_length, float accel_factor, float accel_multiplier) =>
alpha_base = 2 / (dyn_length + 1)
alpha = alpha_base * (1 + accel_factor * accel_multiplier)
alpha := math.min(1, alpha)
alpha
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Accelerator Factor
accel_factor = calc_accel_factor(counts_diff, nz(counts_diff ))
alpha = adjust_alpha(dyn_length, accel_factor, accel_multiplier)
// ~~ Compute dynamic Ema
var float dyn_ema = na
dyn_ema := na(dyn_ema ) ? close : alpha * close + (1 - alpha) * dyn_ema
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Trend Speed {
trend = dyn_ema
bullsrc = close
bearsrc = close
type TrendData
array change
array t
StartTime() =>
time > start
var bullish = TrendData.new(array.new(), array.new())
var bearish = TrendData.new(array.new(), array.new())
var x1 = int(na)
var y1 = float(na)
var pos = 0
var speed = 0.0
c = ta.rma(close, 10)
o = ta.rma(open, 10)
// ~~ First value {
if na(x1) and StartTime() or na(x1) and timer == 'From start'
x1 := bar_index
y1 := o
y1
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Trend direction {
if StartTime() or timer == 'From start'
if bullsrc > trend and bullsrc <= trend
bearish.change.unshift(ta.lowest(speed, bar_index - x1))
bearish.t.unshift(bar_index - x1)
x1 := bar_index
y1 := bullsrc
pos := 1
speed := c - o
speed
if bearsrc < trend and bearsrc >= trend
bullish.change.unshift(ta.highest(speed, bar_index - x1))
bullish.t.unshift(bar_index - x1)
x1 := bar_index
y1 := bearsrc
pos := -1
speed := c - o
speed
speed := speed + c - o
speedGradient = color.from_gradient(speed, ta.min(-speed / 3), ta.max(speed / 3), color.red, color.lime)
trendspeed = ta.hma(speed, 5)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Plots {
rma_dyn_ema(x, p) =>
average = ta.rma(dyn_ema , p)
average
colour = ta.wma(close, 2) > dyn_ema ? up_col : dn_col
fillColor = rma_dyn_ema(0, 5) > rma_dyn_ema(1, 5) ? color.new(up_col, 70) : color.new(dn_col, 70)
p1 = plot(dyn_ema, color = colour, linewidth = 2, title = 'Dynamic Trend', force_overlay = true)
p2 = plot(ta.rma(hl2, 50), display = display.none, editable = false, force_overlay = true)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
min_speed = ta.lowest(speed, collen)
max_speed = ta.highest(speed, collen)
normalized_speed = (speed - min_speed) / (max_speed - min_speed)
speedGradient1 = speed < 0 ? color.from_gradient(normalized_speed, 0.0, 0.5, dn_hist_col, dn_hist_col_) : color.from_gradient(normalized_speed, 0.5, 1.0, up_hist_col, up_hist_col_)
plot(StartTime() or timer == 'From start' ? trendspeed : na, title = 'Trend Speed', color = speedGradient1, style = plot.style_columns)
plotcandle(open, high, low, close, color = candle ? speedGradient1 : na, wickcolor = candle ? speedGradient1 : na, bordercolor = candle ? speedGradient1 : na, force_overlay = true)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Table {
if barstate.islast and tbl_
bullish_recent = bullish.change.slice(0, math.min(lookback_period, bullish.change.size()))
bearish_recent = bearish.change.slice(0, math.min(lookback_period, bearish.change.size()))
bull_max = bullish_recent.max()
bear_max = bearish_recent.min()
bull_avg = bullish_recent.avg()
bear_avg = bearish_recent.avg()
wave_size_ratio_avg = bull_avg / math.abs(bear_avg)
wave_size_text_avg = str.tostring(math.round(wave_size_ratio_avg, 2)) + 'x'
wave_size_color_avg = wave_size_ratio_avg > 0 ? color.lime : color.red
wave_size_ratio_max = bull_max / math.abs(bear_max)
wave_size_text_max = str.tostring(math.round(wave_size_ratio_max, 2)) + 'x'
wave_size_color_max = wave_size_ratio_max > 0 ? color.lime : color.red
dominance_avg_value = bull_avg - math.abs(bear_avg)
dominance_avg_text = dominance_avg_value > 0 ? 'Bullish +' + str.tostring(math.round(wave_size_ratio_avg, 2)) + 'x' : 'Bearish -' + str.tostring(math.round(1 / wave_size_ratio_avg, 2)) + 'x'
dominance_avg_color = dominance_avg_value > 0 ? color.lime : color.red
dominance_max_value = bull_max - math.abs(bear_max)
dominance_max_text = dominance_max_value > 0 ? 'Bullish +' + str.tostring(math.round(wave_size_ratio_max, 2)) + 'x' : 'Bearish -' + str.tostring(math.round(1 / wave_size_ratio_max, 2)) + 'x'
dominance_max_color = dominance_max_value > 0 ? color.lime : color.red
current_wave = speed
current_wave_color = current_wave > 0 ? color.lime : color.red
current_ratio_avg = current_wave > 0 ? current_wave / bull_avg : current_wave / math.abs(bear_avg)
current_ratio_max = current_wave > 0 ? current_wave / bull_max : current_wave / math.abs(bear_max)
current_text_avg = str.tostring(math.round(current_ratio_avg, 2)) + 'x'
current_text_max = str.tostring(math.round(current_ratio_max, 2)) + 'x'
current_color_avg = current_ratio_avg > 0 ? color.lime : color.red
current_color_max = current_ratio_max > 0 ? color.lime : color.red
var tbl = table.new(position.top_right, 3, 3, force_overlay = true)
table.cell(tbl, 0, 0, '', text_color = chart.fg_color, tooltip = '')
table.cell(tbl, 0, 1, 'Average Wave', text_color = chart.fg_color, tooltip = tt1)
table.cell(tbl, 0, 2, 'Max Wave', text_color = chart.fg_color, tooltip = tt2)
table.cell(tbl, 1, 0, 'Current Wave Ratio', text_color = chart.fg_color, tooltip = '')
table.cell(tbl, 1, 1, current_text_avg, text_color = current_color_avg, tooltip = tt3)
table.cell(tbl, 1, 2, current_text_max, text_color = current_color_max, tooltip = tt4)
table.cell(tbl, 2, 0, 'Dominance', text_color = chart.fg_color, tooltip = '')
table.cell(tbl, 2, 1, dominance_avg_text, text_color = dominance_avg_color, tooltip = tt5)
table.cell(tbl, 2, 2, dominance_max_text, text_color = dominance_max_color, tooltip = tt6)
// ─────────────────────────────────────────────────────────────
// MTF BUY/SELL alerts: 10m & 1H agreement (no logic changes)
isGreen = ta.wma(close, 2) > dyn_ema
tf_fast = input.timeframe("10", "Fast TF (Buy/Sell check)", group = "MTF Alerts")
tf_slow = input.timeframe("60", "Slow TF (Buy/Sell check)", group = "MTF Alerts")
confirm_on_close = input.bool(true, "Confirm on bar close", group = "MTF Alerts")
green_fast = request.security(syminfo.tickerid, tf_fast, isGreen, lookahead = barmerge.lookahead_off)
green_slow = request.security(syminfo.tickerid, tf_slow, isGreen, lookahead = barmerge.lookahead_off)
buyCond = green_fast and green_slow
sellCond = not green_fast and not green_slow
triggerOK = confirm_on_close ? barstate.isconfirmed : true
// Single BUY / SELL alerts (messages unchanged)
alertcondition(buyCond and triggerOK, title = "MTF BUY (10m & 1H GREEN)", message = "{{ticker}} | TF={{interval}} | Dynamic line")
alertcondition(sellCond and triggerOK, title = "MTF SELL (10m & 1H RED)", message = "{{ticker}} | TF={{interval}} | Dynamic line")
// ─────────────────────────────────────────────────────────────
// NEW: 10m status repeated EVERY MINUTE (no logic changes)
// ─────────────────────────────────────────────────────────────
// 1-minute pulse: true once per closed 1m bar
m1_pulse = request.security(syminfo.tickerid, "1", barstate.isconfirmed, lookahead = barmerge.lookahead_off)
// Repeat ONLY the 10-minute status every minute
status10_green = green_fast
status10_red = not green_fast
alertcondition(status10_green and m1_pulse, title = "10m Status GREEN — repeat each minute", message = "{{ticker}} | TF=10 | Dynamic line — GREEN")
alertcondition(status10_red and m1_pulse, title = "10m Status RED — repeat each minute", message = "{{ticker}} | TF=10 | Dynamic line — RED")
how do the trend speed anlaysis work
Multi-Timeframe Dual MA Downside DetectorThis indicator is designed to highlight potential downside moves using two customizable moving averages (MA1 and MA2) across multiple timeframes. It works on any chart and provides a visual cue when the price is trading below both selected moving averages on a red/down candle.
Key Features:
Dual Moving Averages: Supports EMA, SMA, VWMA, and HMA for both MA1 and MA2.
Multi-Timeframe Support: Each moving average can be calculated on a different timeframe, allowing higher timeframe trend context on lower timeframe charts.
Downside Detection: Highlights candles where the close is below both moving averages and forms a down candle (close < open).
Visual Signals:
Plots MA1 (orange) and MA2 (blue) on the chart.
Colors the downside candles blue when the price is below both MAs.
Customizable: Easily adjust the MA type, length, and timeframe to suit your trading style.
Usage:
Helps identify strong bearish conditions or potential pullbacks.
Can be combined with other technical analysis tools for trend confirmation.
Works across any market, instrument, or timeframe