OBV-ROC Tilson Trend (Delta Toggle)IT Tracks Change between one fast OBV and One Slow OBV. Best for trend cfolowing.
อินดิเคเตอร์และกลยุทธ์
Adaptive Squeeze Momentum +OVERVIEW
Adaptive Squeeze Momentum+ is an enhanced, auto-adaptive momentum indicator inspired by the classic Squeeze Momentum concept. This script dynamically adjusts its parameters to any timeframe without requiring manual inputs, making it a versatile tool for intraday traders and long-term investors alike.
CONCEPTS
The indicator combines Bollinger Bands (BB) and Keltner Channels (KC) to identify volatility compression ("squeeze") and expansion phases. When BB contracts within KC, a squeeze is detected, signaling reduced volatility and potential for a breakout. Additionally, a linear regression momentum calculation helps assess the strength and direction of price moves.
FEATURES
Auto-Adaptation:
Automatically adjusts BB/KC lengths and multipliers based on the chart timeframe (from 1 minute to 1 month).
Dynamic Squeeze Detection:
Clear visual encoding of squeeze status:
- Gray cross: neutral
- Blue cross: squeeze active
- Yellow cross: squeeze released
Momentum Histogram:
Colored area chart shows positive and negative momentum with slope-based coloring.
Clean Visualization:
Minimalist plots focused on actionable signals.
USAGE
Identify Squeeze Phases:
When the blue cross appears, the market is in a volatility squeeze, potentially preceding a breakout.
Monitor Momentum Direction:
The area plot shows the magnitude and direction of price momentum.
Confirm Entries and Exits:
Combine squeeze releases (yellow) with positive momentum for potential long entries or negative momentum for shorts.
Adaptable to Any Market:
Works seamlessly across cryptocurrencies, stocks, forex, and indices on all timeframes.
ROLLING-VWAP🔹 Session VWAP with Deviation Bands (±1σ, ±2σ, ±3σ)
This indicator plots a Volume-Weighted Average Price (VWAP) that resets daily, along with optional standard deviation bands (±1σ, ±2σ, ±3σ). It helps traders identify key dynamic support and resistance levels throughout the trading session.
Features:
Daily VWAP anchor resets at the start of each session.
Customizable standard deviation multiplier for precise volatility calibration.
Toggle visibility for ±1σ, ±2σ, and ±3σ bands independently.
Visual guidance for intraday trend strength, mean reversion, and volatility expansion.
Ideal For:
Intraday traders looking for mean-reversion or breakout opportunities.
Identifying overbought/oversold levels in real-time based on price's deviation from VWAP.
MACD Ignored Candle SignalsGBI AND RBI WITH MACD CONFIRMATION
Gives buy and sell signals based on a simple candlestick pattern that co-aligns with the macd momentum. earliest signals based on the trend are usually the best entries
Alligator Crossover AlertThe Alligator Indicator consists of:
Jaw (Blue line): 13-period Smoothed Moving Average, shifted by 8 bars
Teeth (Red line): 8-period Smoothed Moving Average, shifted by 5 bars
Lips (Green line): 5-period Smoothed Moving Average, shifted by 3 bars
A crossing of these lines can signal:
Start of a new trend (when lines fan out in order)
Consolidation or end of trend (when lines cross over each other) - The indicator is for visual representation of the crossovers
Gattsreal EMASummary
The Gattsreal EMA indicator is a complete technical analysis tool designed to provide a clear and immediate view of the market trend and momentum across multiple timeframes. It combines long-term Exponential Moving Averages (EMAs) with a short-term EMA "ribbon," allowing traders to quickly identify the direction of the main trend and the strength of short-term movements.
Indicator Components
The Gattsreal EMA is composed of two main elements, both fully customizable:
Long-Term EMAs (Thick Lines):
EMA 200 (White): Considered the definitive line between a bull market and a bear market. Prices above the 200 EMA are generally considered to be in a long-term uptrend.
EMA 50 (Blue): An important medium-term trend line, often used as a dynamic level of support or resistance.
Short-Term EMA Ribbon:
Consists of a set of 9 EMAs (periods 9, 10, 15, 20, 25, 30, 35, 40, and 45).
The "ribbon" expands when volatility increases and contracts when volatility decreases.
The color of the ribbon's fill changes to indicate short-term momentum:
Green: The ribbon is in an uptrend (fastest EMA above the slowest), suggesting buying pressure.
Red: The ribbon is in a downtrend (fastest EMA below the slowest), suggesting selling pressure.
How to Use the Indicator
The Gattsreal EMA can be used in various ways to enhance your analysis and decision-making:
Main Trend Identification: The price's position relative to the 200 and 50 EMAs helps define your operational bias. It is preferable to trade in the direction of the main trend.
Entry and Exit Signals: The crossing of the price through the EMA ribbon can be used as a signal. For example, when the price crosses and closes above the entire ribbon and it turns green, it can be a buy signal.
Momentum Confirmation: The color and expansion of the ribbon serve as excellent confirmation of the strength of a move. A green and expanding ribbon confirms strong bullish momentum.
Dynamic Support and Resistance: All 11 EMAs can act as dynamic levels of support (in an uptrend) or resistance (in a downtrend).
This indicator is a powerful tool for traders of all levels looking for a visual and effective way to analyze market trends.
Your trading time period background fillThis script allows you to add background highlights to charts during any regional trading session, customize your own trading time, and is precise and customizable yet simple and easy to use, making it more convenient to review transactions.
Support global mainstream time zones: The drop-down list includes 30 commonly used IANA time zones (default is Asia/Shanghai) (such as Asia/Shanghai, America/New_York, Europe/London, etc.), one-click switching, no need to manually calculate the time difference.
Fully localized time input: "Start hour/minute" and "End hour/minute" are filled in with the local time of the selected time zone. The end hour defaults to 23:00 and can be adjusted to 0-23 at will.
Accurate time difference splitting: The script internally splits the time zone offset into whole hours and remainder minutes (supports half-hour zones, such as UTC+5:30), and ensures that all parameters are integers when calling timestamp to avoid errors.
Dynamic background rendering: Each K-line is judged according to the UTC timestamp whether it falls within the set range. If it meets the time period, it will be marked with a semi-transparent green background, and it will return to its original state after crossing the time period, helping you to identify the opening, closing or active period of any market at a glance.
Wide range of scenarios: It can be used for time-sharing highlighting of all-weather varieties of foreign exchange and cryptocurrency, and can also be used in conjunction with backtesting and timing strategies to only send signals during the active period of the target market, greatly improving trading efficiency and strategy accuracy.
Just select the region and set the time, and the script will automatically complete all complex time zone conversions and drawing, allowing you to focus on the transaction itself.
AlphaTrend//@version=5
indicator('AlphaTrend', shorttitle='AT', overlay=true, format=format.price, precision=2, timeframe='')
coeff = input.float(1, 'Multiplier', step=0.1)
AP = input(14, 'Common Period')
ATR = ta.sma(ta.tr, AP)
src = input(close)
showsignalsk = input(title='Show Signals?', defval=true)
novolumedata = input(title='Change calculation (no volume data)?', defval=false)
upT = low - ATR * coeff
downT = high + ATR * coeff
AlphaTrend = 0.0
AlphaTrend := (novolumedata ? ta.rsi(src, AP) >= 50 : ta.mfi(hlc3, AP) >= 50) ? upT < nz(AlphaTrend ) ? nz(AlphaTrend ) : upT : downT > nz(AlphaTrend ) ? nz(AlphaTrend ) : downT
color1 = AlphaTrend > AlphaTrend ? #00E60F : AlphaTrend < AlphaTrend ? #80000B : AlphaTrend > AlphaTrend ? #00E60F : #80000B
k1 = plot(AlphaTrend, color=color.new(#0022FC, 0), linewidth=3)
k2 = plot(AlphaTrend , color=color.new(#FC0400, 0), linewidth=3)
fill(k1, k2, color=color1)
buySignalk = ta.crossover(AlphaTrend, AlphaTrend )
sellSignalk = ta.crossunder(AlphaTrend, AlphaTrend )
K1 = ta.barssince(buySignalk)
K2 = ta.barssince(sellSignalk)
O1 = ta.barssince(buySignalk )
O2 = ta.barssince(sellSignalk )
plotshape(buySignalk and showsignalsk and O1 > K2 ? AlphaTrend * 0.9999 : na, title='BUY', text='BUY', location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(#0022FC, 0), textcolor=color.new(color.white, 0))
plotshape(sellSignalk and showsignalsk and O2 > K1 ? AlphaTrend * 1.0001 : na, title='SELL', text='SELL', location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(color.maroon, 0), textcolor=color.new(color.white, 0))
alertcondition(buySignalk and O1 > K2, title='Potential BUY Alarm', message='BUY SIGNAL!')
alertcondition(sellSignalk and O2 > K1, title='Potential SELL Alarm', message='SELL SIGNAL!')
alertcondition(buySignalk and O1 > K2, title='Confirmed BUY Alarm', message='BUY SIGNAL APPROVED!')
alertcondition(sellSignalk and O2 > K1, title='Confirmed SELL Alarm', message='SELL SIGNAL APPROVED!')
alertcondition(ta.cross(close, AlphaTrend), title='Price Cross Alert', message='Price - AlphaTrend Crossing!')
alertcondition(ta.crossover(low, AlphaTrend), title='Candle CrossOver Alarm', message='LAST BAR is ABOVE ALPHATREND')
alertcondition(ta.crossunder(high, AlphaTrend), title='Candle CrossUnder Alarm', message='LAST BAR is BELOW ALPHATREND!')
alertcondition(ta.cross(close , AlphaTrend ), title='Price Cross Alert After Bar Close', message='Price - AlphaTrend Crossing!')
alertcondition(ta.crossover(low , AlphaTrend ), title='Candle CrossOver Alarm After Bar Close', message='LAST BAR is ABOVE ALPHATREND!')
alertcondition(ta.crossunder(high , AlphaTrend ), title='Candle CrossUnder Alarm After Bar Close', message='LAST BAR is BELOW ALPHATREND!')
EMA/DEMA_group_stdThis indicator is like its sister indicator in that it measures dispersion but instead of being cumulative it measures distance between moving averages in each group.
Group 1:11, 13, 18, 21
Group 2:18, 21, 29, 34
Group 3: 29, 34, 47, 55
Group 4: 47, 55, 76, 89
Group 5: 76, 89 123, 144
Group 6: 123, 144, 199, 233
Group 7: 199, 233, 322, 377
How to use
1. Divergences
2. Moving average crosses
3. Momentum
Plotshape colors show when moving averages are nearing a crossover and level can be manually set in menu.
Multi-Tool Indicator v6This is a versatile technical analysis tool designed to help traders quickly assess market trends and momentum. It combines a customizable Moving Average (MA) with Relative Strength Index (RSI) signals to highlight key market conditions directly on the chart.
🔧 Key Features:
Configurable Moving Average (MA):
Supports SMA (Simple Moving Average) and EMA (Exponential Moving Average).
User-defined length to match your strategy.
Plotted directly on the price chart for trend tracking.
RSI-Based Signal Detection:
Uses RSI to detect overbought (above 70) and oversold (below 30) conditions.
Plots red/green triangle shapes above/below bars when these conditions occur.
Background Highlighting:
Changes chart background to red when overbought and green when oversold to improve visual clarity.
Alerts for Key RSI Events:
Alerts can be triggered when RSI enters overbought or oversold zones.
Useful for automated strategy notifications.
MA Value Labels:
A label shows the current value of the MA near the most recent bar.
SMA Crossing Background Color (Multi-Timeframe)When day trading or scalping on lower timeframes, it’s often difficult to determine whether the broader market trend is moving upward or downward. To address this, I usually check higher timeframes. However, splitting the layout makes the charts too small and hard to read.
To solve this issue, I created an indicator that uses the background color to show whether the current price is above or below a moving average from a higher timeframe.
For example, if you set the SMA Length to 200 and the MT Timeframe to 5 minutes, the indicator will display a red background on the 1-minute chart when the price drops below the 200 SMA on the 5-minute chart. This helps you quickly recognize that the trend on the higher timeframe has turned bearish—without having to open a separate chart.
デイトレード、スキャルピングで短いタイムフレームでトレードをするときに、大きな動きは上に向いているのか下に向いているのかトレンドがわからなくなることがあります。
その時に上位足を確認するのですが、レイアウトをスプリットすると画面が小さくて見えにくくなるので、バックグラウンドの色で上位足の移動平均線では価格が上なのか下なのかを表示させるインジケーターを作りました。
例えば、SMA Length で200を選び、MT Timeframeで5分を選べば、1分足タイムフレームでトレードしていて雲行きが怪しくなってくるとBGが赤になり、5分足では200線以下に突入しているようだと把握することができます。
Post-Market Session AnalyzerThis script visually analyzes U.S. post-market trading hours (4:00 PM to 8:00 PM EST) by:
a) Highlighting post-market session background
b) Coloring candles based on price direction
c) Marking the final post-market candle with a trend label
Great for:
1) Traders who monitor after-hours price movement
2) Spotting late-day reversals or sentiment shifts
3) Understanding extended trading activity
SymFlex Band No1. - Momentum Weighted Volatility BandsSymFlex Band No1 – Momentum-Weighted Adaptive Volatility Band
Overview
The SymFlex Band No1 is a custom-built volatility band that fuses momentum and volatility into a flexible, asymmetric envelope.
It adapts dynamically to market conditions using RSI-based momentum weighting and a selection of smoothing algorithms, making it responsive to both trend shifts and volatility expansions.
Key Features
📊 Momentum-Weighted Width
The band expands or contracts based on RSI momentum. When the RSI is above 50, the upper band becomes more sensitive; when below 50, the lower band responds more dynamically.
🔁 Asymmetric Adaptation
Unlike traditional Bollinger Bands or Keltner Channels, the upper and lower bands of the SymFlex system are independently adjusted based on momentum conditions, creating a non-linear envelope structure.
⚙️ Selectable Smoothing Methods
You can choose among the following methods to control the volatility smoothing:
EMA (Exponential Moving Average)
TEMA (Triple Exponential Moving Average)
ZeroLag EMA v0 (double EMA difference method)
ZeroLag EMA v1 (lag-compensated input)
🛠 Fully Customizable Inputs
RSI Length
Band Multiplier
Band Length
Smoothing Type
How It Works
RSI is calculated over a defined length and normalized to a weight between -1 and +1.
Standard deviation (volatility) of the close price is computed and smoothed.
The band centerline is a Simple Moving Average (SMA).
The band boundaries are then:
Upper = Middle + (1 + momentum_weight) × multiplier × smoothed_volatility
Lower = Middle - (1 + momentum_weight) × multiplier × smoothed_volatility
Use Cases
Detect momentum-driven breakouts
Spot compressions before expansions
Adapt to volatile or trending markets more effectively than fixed bands
Disclaimer
This script is for educational and research purposes only. It is not financial advice. Use with discretion and always validate with additional signals and proper risk management.
BOS INDICATOR )This indicator is used to mark out breaks of structures to the upside and the downside. It's used to easily determine which direction the market is breaking structure towards.
Range Bar Gaps DetectorRange Bar Gaps Detector
Overview
The Range Bar Gaps Detector identifies price gaps across multiple range bar sizes (12, 24, 60, and 120) on any trading instrument, helping traders spot potential support/resistance zones or breakout opportunities. Designed for Pine Script v6, this indicator detects gaps on range bars and exports data for use in companion scripts like Range Bar Gaps Overlap, making it ideal for multi-timeframe gap analysis.
Key Features
Multi-Range Gap Detection: Identifies gaps on 12, 24, 60, and 120-range bars, capturing both bullish (gap up) and bearish (gap down) price movements.
Customizable Sensitivity: Includes a user-defined minimum deviation (default: 10% of 14-period SMA) for 12-range gaps to filter out noise.
7-Day Lookback: Automatically prunes gaps older than 7 days to focus on recent, relevant price levels.
Data Export: Serializes up to 10 gaps per range (tops, bottoms, start bars, highest/lowest prices, and age) for seamless integration with overlap analysis scripts.
Debugging Support: Plots gap counts and aggregation data in the Data Window for easy verification of detected gaps.
How It Works
The indicator aggregates price movements to simulate higher range bars (24, 60, 120) from a base range bar chart. It detects gaps when the price jumps significantly between bars, ensuring gaps meet the minimum deviation threshold for 12-range bars. Gaps are stored in arrays, serialized for external use, and pruned after 7 days to maintain efficiency.
Usage
Add to your range bar chart (e.g., 12-range) to detect gaps across multiple ranges.
Use alongside the Range Bar Gaps Overlap indicator to visualize gaps and their overlaps as boxes on the chart.
Check the Data Window to confirm gap counts and sizes for each range (12, 24, 60, 120).
Adjust the "Minimal Deviation (%) for 12-Range" input to control gap detection sensitivity.
Settings
Minimal Deviation (%) for 12-Range: Set the minimum gap size for 12-range bars (default: 10% of 14-period SMA).
Range Sizes: Fixed at 24, 60, and 120 for higher range bar aggregation.
Notes
Ensure the script is published under your TradingView username (e.g., GreenArrow2005) for use with companion scripts.
Best used on range bar charts to maintain consistent gap detection.
For advanced overlap analysis, pair with the Range Bar Gaps Overlap indicator to highlight zones where gaps from different ranges align.
Ideal For
Traders seeking to identify key price levels for support/resistance or breakout strategies.
Multi-timeframe analysts combining gap data across various range bar sizes.
Developers building custom indicators that leverage gap data for advanced charting.
H turnoverTrading Value refers to the total monetary amount of all transactions for a particular stock or the entire market over a specific period. It is calculated by multiplying the trading volume (the number of shares traded) by the price at which they were traded. For example, if 10,000 shares of a stock are traded in a day at an average price of 50,000 KRW, the trading value for that day would be 500,000,000 KRW.
Key points about trading value:
Market Activity and Liquidity: A high trading value indicates an active and liquid market.
Flow of Investment Funds: Increasing trading value suggests more money is flowing into the market or a particular stock.
Relationship with Price Movements: When both trading value and price rise together, it often signals strong buying interest. Conversely, significant price changes with low trading value may be less reliable.
Market Sentiment Indicator: Changes in trading value can reflect shifts in investor interest and sentiment.
In summary, trading value is the total amount of money exchanged in trades and serves as an important indicator of market activity, liquidity, and investor sentiment.
EMA Shadow Trading_TixThis TradingView indicator, named "EMA Shadow Trading_Tix", combines Exponential Moving Averages (EMAs) with VWAP (Volume-Weighted Average Price) and a shadow fill between EMAs to help traders identify trends, momentum, and potential reversal zones. Below is a breakdown of its key functions:
1. EMA (Exponential Moving Average) Settings
The indicator allows customization of four EMAs with different lengths and colors:
EMA 1 (Default: 9, Green) – Short-term trend filter.
EMA 2 (Default: 21, Red) – Medium-term trend filter.
EMA 3 (Default: 50, Blue) – Mid-to-long-term trend filter.
EMA 4 (Default: 200, Orange) – Long-term trend filter (often used as a "bull/bear market" indicator).
Key Features:
Global EMA Source: All EMAs use the same source (default: close), ensuring consistency.
Toggle Visibility: Each EMA can be independently shown/hidden.
Precision Calculation: EMAs are rounded to the minimum tick size for accuracy.
Customizable Colors & Widths: Helps in distinguishing different EMAs easily.
How Traders Use EMAs:
Trend Identification:
If price is above all EMAs, the trend is bullish.
If price is below all EMAs, the trend is bearish.
Crossovers:
A shorter EMA crossing above a longer EMA (e.g., EMA 9 > EMA 21) suggests bullish momentum.
A shorter EMA crossing below a longer EMA (e.g., EMA 9 < EMA 21) suggests bearish momentum.
Dynamic Support/Resistance:
EMAs often act as support in uptrends and resistance in downtrends.
2. Shadow Fill Between EMA 1 & EMA 2
The indicator includes a colored fill (shadow) between EMA 1 (9-period) and EMA 2 (21-period) to enhance trend visualization.
How It Works:
Bullish Shadow (Green): Applies when EMA 1 > EMA 2, indicating a bullish trend.
Bearish Shadow (Red): Applies when EMA 1 < EMA 2, indicating a bearish trend.
Why It’s Useful:
Trend Confirmation: The shadow helps traders quickly assess whether the short-term trend is bullish or bearish.
Visual Clarity: The fill makes it easier to spot EMA crossovers and trend shifts.
3. VWAP (Volume-Weighted Average Price) Integration
The indicator includes an optional VWAP overlay, which is useful for intraday traders.
Key Features:
Customizable Anchor Periods: Options include Session, Week, Month, Quarter, Year, Decade, Century, Earnings, Dividends, Splits.
Hide on Higher Timeframes: Can be disabled on 1D or higher charts to avoid clutter.
Adjustable Color & Width: Default is purple, but users can change it.
How Traders Use VWAP:
Mean Reversion: Price tends to revert to VWAP.
Trend Confirmation:
Price above VWAP = Bullish bias.
Price below VWAP = Bearish bias.
Breakout/Rejection Signals: Strong moves away from VWAP may indicate continuation or exhaustion.
4. Practical Trading Applications
Trend-Following Strategy:
Long Entry: Price above all EMAs + EMA 1 > EMA 2 (green shadow). Optional: Price above VWAP for intraday trades.
Short Entry: Price below all EMAs + EMA 1 < EMA 2 (red shadow). Optional: Price below VWAP for intraday trades.
Mean Reversion Strategy:
Pullback to EMA 9/21/VWAP: Look for bounces near EMAs or VWAP in a strong trend.
Multi-Timeframe Confirmation:
Higher timeframe EMAs (50, 200) can be used to filter trades (e.g., only trade longs if price is above EMA 200).
Conclusion
This EMA Shadow Trading Indicator is a versatile tool that combines:
✔ Multiple EMAs for trend analysis
✔ Shadow fill for quick trend visualization
✔ VWAP integration for intraday trading
It is useful for swing traders, day traders, and investors looking for trend confirmation, momentum shifts, and dynamic support/resistance levels.
Heiken Ashi Candles - CustomizableHeiken Ashi Candles – Customizable Overlay
This TradingView indicator displays accurate Heiken Ashi candles directly on your price chart, perfectly synced with TradingView’s built-in Heiken Ashi source. It’s ideal for traders who want to backtest or analyze Heiken Ashi structure without switching chart types. The indicator also includes full customization of candle body and wick colors for both bullish and bearish candles—perfect for tailoring your chart visuals to your preferences.
Quarterly Revenue & Growthinspired by TrendSpider. Monitoring a company's earning revenue quarter by quarter.
Dynamic ATR Label//@version=5
indicator("Dynamic ATR Label", overlay=true)
// User definable ATR parameters
atrLength = input.int(14, "ATR Length", minval=1)
priceSource = input.source(close, "Price Source")
// Calculate ATR
atrValue = ta.atr(atrLength)
// Calculate ATR in percentage
atrPercent = (atrValue / priceSource) * 100
// Format the ATR percentage for display
atrText = "ATR: " + str.tostring(atrPercent, "#.##") + "%"
// Create or update the label
var label atrLabel = na
if na(atrLabel)
// Create the label on the first bar
atrLabel := label.new(x=bar_index, y=high, text=atrText,
xloc=xloc.bar_index, yloc=yloc.price, // Define how x and y are interpreted
style=label.style_label_down, color=color.blue,
textcolor=color.white, size=size.normal)
else
// Update the label's position and text on subsequent bars
label.set_xy(atrLabel, x=bar_index, y=high) // Only update x and y coordinates
label.set_text(atrLabel, atrText)
Unified ATR LevelsThis is a unified ATR-based band plotting indicator.
It allows you to display:
Default ATR (on current timeframe)
Preset ATR (mapped to higher timeframe logic)
User-defined ATR (on any custom timeframe)
✳️ Features:
Configurable multipliers, colors, and line widths
Smart label positioning (left, middle, right)
Clean visuals with adjustable label size
Ideal for multi-timeframe analysis and volatility zones
📌 All feedback welcome!
Tags:
volatility, ATR, multi-timeframe, support-and-resistance, custom-indicator
Wave 2 Flat Detection - B Breaks A High, C Breaks A Low//@version=5
indicator("Wave 2 Flat Detection - B Breaks A High, C Breaks A Low", overlay=true)
// === Parameters ===
wave1_len = 10 // length of wave 1
a_len = 5 // candles to look for Wave A
b_len = 3 // candles to look for Wave B
c_len = 3 // candles to look for Wave C
// === Detect Wave 1 (upward impulse) ===
wave1_start = low
wave1_end = high
wave1_valid = wave1_end > wave1_start * 1.05 // 5% move up
// === Wave A ===
a_start = high // assumed wave 1 top
a_end = low // correction low (Wave A end)
wave_a_valid = a_end < a_start
// === Wave B ===
b_high = high
wave_b_valid = b_high > a_start // B breaks above A's high
// === Wave C ===
c_low = low
wave_c_break = c_low < a_end // C breaks below A's low
// === Final Condition ===
flat_pattern_confirmed = wave1_valid and wave_a_valid and wave_b_valid and wave_c_break
// === Plot + Alert ===
plotshape(flat_pattern_confirmed, title="Flat Wave 2 Detected", location=location.belowbar, color=color.red, style=shape.labelup, text="C↓")
alertcondition(flat_pattern_confirmed, title="Wave C Breaks Below A", message="Wave C broke below Wave A low — Flat correction confirmed, watch for Wave 3")