1m Confirmation: EMA20 + QQE + Vol Spike by RalpinoyThis is a “confirmation” indicator for 1-minute scalping. We created to assure us before entering a trade.
It fires a ✅ long arrow when all three line up:
Trend: price is above the 20-period EMA
Momentum: QQE histogram is above zero
Volume: current bar’s volume > 1.5× its 20-bar SMA
A ❌ short arrow shows when the inverse conditions are met.
Guys you may use this and drop it onto your 1 min chart and adjust the multipliers to taste.
How to use:
Add this as a single indicator on your 1 min chart.
Watch for the ✅/❌ arrows to mark “all-clear” entries.
You can hook the built-in alerts to get pinged exactly when those arrows appear.
Feel free to tweak the QQE multiplier, volume multiplier or even swap in your preferred momentum calc. Happy scalping!
Candlestick analysis
EU vs GU Strength @smEURUSD vs GBPUSD Strength Tester
✅ What it does:
-Plots EURUSD change (blue line)
-Plot GBPUSD change (green line)
-Plots EURGBP change (orange line)
Background turns bluish if EUR is stronger, greenish if GBP is stronger!
So, just by watching the background color, you can immediately tell:
If you prefer EURUSD or GBPUSD for your long/short setup.
BTST By ANTThe BTST Indicator is a powerful tool specifically designed for traders in the Indian stock market. This unique indicator identifies and highlights key price movements at a pivotal time—3:15 PM. This time is crucial for making BTST (Buy Today, Sell Tomorrow) decisions, a popular trading strategy in India.
Key Features:
Gap Identification : The indicator detects whether the current price action represents a gap-up or gap-down situation compared to the Heikinashi candle close price. This information is vital for short-term traders looking to capitalize on price momentum.
Visual Alerts : When a gap-up trend is detected, a green label "Gap Up" is displayed above the relevant bar. Similarly, a red label "Gap Down" appears below the bar for gap-down movements. These visual indicators help traders make quick and informed decisions.
User-Friendly Insights: The BTST Indicator provides vital information about last closed prices and the dynamics between normal candles and Heikinashi candles. With detailed logs, users can see the exact conditions leading to buy or sell signals, helping optimize trading strategies.
Why Use the BTST Indicator?
Timeliness: The focus on the 3:15 PM mark aligns perfectly with trading patterns and market behavior specific to the Indian stock market, making it an invaluable addition to your trading arsenal.
Enhanced Decision-Making: By receiving immediate visual cues on significant price movements, traders can execute their BTST strategies with greater confidence and speed.
Designed for Indian Markets: This indicator caters specifically to the nuances of Indian stock trading, ensuring relevance and effectiveness for local traders.
Start utilizing the BTST Indicator today to enhance your trading strategies and position yourself for successful trades in the Indian stock market!
Pmax + T3Pmax + T3 is a versatile hybrid trend-momentum indicator that overlays two complementary systems on your price chart:
1. Pmax (EMA & ATR “Risk” Zones)
Calculates two exponential moving averages (Fast EMA & Slow EMA) and plots them to gauge trend direction.
Highlights “risk zones” behind price as a colored background:
Green when Fast EMA > Slow EMA (up-trend)
Red when Fast EMA < Slow EMA (down-trend)
Yellow when EMAs are close (“flat” zone), helping you avoid choppy markets.
You can toggle risk-zone highlighting on/off, plus choose to ignore signals in the yellow (neutral) zone.
2. T3 (Triple-Smoothed EMA Momentum)
Applies three sequential EMA smoothing (the classic “T3” algorithm) to your chosen source (usually close).
Fills the area between successive T3 curves with up/down colors for a clear visual of momentum shifts.
Optional neon-glow styling (outer, mid, inner glows) in customizable widths and transparencies for a striking “cyber” look.
You can highlight T3 movements only when the line is rising (green) or falling (red), or disable movement coloring.
Theonator Bank Volume Entry & Exit v2best of the best im telling you liek this shit slapps the bank in the head
Williams Percent Range proOverview
Williams Percent Range Pro is a powerful divergence detection tool based on the Williams %R oscillator.
It automatically identifies and plots regular and hidden divergences between price action and the %R oscillator, providing traders with early indications of potential trend reversals or trend continuations.
This indicator enhances the classic Williams %R by adding intelligent divergence detection logic, customizable visualization, and integrated alert conditions — making it a highly versatile tool for both manual and automated trading.
Features
Automatic Divergence Detection
Regular Divergence (signals trend reversals)
Hidden Divergence (signals trend continuations)
Customizable Settings
Period length, source price, color customization for each divergence type
Visual Enhancements
Overbought, Mid, and Oversold levels (-20, -50, -80)
Shaded background for easier visual interpretation
Pivot Detection
Identifies key swing points on the Williams %R line for divergence comparison
Integrated Alerts
Set up alerts for each type of divergence without coding
Lightweight and Optimized
Designed for fast loading and efficient operation on any timeframe
How It Works
Williams %R Calculation
The script calculates the Williams %R as follows:
%R = 100 × (Close - Highest High over Period) ÷ (Highest High - Lowest Low)
This results in a value that moves between -100 and 0, indicating overbought and oversold conditions.
Pivot Detection
The indicator uses pivot highs and pivot lows on the %R line to determine important swing points.
Pivot logic is based on comparing neighboring candles (5 bars to the left and 5 bars to the right by default).
Divergence Detection
1. Regular Divergence
Regular Bullish Divergence:
Price makes a Lower Low
Williams %R makes a Higher Low
→ Signals potential upward reversal
Regular Bearish Divergence:
Price makes a Higher High
Williams %R makes a Lower High
→ Signals potential downward reversal
2. Hidden Divergence
Hidden Bullish Divergence:
Price makes a Higher Low
Williams %R makes a Lower Low
→ Signals potential upward continuation
Hidden Bearish Divergence:
Price makes a Lower High
Williams %R makes a Higher High
→ Signals potential downward continuation
Each type of divergence is plotted with a specific label and customizable color on the indicator.
Input Parameters
Input Description
Length Period length for Williams %R calculation (default: 14)
Source Data source (default: Close)
Show Regular Divergence Enable/disable regular divergence detection
Show Hidden Divergence Enable/disable hidden divergence detection
Regular Bullish Color Color for regular bullish divergence labels
Regular Bearish Color Color for regular bearish divergence labels
Hidden Bullish Color Color for hidden bullish divergence labels
Hidden Bearish Color Color for hidden bearish divergence labels
Visual Elements
Horizontal Lines:
-20: Overbought zone
-50: Mid-level (dashed line)
-80: Oversold zone
Background Shading:
Fills between -20 and -80 for better visual focus on active trading zones.
Divergence Labels:
Bull = Regular Bullish Divergence
Bear = Regular Bearish Divergence
H Bull = Hidden Bullish Divergence
H Bear = Hidden Bearish Divergence
Each label appears exactly at the pivot points of the Williams %R line, offset slightly for clarity.
Alerts
You can create TradingView alerts based on the following conditions:
Regular Bullish Divergence Detected
Regular Bearish Divergence Detected
Hidden Bullish Divergence Detected
Hidden Bearish Divergence Detected
This allows fully automated trading setups or mobile push notifications.
Example alert message:
"Williams %R Regular Bullish Divergence Detected"
Usage Tips
Entry Strategy:
Combine divergence signals with trend confirmation indicators like EMA/SMA, MACD, or Volume.
Exit Strategy:
Monitor when price reaches key resistance/support zones or overbought/oversold levels on the %R.
Higher Accuracy:
Always confirm divergences with price action patterns such as breakouts, candlestick formations, or trendline breaks.
Conclusion
The Williams Percent Range Pro indicator brings powerful divergence detection and customization features to a classic momentum oscillator.
It provides clear visual and alert-based trading signals that help you anticipate major turning points or trend continuations in any market and timeframe.
Whether you are a swing trader, day trader, or scalper, this tool can be an essential addition to your technical analysis toolkit.
1-Hour Candlestick Patterns on 15m Chartplots 1 hour candlesticks on lower timeframe so there is no need to jump from higher time frame to lower time frame.
Relative Volume CandlesVisualizes candlesticks with transparency based on volume relative to a moving average. Higher-than-average volume makes candles more opaque, while lower volume increases transparency—helping you spot significant price movements at a glance!
Features:
Customizable up/down candle colors (default: green/red)
Adjustable lookback period for volume averaging (default: 21)
Fine-tune transparency with base transparency (default: 80) and scale (default: 2.0)
Overlay directly on your chart for seamless analysis
EMA golden cross strategy by Anuj Guptait just shows the golden crossovers. golden cross overs/unders are highly probable price points
Weekday Colors with Time Highlighting by NabojeetThis script is a Pine Script (version 6) indicator called "Weekday Colors with Time Highlighting" designed for TradingView charts. It has several key functions:
1. **Weekday Color Coding**:
- Assigns different background colors to each trading day (Monday through Friday)
- Allows users to customize the color for each day
- Includes toggles to enable/disable colors for specific days
2. **Time Range Highlighting**:
- Highlights a specific time period (e.g., 18:15-18:30) on every trading day
- Uses a custom color that can be adjusted by the user
- The time range is specified in HHMM-HHMM format
3. **High/Low Line Drawing**:
- Automatically identifies the highest high and lowest low points within the specified time range
- Draws horizontal lines at these levels when the time period ends
- Lines extend forward in time to serve as support/resistance references
- Users can customize the line color, width, and style (solid, dotted, or dashed)
The script is organized into logical sections with input parameters grouped by function (Weekday Colors, Weekday Display, Time Highlighting, and Horizontal Lines). Each section's inputs are customizable through the indicator settings panel.
This indicator would be particularly useful for traders who:
- Want visual distinction between different trading days
- Focus on specific time periods each day (like market opens, closes, or specific sessions)
- Use intraday support/resistance levels from key time periods
- Want to quickly identify session highs and lows
The implementation resets tracking variables at the beginning of each new time range and draws the lines once the time period ends, ensuring accurate high/low marking for each day's specified time window.
Author - Nabojeet
Session Times + Strenght M7This Script Aims to Define Session Times, and Rank those. It can help to adjust your Strategy to Higher Volatility, if you choose to use the Session Volatility and Strenght Index from 1-10. Your timezone on Trading View should be NY. You can customize the Following in Settings: Weight of Volatility & Narrative Regarding the ranking + Transparency of the Lines. SP:SPX FX:EURUSD OANDA:EURUSD CAPITALCOM:USDJPY AMEX:SPY NASDAQ:QQQ TVC:DXY CAPITALCOM:USDJPY CME_MINI:NQ1! OANDA:XAUUSD FX:GBPUSD
ExtremePointtop+botttom_fxtop+botttom_fxtop+botttom_fxtop+botttom_fxtop+botttom_fxtop+botttom_fxtop+botttom_fx
Tango Rocket velas 1.3Tango Rocket Indicator:
Daily Volatility Range Projection
This indicator identifies the 3 largest-bodied candles from the last N daily bars and calculates a projected price range centered on the current day’s opening price. The projected channel is displayed for the current day and past days, helping visualize potential daily movement and historical volatility patterns.
Price Flip StrategyPrice Flip Strategy with User-Defined Ticker Max/Max
This strategy leverages an inverted price calculation based on user-defined maximum and minimum price levels over customizable lookback periods. It generates buy and sell signals by comparing the previous bar's original price to the inverted price, within a specified date range. The script plots key metrics, including ticker max/min, original and inverted prices, moving averages, and HLCC4 averages, with customizable visibility toggles and labels for easy analysis.
Key Features:
Customizable Inputs: Set lookback periods for ticker max/min, moving average length, and date range for signal generation.
Inverted Price Logic: Calculates an inverted price using ticker max/min to identify trading opportunities.
Flexible Visualization: Toggle visibility for plots (e.g., ticker max/min, prices, moving averages, HLCC4 averages) and last-bar labels with user-defined colors and sizes.
Trading Signals: Generates buy signals when the previous original price exceeds the inverted price, and sell signals when it falls below, with alerts for real-time notifications.
Labeling: Displays values on the last bar for all plotted metrics, aiding in quick reference.
How to Use:
Add to Chart: Apply the script to a TradingView chart via the Pine Editor.
Configure Settings:
Date Range: Set the start and end dates to define the active trading period.
Ticker Levels: Adjust the lookback periods for calculating ticker max and min (e.g., 100 bars for max, 100 for min).
Moving Averages: Set the length for exponential moving averages (default: 20 bars).
Plots and Labels: Enable/disable specific plots (e.g., Inverted Price, Original HLCC4) and customize label colors/sizes for clarity.
Interpret Signals:
Buy Signal: Triggered when the previous close price is above the inverted price; marked with an upward label.
Sell Signal: Triggered when the previous close price is below the inverted price; marked with a downward label.
Set Alerts: Use the built-in alert conditions to receive notifications for buy/sell signals.
Analyze Plots: Review plotted lines (e.g., ticker max/min, HLCC4 averages) and last-bar labels to assess price behavior.
Tips:
Use in trending markets by enabling ticker max for uptrends or ticker min for downtrends, as indicated in tooltips.
Adjust the label offset to prevent overlapping text on the last bar.
Test the strategy on a demo account to optimize lookback periods and moving average settings for your asset.
Disclaimer: This script is for educational purposes and should be tested thoroughly before use in live trading. Past performance is not indicative of future results.
LDO Combined Sup/Res, Trends, MA Bands & Vector Candle ZonesQuick Guide to Using "LDO Combined Sup/Res, Trends, MA Bands & Vector Candle Zones"
Add the Indicator:
In TradingView, go to the "Indicators" menu, search for "LDO Combined Sup/Res, Trends, MA Bands & Vector Candle Zones", and add it to your chart.
Customize Settings:
Open the indicator settings:
Support & Resistance: Toggle Show Sup & Res Lines? and adjust pivot settings for support/resistance lines.
Trend Lines: Enable Show Trend Lines? to display trend lines based on pivots.
Moving Average Bands: Toggle Show MA Bands?. Adjust EMA/SMA lengths (default: 50 EMA, 21 SMA, 200 EMA) for more aggressive settings (e.g., 13 EMA, 8 SMA for faster signals).
Vector Candle Zones: Set Maximum zones to draw (default: 500) and customize zone appearance (e.g., transparency, border width).
PVSRA Colors: Enable Set PVSRA candle colors? to color candles based on volume/spread (green/red for high volume, blue/violet for moderate, gray for regular). Adjust colors if needed.
Alerts: Enable Enable PVSRA Candle Alerts? to get notifications for green/red PVSRA candles. You can change the indicator settings’ timeframe: if the chart is 1-hour, set alerts on a minute level (e.g., 5-minute) by adjusting the Higher Timeframe in settings.
Interpret the Chart:
Support/Resistance Lines: Blue lines indicate support/resistance levels; color changes based on price position.
Trend Lines: Colored lines show trends based on pivots (e.g., pink for highs, blue for lows).
MA Ribbon: 50 EMA (green), 21 SMA (green), and 200 EMA (gray) with a fill (blue/green) between EMA and SMA.
Vector Zones: Yellow zones highlight significant candles (based on volume/spread).
PVSRA Candles: Green/red candles indicate high volume/spread; blue/violet for moderate; gray for regular.
Set Up Alerts:
Click the "Alert" icon in TradingView.
Select the indicator and choose "PVSRA Green Candle" or "PVSRA Red Candle".
Configure notification settings (e.g., once per bar close on your chosen timeframe) and save.
Monitor and Trade:
Use support/resistance and trend lines for key levels.
Watch MA ribbon for trend direction (EMA/SMA crossover).
Look for PVSRA candles and zones for high-volume activity.
Respond to alerts for potential trading opportunities.
RSI + MACD AL SinyaliIt creates a buy signal using RSI and MACD in the daily watch list. Signals give better results on the daily.
Rally Sweep Volume RSV w/ Bollinger Band FilterPrice rallies, sweeps, and closes with more volume at the bollinger bands - helping reduce too many signals and filters out the high probability setups
Yüzde 5 Kar ve Yüzde 2 Zarar Stop Stratejisi15 dk grafikte rsi,hacim,bollinger bantları kullanarak strateji oluşturur.
Yüzde 5 Kar ve Yüzde 2 Zarar Stop Stratejisi15 dk grafikde rsi,bollinger bantları,fiyat,hacim kullanarak işlem yapmak için kullanılabilir.
Returns & Distance from ATHHere’s what that Pine Script does, in everyday terms:
1. **Look back in time**
- It grabs the closing price from **3 months ago** and **1 month ago** by asking TradingView’s “monthly” data for the symbol.
2. **Calculate percentage changes**
- **3-month return** = (today’s close – close 3 months ago) ÷ (close 3 months ago) × 100
- **1-month return** = (today’s close – close 1 month ago) ÷ (close 1 month ago) × 100
3. **Track the highest price ever seen (ATH)**
- It keeps a running “all-time high” variable, updating it any time today’s high exceeds the previous ATH.
4. **Compute how far you are below ATH**
- **% from ATH** = (ATH – today’s close) ÷ ATH × 100
5. **Build a little stats table on your chart**
- It makes a 2-row by 3-column box in the **top-center** of your price panel.
- The **first row** has labels: “3M % Return”, “1M % Return”, “% from ATH”.
- The **second row** shows the three computed numbers, each formatted to two decimal places and suffixed with “%.”
6. **Refresh only once per bar**
- All of these values and the table get updated **at the close** of each bar, so your table always shows the latest stats without cluttering the chart with extra drawings.
In short, this indicator quietly collects the right historical prices, does three simple percent-change math steps, and then displays those three key numbers in a neat, always-visible box at the top of your TradingView chart.
Micro Gaps DetectorSimple Micro Gap Indicator: A Technical Analysis Tool
The Simple Micro Gap Indicator is a specialized momentum indicator designed to identify and analyze micro gaps between consecutive candlesticks in financial charts. Unlike traditional gap analysis that focuses on larger price gaps, this indicator specifically targets smaller, less noticeable spaces between candles.
Key Features:
Detects minimal price disparities between consecutive candlesticks
Helps identify potential short-term momentum shifts
Useful for high-frequency trading and scalping strategies
Functions as a momentum indicator for short-term price movements
SMC Entry Signals MTF v2📘 User Guide for the SMC Entry Signals MTF v2 Indicator
🎯 Purpose of the Indicator
This indicator is designed to identify reversal entry points based on Smart Money Concepts (SMC) and candlestick confirmation. It’s especially useful for traders who use:
Imbalance zones, order blocks, breaker blocks
Liquidity grabs
Multi-timeframe confirmation (MTF)
📈 How to Use the Signals on the Chart
✅ LONG Signal (green triangle below the candle):
Conditions:
Price is in a discount zone (below the FIB 50% level)
A bullish engulfing candle appears
A bullish Order Block (OB) or Breaker Block is detected
There’s an upward imbalance
A bullish OB is confirmed on the higher timeframe
➡️ How to act:
Consider entering long on the current or next candle.
Place your stop-loss below the OB or the nearest swing low.
Take profit at the nearest liquidity zone or premium area (above FIB 50%).
🔻 SHORT Signal (red triangle above the candle):
Conditions:
Price is in a premium zone (above FIB 50%)
A bearish engulfing candle appears
A bearish OB or Breaker Block is detected
There’s a downward imbalance
A bearish OB is confirmed on the higher timeframe
➡️ How to act:
Consider short entry after the signal.
Place your stop-loss above the OB or swing high.
Target the discount zone or the next liquidity pocket.
⚙️ Recommended Settings by Trading Style
Trading Style Suggested Settings Notes
Intraday (1–15m) fibLookback = 20–50, obLookback = 5–10, htf_tf = 1H/4H Fast signals. Use Discount/Premium + Engulfing.
Swing/Position (1H–1D) fibLookback = 50–100, obLookback = 10–20, htf_tf = 1D/1W Higher trust in MTF confirmation. Ideal with fundamentals.
Scalping (1m) fibLookback = 10–20, obLookback = 3–5, htf_tf = 15m/1H Remove Breaker and MTF for quick reaction trades.
🧠 Best Practices for Traders
Trend Filtering:
Use EMAs or volume to confirm the current trend.
Take longs only in uptrends, shorts in downtrends.
Liquidity Zones:
Use this indicator after liquidity grabs.
OBs and Breakers often appear right after stop hunts.
Combine with Manual Zones:
This works best when paired with manually drawn OBs and key levels.
Backtest the Signals:
Use Bar Replay mode on TradingView to test past signals.
🧪 Example Trade Setup
Example on BTCUSDT 15m:
Price drops into the discount zone.
A green triangle appears (bullish engulfing + OB + imbalance + HTF OB).
You enter long, stop below the OB, target the premium zone.
🎯 This type of setup often gives a risk/reward ratio of 1:2 or better — profitable even with a 40% win rate.
⏰ Alerts & Automation
Enable alerts:
"SMC Long Entry" — fires when a long signal appears.
"SMC Short Entry" — fires when a short signal appears.
You can integrate this with bots via webhook, like:
TradingConnector, 3Commas, Alertatron, etc.
✅ What This Indicator Gives You
High-probability entries using SMC logic
Customizable filters for entry logic
Multi-timeframe confirmation for stronger setups
Suitable for both intraday and swing trading
ADR% Extension Levels from SMA 50I created this indicator inspired by RealSimpleAriel (a swing trader I recommend following on X) who does not buy stocks extended beyond 4 ADR% from the 50 SMA and uses extensions from the 50 SMA at 7-8-9-10-11-12-13 ADR% to take profits with a 20% position trimming.
RealSimpleAriel's strategy (as I understood it):
-> Focuses on leading stocks from leading groups and industries, i.e., those that have grown the most in the last 1-3-6 months (see on Finviz groups and then select sector-industry).
-> Targets stocks with the best technical setup for a breakout, above the 200 SMA in a bear market and above both the 50 SMA and 200 SMA in a bull market, selecting those with growing Earnings and Sales.
-> Buys stocks on breakout with a stop loss set at the day's low of the breakout and ensures they are not extended beyond 4 ADR% from the 50 SMA.
-> 3-5 day momentum burst: After a breakout, takes profits by selling 1/2 or 1/3 of the position after a 3-5 day upward move.
-> 20% trimming on extension from the 50 SMA: At 7 ADR% (ADR% calculated over 20 days) extension from the 50 SMA, takes profits by selling 20% of the remaining position. Continues to trim 20% of the remaining position based on the stock price extension from the 50 SMA, calculated using the 20-period ADR%, thus trimming 20% at 8-9-10-11 ADR% extension from the 50 SMA. Upon reaching 12-13 ADR% extension from the 50 SMA, considers the stock overextended, closes the remaining position, and evaluates a short.
-> Trailing stop with ascending SMA: Uses a chosen SMA (10, 20, or 50) as the definitive stop loss for the position, depending on the stock's movement speed (preferring larger SMAs for slower-moving stocks or for long-term theses). If the stock's closing price falls below the chosen SMA, the entire position is closed.
In summary:
-->Buy a breakout using the day's low of the breakout as the stop loss (this stop loss is the most critical).
--> Do not buy stocks extended beyond 4 ADR% from the 50 SMA.
--> Sell 1/2 or 1/3 of the position after 3-5 days of upward movement.
--> Trim 20% of the position at each 7-8-9-10-11-12-13 ADR% extension from the 50 SMA.
--> Close the entire position if the breakout fails and the day's low of the breakout is reached.
--> Close the entire position if the price, during the rise, falls below a chosen SMA (10, 20, or 50, depending on your preference).
--> Definitively close the position if it reaches 12-13 ADR% extension from the 50 SMA.
I used Grok from X to create this indicator. I am not a programmer, but based on the ADR% I use, it works.
Below is Grok from X's description of the indicator:
Script Description
The script is a custom indicator for TradingView that displays extension levels based on ADR% relative to the 50-period Simple Moving Average (SMA). Below is a detailed description of its features, structure, and behavior:
1. Purpose of the Indicator
Name: "ADR% Extension Levels from SMA 50".
Objective: Draw horizontal blue lines above and below the 50-period SMA, corresponding to specific ADR% multiples (4, 7, 8, 9, 10, 11, 12, 13). These levels represent potential price extension zones based on the average daily percentage volatility.
Overlay: The indicator is overlaid on the price chart (overlay=true), so the lines and SMA appear directly on the price graph.
2. Configurable Inputs
The indicator allows users to customize parameters through TradingView settings:
SMA Length (smaLength):
Default: 50 periods.
Description: Specifies the number of periods for calculating the Simple Moving Average (SMA). The 50-period SMA serves as the reference point for extension levels.
Constraint: Minimum 1 period.
ADR% Length (adrLength):
Default: 20 periods.
Description: Specifies the number of days to calculate the moving average of the daily high/low ratio, used to determine ADR%.
Constraint: Minimum 1 period.
Scale Factor (scaleFactor):
Default: 1.0.
Description: An optional multiplier to adjust the distance of extension levels from the SMA. Useful if levels are too close or too far due to an overly small or large ADR%.
Constraint: Minimum 0.1, increments of 0.1.
Tooltip: "Adjust if levels are too close or far from SMA".
3. Main Calculations
50-period SMA:
Calculated with ta.sma(close, smaLength) using the closing price (close).
Serves as the central line around which extension levels are drawn.
ADR% (Average Daily Range Percentage):
Formula: 100 * (ta.sma(dhigh / dlow, adrLength) - 1).
Details:
dhigh and dlow are the daily high and low prices, obtained via request.security(syminfo.tickerid, "D", high/low) to ensure data is daily-based, regardless of the chart's timeframe.
The dhigh / dlow ratio represents the daily percentage change.
The simple moving average (ta.sma) of this ratio over 20 days (adrLength) is subtracted by 1 and multiplied by 100 to obtain ADR% as a percentage.
The result is multiplied by scaleFactor for manual adjustments.
Extension Levels:
Defined as ADR% multiples: 4, 7, 8, 9, 10, 11, 12, 13.
Stored in an array (levels) for easy iteration.
For each level, prices above and below the SMA are calculated as:
Above: sma50 * (1 + (level * adrPercent / 100))
Below: sma50 * (1 - (level * adrPercent / 100))
These represent price levels corresponding to a percentage change from the SMA equal to level * ADR%.
4. Visualization
Horizontal Blue Lines:
For each level (4, 7, 8, 9, 10, 11, 12, 13 ADR%), two lines are drawn:
One above the SMA (e.g., +4 ADR%).
One below the SMA (e.g., -4 ADR%).
Color: Blue (color.blue).
Style: Solid (style=line.style_solid).
Management:
Each level has dedicated variables for upper and lower lines (e.g., upperLine1, lowerLine1 for 4 ADR%).
Previous lines are deleted with line.delete before drawing new ones to avoid overlaps.
Lines are updated at each bar with line.new(bar_index , level, bar_index, level), covering the range from the previous bar to the current one.
Labels:
Displayed only on the last bar (barstate.islast) to avoid clutter.
For each level, two labels:
Above: E.g., "4 ADR%", positioned above the upper line (style=label.style_label_down).
Below: E.g., "-4 ADR%", positioned below the lower line (style=label.style_label_up).
Color: Blue background, white text.
50-period SMA:
Drawn as a gray line (color.gray) for visual reference.
Diagnostics:
ADR% Plot: ADR% is plotted in the status line (orange, histogram style) to verify the value.
ADR% Label: A label on the last bar near the SMA shows the exact ADR% value (e.g., "ADR%: 2.34%"), with a gray background and white text.
5. Behavior
Dynamic Updating:
Lines update with each new bar to reflect new SMA 50 and ADR% values.
Since ADR% uses daily data ("D"), it remains constant within the same day but changes day-to-day.
Visibility Across All Bars:
Lines are drawn on every bar, not just the last one, ensuring visibility on historical data as well.
Adaptability:
The scaleFactor allows level adjustments if ADR% is too small (e.g., for low-volatility symbols) or too large (e.g., for cryptocurrencies).
Compatibility:
Works on any timeframe since ADR% is calculated from daily data.
Suitable for symbols with varying volatility (e.g., stocks, forex, cryptocurrencies).
6. Intended Use
Technical Analysis: Extension levels represent significant price zones based on average daily volatility. They can be used to:
Identify potential price targets (e.g., take profit at +7 ADR%).
Assess support/resistance zones (e.g., -4 ADR% as support).
Measure price extension relative to the 50 SMA.
Trading: Useful for strategies based on breakouts or mean reversion, where ADR% levels indicate reversal or continuation points.
Debugging: Labels and ADR% plot help verify that values align with the symbol’s volatility.
7. Limitations
Dependence on Daily Data: ADR% is based on daily dhigh/dlow, so it may not reflect intraday volatility on short timeframes (e.g., 1 minute).
Extreme ADR% Values: For low-volatility symbols (e.g., bonds) or high-volatility symbols (e.g., meme stocks), ADR% may require adjustments via scaleFactor.
Graphical Load: Drawing 16 lines (8 upper, 8 lower) on every bar may slow the chart for very long historical periods, though line management is optimized.
ADR% Formula: The formula 100 * (sma(dhigh/dlow, Length) - 1) may produce different values compared to other ADR% definitions (e.g., (high - low) / close * 100), so users should be aware of the context.
8. Visual Example
On a chart of a stock like TSLA (daily timeframe):
The 50 SMA is a gray line tracking the average trend.
Assuming an ADR% of 3%:
At +4 ADR% (12%), a blue line appears at sma50 * 1.12.
At -4 ADR% (-12%), a blue line appears at sma50 * 0.88.
Other lines appear at ±7, ±8, ±9, ±10, ±11, ±12, ±13 ADR%.
On the last bar, labels show "4 ADR%", "-4 ADR%", etc., and a gray label shows "ADR%: 3.00%".
ADR% is visible in the status line as an orange histogram.
9. Code: Technical Structure
Language: Pine Script @version=5.
Inputs: Three configurable parameters (smaLength, adrLength, scaleFactor).
Calculations:
SMA: ta.sma(close, smaLength).
ADR%: 100 * (ta.sma(dhigh / dlow, adrLength) - 1) * scaleFactor.
Levels: sma50 * (1 ± (level * adrPercent / 100)).
Graphics:
Lines: Created with line.new, deleted with line.delete to avoid overlaps.
Labels: Created with label.new only on the last bar.
Plots: plot(sma50) for the SMA, plot(adrPercent) for debugging.
Optimization: Uses dedicated variables for each line (e.g., upperLine1, lowerLine1) for clear management and to respect TradingView’s graphical object limits.
10. Possible Improvements
Option to show lines only on the last bar: Would reduce visual clutter.
Customizable line styles: Allow users to choose color or style (e.g., dashed).
Alert for anomalous ADR%: A message if ADR% is too small or large.
Dynamic levels: Allow users to specify ADR% multiples via input.
Optimization for short timeframes: Adapt ADR% for intraday timeframes.
Conclusion
The script creates a visual indicator that helps traders identify price extension levels based on daily volatility (ADR%) relative to the 50 SMA. It is robust, configurable, and includes debugging tools (ADR% plot and labels) to verify values. The ADR% formula based on dhigh/dlow