Adaptive Trend Breaks Adaptive Trend Breaks
## WHAT IT DOES
This script is a modified and enhanced version of "Trendline Breakouts With Targets" concept by ChartPrime.
Adaptive Trend Breaks (ATB) is a trendline breakout system optimized for scalping liquid futures contracts. The indicator automatically draws dynamic support and resistance trendlines based on pivot points, then generates trade signals when price breaks through these levels with confirmation filters. It includes automated target and stop-loss placement with real-time P&L tracking in dollars.
## HOW IT WORKS
**Trendline Detection Method:**
The indicator uses pivot high/low detection to identify significant price turning points. When a new pivot forms, it calculates the slope between consecutive pivots to draw dynamic trendlines. These lines extend forward based on the established trend angle, creating actionable support and resistance zones.
**Band System:**
Around each trendline, the script creates a "band" using a volatility-adjusted calculation: `ATR(14) * 0.2 * bandwidth multiplier / 2`. This adaptive band accounts for current market conditions - wider during volatile periods, tighter during quiet markets.
**Breakout Logic:**
A breakout signal triggers when:
1. Price closes beyond the trendline + band zone
2. Volume exceeds the 20-period moving average by your set multiplier (default 1.2x)
3. Price is within Regular Trading Hours (9:30-16:00 EST) if session filter enabled
4. Current ATR meets minimum volatility threshold (prevents trading dead markets)
**Target & Stop Calculation:**
Upon breakout confirmation:
- **Entry**: Trendline breach point
- **Target**: Entry ± (bandwidth × target multiplier) - default 8x for quick scalps
- **Stop**: Entry ± (bandwidth × stop multiplier) - default 8x for 1:1 risk/reward
- Multipliers adjust automatically to market volatility through the ATR-based band
**P&L Conversion:**
The script converts point movements to dollars using:
```
Dollar P&L = (Price Points × Contract Point Value × Quantity)
```
For example, a 10-point NQ move with 2 contracts = 10 × $20 × 2 = $400
## HOW TO USE IT
**Setup:**
1. Select your instrument (NQ/ES/YM/RTY) - point values auto-configure
2. Set contract quantity for accurate dollar P&L
3. Choose pivot period (lower = more signals but more noise, default 5 for scalping)
4. Adjust bandwidth multiplier if trendlines are too tight/loose (1-5 range)
**Filters Configuration:**
- **Volume Filter**: Requires breakout volume > moving average × multiplier. Increase multiplier (1.5-2.0) for higher conviction trades
- **Session Filter**: Enable to trade only RTH. Disable for 24-hour trading
- **ATR Filter**: Prevents signals during low volatility. Increase minimum % for more active markets only
**Risk Management:**
- Set target/stop multipliers based on your risk tolerance
- 8x bandwidth = approximately 1:1 risk/reward for most liquid futures
- Enable trailing stops for trend-following approach (moves stop to protect profits)
- Adjust line length to see targets further into the future
**Statistics Table:**
- Choose timeframe to analyze: all-time, today, this week, custom days
- Monitor win rate, profit factor, and net P&L in dollars
- Track long vs short performance separately
- See real-time unrealized P&L on active trades
**Reading Signals:**
- **Green triangle below bar** = Long breakout (resistance broken)
- **Red triangle above bar** = Short breakout (support broken)
- **White dashed line** = Entry price
- **Orange line** = Take profit target with dollar value
- **Red line** = Stop loss with dollar value
- **Green checkmark (✓)** = Target hit, winning trade
- **Red X (✗)** = Stop hit, losing trade
## WHAT IT DOES NOT DO
**Limitations to Understand:**
- Does not predict future trendline formations - it reacts to breakouts after they occur
- Historical trendlines disappear after breakout (not kept on chart for clarity)
- Requires sufficient volatility - may not signal in extremely quiet markets
- Volume filter requires exchange volume data (not available on all symbols)
- Statistics are indicator-based simulations, not actual trading results
- Does not account for slippage, commissions, or order fills
## BEST PRACTICES
**Recommended Settings by Market:**
- **NQ (Nasdaq)**: Default settings work well, consider volume multiplier 1.3-1.5
- **ES (S&P 500)**: Slightly slower, try period 7-8, volume 1.2
- **YM (Dow)**: Lower volatility, reduce bandwidth to 1.5-2
- **RTY (Russell)**: Higher volatility, increase bandwidth to 3-4
**Risk Management:**
- Never risk more than 2-3% of account per trade
- Use contract quantity calculator: Max Risk $ ÷ (Stop Distance × Point Value)
- Start with 1 contract while learning the system
- Backtest your specific timeframe and instrument before live trading
**Optimization Tips:**
- Increase pivot period (7-10) for fewer but higher-quality signals
- Raise volume multiplier (1.5-2.0) in choppy markets
- Lower target/stop multipliers (5-6x) for tighter profit taking
- Use trailing stops in strong trending conditions
- Disable session filter for overnight gaps and Asia session moves
## TECHNICAL DETAILS
**Key Calculations:**
- Pivot Detection: `ta.pivothigh(high, period, period/2)` and `ta.pivotlow(low, period, period/2)`
- Slope Calculation: `(newPivot - oldPivot) / (newTime - oldTime)`
- Adaptive Band: `min(ATR(14) * 0.2, close * 0.002) * multiplier / 2`
- Breakout Confirmation: Price crosses trendline + 10% of band threshold
**Data Requirements:**
- Minimum bars in view: 500 for proper pivot calculation
- Volume data required for volume filter accuracy
- Intraday timeframes recommended (1min - 15min) for scalping
- Works on any timeframe but optimized for fast execution
**Performance Metrics:**
All statistics calculate based on indicator signals:
- Tracks every signal as a trade from entry to TP/SL
- P&L in actual contract dollar values
- Win rate = (Winning trades / Total trades) × 100
- Profit factor = Gross profit / Gross loss
- Separates long/short performance for bias analysis
## IDEAL FOR
- Futures scalpers and day traders
- Traders who prefer visual trendline breakouts
- Those wanting automated TP/SL placement
- Traders tracking performance in dollar terms
- Multiple timeframe analysis (compare 1min vs 5min signals)
## NOT SUITABLE FOR
- Swing trading (targets too close)
- Stocks/forex without modifying point values
- Extremely low timeframes (<30 seconds) - too much noise
- Markets without volume data if using volume filter
- Illiquid contracts (signals may not execute at shown prices)
---
**Settings Summary:**
- Core: Period, bandwidth, extension, trendline style
- Filters: Volume, RTH session, ATR volatility
- Risk: R:R ratio, target/stop multipliers, trailing stop
- Display: Stats table position, size, colors
- Stats: Timeframe selection (all-time to custom days)
**License:** This indicator is published open-source under Mozilla Public License 2.0. You may use and modify the code with proper attribution.
**Disclaimer:** This indicator is for educational purposes. Past performance does not guarantee future results. Always practice proper risk management and test thoroughly before live trading.
---
## CREDITS & ATTRIBUTION
This script builds upon the "Trendline Breakouts With Targets" concept by ChartPrime with significant enhancements:
**Major Improvements Added:**
- **Futures-Specific Calculations**: Automated dollar P&L conversion using actual contract point values (NQ=$20, ES=$50, YM=$5, RTY=$50)
- **Advanced Statistics Engine**: Comprehensive performance tracking with customizable timeframe analysis (today, week, month, custom ranges)
- **Multi-Layer Filtering System**: Volume confirmation, RTH session filter, and ATR volatility filter to reduce false signals
- **Professional Trade Management**: Enhanced visual trade tracking with separate TP/SL lines, dollar value labels, and optional trailing stops
- **Optimized for Scalping**: Faster pivot periods (5 vs 10), tighter bands, and reduced extension bars for quick entries
Original trendline detection methodology by ChartPrime - used with modification under Mozilla Public License 2.0.
Wstęgi i Kanały
ASR - Average Session Range [KasTrades]This indicator displays the Average Session Range based on the session of your choice.
You can turn the tables off if you don't want to see a table version of the ASR levels. There is also a momentum table showing the current momentum, which you can also turn off.
SuperTrend Dual RMAThis enhanced ATR SuperTrend indicator combines dual volume-weighted RMAs with the Average True Range (ATR) to deliver smoother and more reliable trend signals.
It identifies bullish and bearish phases using a blue-rose color scheme, providing clear visual cues for entries and exits.
Features:
Dual RMA baseline for smooth, volume-sensitive trend calculation
ATR multiplier-driven upper and lower bands
Filled bands to highlight volatility zones
Bar coloring for trend confirmation
ADR [KasTrades]This ADR indicator has 2 options: a Range of ADR, such as 7 and 14 which is typically used for indexes, index futures and equities, or a single ADR such as a 5 day which is typically used for forex.
The session start time is 17:00 ET (NY Time) by default, this is adjustable.
You can adjust the ADR days to different ranges such as 5 and 10, or a single ADR day such as 7.
Colors of the ADR high and low are also adjustable.
Darvas Box with alertsTitle: Darvas Box with Breakout Signals
This indicator implements the legendary Darvas Box trading strategy developed by Nicolas What is the Darvas Box?
The Darvas Box is a momentum-based trading method that identifies consolidation zones by drawing boxes around price ranges. When price breaks out of these boxes, it often signals the beginning of a new trend.
Features:
Automatic Darvas Box detection and drawing based on customizable box length parameter
Dynamic box coloring (Green when price is above, Red when below, Yellow when inside)
Visual breakout signalsAdjust the "Box Length" parameter to match your trading timeframe (default: 5)
Wait for a Darvas Box to form (consolidation period)
Look for breakout signals (triangles) indicating potential trading opportunities
Set up alerts to be notified when breakouts occur
Use the box levels as potential support/resistance zones
ADR - Average Daily Range [KasTrades]This is an Average Daily Range (ADR) indicator.
There are two settings for ADR:
Two Look back period ADR range (e.g. 7 and 14 days)
One Look back period ADR (e.g. 5 days only)
Two day ADR ranges are typically used in equities and index futures whereas one day ADR is typically used in forex.
The opening time by default is 17:00 New York (Eastern) time. The ranges are always calculated from the opening price of the first bar on the respected timeframe.
PDH/PDL + PMH/PML Breakout Table + Alerts + 🔔PDH/PDL now come exclusively from the previous day's RTH (9:30–4:00 PM ET) — they no longer include premarket. This avoids the confusion we encountered.
PMH/PML are calculated only during the premarket period (4:00–9:30 AM ET) of the current day.
Employment emojis: 🟢 (upward breakout for PDH/PMH), 🔴 (downward breakout for PDL/PML), ⚪ (no breakout).
The table displays three columns: Level | Status | Price. If you'd like the table to have a different size/position/color, just adjust it quickly.
DARVAS BOX V5 Darvas Box indicator from Pine Script v3 to v5 with these improvements:
Triangle breakout signals (green up, red down)
Toggle option to show/hide signals
Breakout detection logic that tracks when price exits the box
Alert conditions for both upside and downside breakouts
Color Options:
Customize all visual elements to match your preferences:
Adjustable colors for top and bottom box lines
Custom colors for bullish and bearish breakout triangles
Flexible styling to fit any chart theme"
Adaptive Trend CatcherAdaptive Trend Catcher is an original indicator that combines Hull Moving Average smoothing, ATR-based volatility bands, and a CCI filter within an adaptive logic framework. It’s built to react intelligently to changing market conditions rather than applying fixed parameters.
The system uses hysteresis to confirm trend flips only after several consistent signals, minimizing noise and false reversals. During strong momentum bursts, it automatically tightens its internal deadzone and step size to stay responsive while maintaining stability in quieter periods.
The result is a dynamic trend engine that plots a color-shifting adaptive line — green for bullish, red for bearish — that adjusts smoothly with volatility. Optional upper/lower ATR bands can be displayed for added context.
How to use: Watch for confirmed trend color flips with supporting momentum. Bullish flips occur when price regains the lower band and CCI turns positive; bearish flips when price falls below the upper band and CCI turns negative.
Includes alert conditions for both reversals.
For educational purposes only. Not financial advice.
ALMASTO – Pro Trend & Momentum (v1.1)ALMASTO — Pro Trend & Momentum Strategy
Description:
This strategy is designed for precision trading in both Forex (FX) and Crypto markets.
It combines multi-timeframe trend confirmation (EMA200), momentum filters (RSI, MACD, ADX), and ATR-based dynamic risk management.
ALMASTO — Pro Trend & Momentum Strategy automatically manages take-profit levels, stop-loss, and breakeven adjustments once TP1 is reached — providing a structured and emotion-free trading approach.
Optimal Use
Works best on lower timeframes (5m–15m) with strong liquidity sessions.
Optimized for pairs like EURUSD, XAUUSD, and BTCUSDT.
Built for trend-following setups and momentum reversals with high volatility confirmation.
Recommended Settings
🔹 Forex – 5m
EMA Fast = 34, EMA Slow = 200, HTF = 1H
RSI (14): Long ≥ 55 / Short ≤ 45
MACD (8 / 21 / 5), ADX Len 10 / Min 27
ATR Len 7, Stop Loss = ATR × 2.1
TP1 = 1.1 RR, TP2 = 2.3 RR
Session = 07:00–11:00 & 12:30–16:00 (Exchange Time)
Risk = 0.8% per trade
🔹 Forex – 15m
EMA Fast = 50, EMA Slow = 200, HTF = 4H
RSI (14): Long ≥ 53 / Short ≤ 47
MACD (12 / 26 / 9), ADX Min 24
ATR Len 10, SL = ATR × 1.9
TP1 = 1.2 RR, TP2 = 2.6 RR
Risk = 1.0% per trade
🔹 Crypto – 5m (BTC/USDT)
EMA Fast = 34, EMA Slow = 200, HTF = 4H
RSI (14): Long ≥ 56 / Short ≤ 44
MACD (8 / 21 / 5), ADX Min 30
ATR Len 7, SL = ATR × 2.2
TP1 = 1.0 RR, TP2 = 2.5 RR
Session = 00:00–06:00 & 12:00–22:00 (UTC)
Risk = 0.5% per trade
Core Features
✅ Auto breakeven after TP1
✅ Dual take-profit system (1:1 & 1:2 RR)
✅ ATR-based stop & trailing logic
✅ Filters for session time, volume, and volatility
✅ Candle-body vs ATR size filter to avoid noise
✅ Optional cooldown between trades
Important Notes
Use bar close confirmation only (barstate.isconfirmed) to avoid repainting on lower timeframes.
Adjust commission (0.01–0.03%) and slippage (1–2 ticks) in Strategy Tester for realistic results.
Avoid low-liquidity hours (after 21:00 UTC for FX / after midnight for crypto).
Backtest using realistic broker data (e.g., BlackBull Markets / Bybit / Binance Futures).
Best results occur during London & New York sessions with moderate volatility.
⚠️ Disclaimer
This script is for educational and research purposes only.
It does not constitute financial advice.
Use proper risk management and test thoroughly before using on live accounts.
Developed by KING FX Labs
Built and optimized by Yousef Almasto — combining advanced price-action logic, multi-timeframe EMA structure, and volatility-adaptive ATR management.
Tested across Forex, Gold, and Crypto markets to ensure consistent performance and minimal drawdown.
📈 “Precision Trading. Zero Emotion. Pure Momentum.”
Institutional RSI Trendline Breakout StrategyKey Features:
1. RSI Trendline Detection
Automatically identifies RSI resistance (bearish) and support (bullish) trendlines
Requires minimum touch points for validation
Dynamic trendline calculation with configurable pivot lookback
2. Market Structure Analysis
Detects swing highs/lows to identify uptrends and downtrends
Combines multiple trend confirmation methods (swing structure + moving averages)
Visual background highlighting for trend confirmation
3. Breakout Signals
Buy Signal: RSI breaks above resistance trendline + bullish market structure
Sell Signal: RSI breaks below support trendline + bearish market structure
Configurable breakout threshold to avoid false signals
4. ATR-Based Stop Loss
Dynamic stop loss placement based on market volatility
Multiplier-adjustable for different risk profiles
Visual plotting of stop loss levels
5. Signal Filters
Volume filter to confirm breakout validity
RSI level filters to avoid extreme conditions
Multiple validation layers for institutional-grade accuracy
6. Professional Visualization
Clear buy/sell signal markers on chart
Information dashboard with real-time metrics
Trend background highlighting
Stop loss level indicators
7. Alert System
Ready-to-use alerts for both buy and sell signals
Includes entry price and stop loss in alert messages
This script provides institutional-grade signal quality with multiple confirmation layers, optimal risk management, and comprehensive market analysis.
XAUUSD M15 Supply & Demand + Entry/SL/TP + Alerts//@version=5
indicator("XAUUSD M15 Supply & Demand + Entry/SL/TP + Alerts", overlay=true)
// ======================
// 🔹 Demand Zones
// ======================
demand1_top = 3682
demand1_bottom = 3678
box.new(left=bar_index-50, top=demand1_top, right=bar_index+50, bottom=demand1_bottom,
bgcolor=color.new(color.green, 85), border_color=color.green)
demand2_top = 3665
demand2_bottom = 3660
box.new(left=bar_index-50, top=demand2_top, right=bar_index+50, bottom=demand2_bottom,
bgcolor=color.new(color.green, 85), border_color=color.green)
// ======================
// 🔺 Supply Zones
// ======================
supply1_top = 3695
supply1_bottom = 3690
box.new(left=bar_index-50, top=supply1_top, right=bar_index+50, bottom=supply1_bottom,
bgcolor=color.new(color.red, 85), border_color=color.red)
supply2_top = 3712
supply2_bottom = 3708
box.new(left=bar_index-50, top=supply2_top, right=bar_index+50, bottom=supply2_bottom,
bgcolor=color.new(color.red, 85), border_color=color.red)
// ======================
// 📍 Levels
// ======================
entry_price = 3680
sl_price = 3661
tp1_price = 3692
tp2_price = 3710
// ======================
// 🏷️ Labels
// ======================
label.new(bar_index, entry_price, text="ENTRY BUY 3680 ±2",
style=label.style_label_up, color=color.green, textcolor=color.white)
label.new(bar_index, sl_price, text="STOP LOSS 3661",
style=label.style_label_down, color=color.red, textcolor=color.white)
label.new(bar_index, tp1_price, text="TP1 3692-3695",
style=label.style_label_down, color=color.blue, textcolor=color.white)
label.new(bar_index, tp2_price, text="TP2 3708-3712",
style=label.style_label_down, color=color.blue, textcolor=color.white)
// ======================
// 🔔 Alerts
// ======================
// Entry Zone
inEntry = (low <= demand1_top and high >= demand1_bottom)
alertcondition(inEntry, title="Entry Zone Hit", message="XAUUSD masuk ENTRY BUY zone (3680±2)")
// Stop Loss
hitSL = (low <= sl_price)
alertcondition(hitSL, title="Stop Loss Hit", message="XAUUSD STOP LOSS kena di 3661 ❌")
// Take Profit 1
hitTP1 = (high >= tp1_price and high <= supply1_top)
alertcondition(hitTP1, title="TP1 Hit", message="XAUUSD TP1 tercapai ✅ (3692-3695)")
// Take Profit 2
hitTP2 = (high >= tp2_price and high <= supply2_top)
alertcondition(hitTP2, title="TP2 Hit", message="XAUUSD TP2 tercapai 🎯 (3708-3712)")
First week of the yearA very simple indicator that marks a channel on the candlestick for the first week of the year.
The channel can serve as an entry/exit point with a medium and long term focus.
Note: This indicator should be observed exclusively on the weekly timeframe.
OG Indicators - EnhancedA simple effort to combine William's % R, MACD & Stochastic into single script
Dynamic 21 SMA Zone S/R (Weekly and 2-Day)This custom indicator creates a dynamic support and resistance zone based on the 21-period Simple Moving Average (SMA) from the weekly timeframe and the 21-period SMA from the 2-day timeframe. The zone is visible and functional across all chart timeframes, adapting seamlessly to provide multi-timeframe insights.
Color Logic:
Green: When the current price is fully above the upper boundary of the zone, indicating potential bullish strength or a support level.
Gray: When the price is fully below the lower boundary, signaling potential bearish pressure or a resistance level.
Light Blue: When the price is within the zone (between the two SMAs), representing a neutral "no man's land" where the market is indecisive.
As the two SMAs converge or diverge, the zone naturally thins or widens, visually reflecting changes in market momentum—such as a thinning green zone during a potential reversal. Ideal for higher-timeframe swing trading to identify key levels, this indicator is also useful on lower timeframes for gauging the relative position of these SMAs, helping traders align short-term moves with broader trends.
VWAP Diario (línea negra en precio)It's just the 1D VWAP average line. It's used to determine when you're entering a bullish or bearish daily structure.
Cycle KROUFR Multi-Timeframejo wast eh, a boa zyklen über einander daun kennst die eh scho aus heast.
Doble Keltner ChannelTwo Keltner channels with different configurations. This will allow you to visualize volatility confluences and potential reversal zones.
Configuration
Ema period 1 = 50
Ema period 2 = 50
Multiplier 1 = 2.75
Multiplier 2 = 3.75
Quick Reversal Strategy - Bash Modrs//@version=5
indicator("Quick Reversal Strategy - Bash Modrs", overlay=true)
// === Moving Averages ===
ema9 = ta.ema(close, 9)
ema21 = ta.ema(close, 21)
// === RSI ===
rsi = ta.rsi(close, 14)
// === Bollinger Bands ===
basis = ta.sma(close, 20)
dev = ta.stdev(close, 20)
upper = basis + dev * 2
lower = basis - dev * 2
// === Volume ===
vol = volume
vol_avg = ta.sma(volume, 20)
vol_color = vol > vol_avg ? color.new(color.green, 0) : color.new(color.red, 0)
// === Plot Indicators ===
plot(ema9, color=color.yellow, linewidth=2, title="EMA 9")
plot(ema21, color=color.orange, linewidth=2, title="EMA 21")
plot(basis, color=color.blue, title="BB Basis")
plot(upper, color=color.new(color.blue, 50))
plot(lower, color=color.new(color.blue, 50))
plot(vol, color=vol_color, style=plot.style_columns, title="Volume")
// === Entry Conditions ===
longCond = ta.crossover(ema9, ema21) and rsi > 40 and rsi < 60
shortCond = ta.crossunder(ema9, ema21) and rsi > 40 and rsi < 60
// === Alerts ===
alertcondition(longCond, title="Buy Signal", message="🟢 Buy Signal - Quick Reversal Strategy")
alertcondition(shortCond, title="Sell Signal", message="🔴 Sell Signal - Quick Reversal Strategy")
// === Plot Signals on Chart ===
plotshape(longCond, title="Buy", location=location.belowbar, color=color.new(color.green, 0), style=shape.triangleup, size=size.large)
plotshape(shortCond, title="Sell", location=location.abovebar, color=color.new(color.red, 0), style=shape.triangledown, size=size.large)
Asia Risk MonitorAsia Risk Monitor for all those monitoring the financial situation in the US, looking for a clue of a move to the down or upside.
Bollinger Bands ±3σ (No Fill, Paired Colors)±3σまで1つのインジケーターで表示できるシンプルなボリンジャーバンドです。
A simple Bollinger Bands indicator that can display up to ±3σ within a single script.
Overextended vs 50DMA DetectorThis indicator helps traders identify when a stock or asset becomes statistically overextended relative to its 50-day moving average (50DMA) — a key signal for potential pullbacks, consolidations, or profit-taking zones.
⸻
🔍 What It Does
• Calculates the 50-day simple moving average (SMA) of price.
• Computes the percentage gap between current price and the 50DMA.
• Measures the standard deviation of that percentage gap to assess volatility-adjusted extremes.
• Flags the stock as “Overextended” when:
• Price is more than 20% above the 50DMA, and
• The % gap is greater than 3× its historical standard deviation.
When these conditions are met, the script:
• Highlights the candle with a 🚨 red triangle on the chart.
• Shades the background to indicate potential overheating.
• Triggers an alert condition so traders can be notified in real time.
ATR Regime Filter (median & P70)ATR Regime Filter (Median & P70)
Purpose
Filter your signals by the volatility regime. The indicator compares the current ATR to two rolling statistical thresholds—the median (P50) and the 70th percentile (P70)—to avoid trading during quiet phases and prioritize setups when the market “breathes.”
How it works
Computes ATR(14) on a user-defined source timeframe (srcTF) via request.security.
Converts a target window in days (days) into bars of the source TF.
Due to Pine limits, the effective window is capped at 5000 bars (shown in an optional label).
Calculates Median (P50) and P70 of ATR over the effective window.
Exposes two booleans:
ATR > Median (normal-to-elevated volatility)
ATR > P70 (elevated volatility)
Display
Plots: ATR, Median, P70.
Panel background (bgcolor):
light green when ATR > P70
teal when ATR > Median
neutral otherwise
Optional label: shows source TF, effective window size (bars & days), and the boolean states.
Inputs
ATR length (default 14)
TF source ATR (srcTF, e.g., “1”, “5”, “15”)
Target window (days) (days, default 20)
Show label (bool)
Suggested use
Breakout/Momentum: require ATR > P70 in addition to your breakout conditions (close beyond level, volume, retest).
Range/Mean reversion: at minimum require ATR > Median.
In strategies, use ATR > Median/P70 as a filter alongside price structure, volume, and EMAs.
Limitations
On very short source TFs (e.g., 1-min), the window may be clipped to 5000 bars (~3.5 days). Increase srcTF (5m/15m) if you want a true 15–30 day history.
ATR measures magnitude, not direction—combine with trend/structure signals.