EMA and MACD with Trailing Stop Loss (by Coinrule)An exponential moving average ( EMA ) is a type of moving average (MA) that places a greater weight and significance on the most recent data points. The exponential moving average is also referred to as the exponentially weighted moving average. An exponentially weighted moving average reacts more significantly to recent price changes than a simple moving average simple moving average ( SMA ), which applies an equal weight to all observations in the period.
Moving average convergence divergence ( MACD ) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The MACD is calculated by subtracting the 26-period exponential moving average ( EMA ) from the 12-period EMA.
The result of that calculation is the MACD line. A nine-day EMA of the MACD called the "signal line," is then plotted on top of the MACD line, which can function as a trigger for buy and sell signals. Traders may buy the security when the MACD crosses above its signal line and sell—or short—the security when the MACD crosses below the signal line. Moving average convergence divergence ( MACD ) indicators can be interpreted in several ways, but the more common methods are crossovers, divergences, and rapid rises/falls.
The Strategy enters and closes the trade when the following conditions are met:
LONG
The MACD histogram turns bearish
EMA7 is greater than EMA14
EXIT
Price increases 3% trailing
Price decreases 1% trailing
This strategy is back-tested from 1 January 2022 to simulate how the strategy would work in a bear market and provides good returns.
Pairs that produce very strong results include XRPUSDT on the 1-minute timeframe. This short timeframe means that this strategy opens and closes trades regularly
In order to further improve the strategy, the EMA can be changed from 7 and 14 to, say, EMA20 and EMA50. Furthermore, the trailing stop loss can also be changed to ideally suit the user to match their needs.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
Pesquisar nos scripts por "Trailing stop"
ATR Trailing Stop Loss [V5]A complete ATR Trailing Stop Loss in version 5.
Features Include:
Timeframe Option
Long/Short Triggers (Green/Red Triangles)
Long/Short Conditions (Bottom Colored Line)
"Golden" Long/Short Triggers (Yellow Triangles)(Hanging Man or Shooting Star Candlestick patterns breaking ATR trailing stop)
Alerts
PluePhantom's Trailing Stop Loss Multiple of ATRThis is a simple trailing stop loss line for long and short positions, made by Bluephantom using PS v2. I converted it onto v5
It is calculated as a multiple of the ATR instead of a percentage.
You are able to change the multiple and the ATR length.
It can be used as a guide to where you should consider putting in your stop loss on a trade and to where you should move your stop loss to as the days go by.
This indicator is experimental. Use at your own risk.
Rob Hoffman's 50/80/90/Price Trailing Stop LossA trailing stop loss method by Rob Hoffman.
Set your entry, TP, and SL.
Once price is 50% of its way to the TP, set your stop loss at the gray line.
Once price is 80% of its way to the TP, set your stop loss at the light gray line.
Once price is 90% of its way to the TP set your stop loss at the white line.
MA Trailing StopA Trailing Stop indicator that uses a multiple of ATR below a SMA/EMA line. Support long positions only.
Configurables:
1. Use SMA or EMA
2. MA Period
3. ATR multiplier
4. ATR look back period
The bottom of the red area indicates the stop line. The top of the red area indicates the reference MA line.
Ideal use case is you find your a red area that covers most local lows.
The stop line moves up with MA, but does not move down if MA moves down.
If moves down (re-calculates itself) only when a low penetrates the stop line.
Long Term Breakout entry + 25% Trailing stopThis script enters on a long term breakout and exits using a 25% trailing stop
Three Bar Exit Trailing Stop - Naked Forex: Price ActionThree Bar Exit Trailing Stop - Naked Forex: Exit indicator based on price action. The naked trader locks in profit by trailing the stop loss behind the lowest low of the last three candlesticks (for buy trades) or above the highest high of the last three candlesticks (For sell trades)
Simple Moving Average - ATR Trailing StopThe old adage goes "Cut losers fast and let the winners run"
With this in mind, this will plot a dynamic trailing stop by subtracting any multiplier of the Average True Range (ATR) from the SMA of your choice.
Linear Trailing StopBased on my latest script "Linear Channels"
This is a trailing stop version of the linear channels. Thanks to capissimo for helping me fix several issues with the linear extrapolation part.
In order to know how the indicator work i recommend reading the post on the Linear Channels indicator here
Hope you like it and feel free to leave your suggestions :)
Linear Regression (Backtest / Trailing Stop)A Strategy with Backtest and Trailing Stop for Long/Short
Credits: Study by RafaelZioni - Thanks buddy!
Progressive Profit Taking with Trailing StopThis is version 2 of
Special features:
Added partial profit taking as price rises. Profit taking is triggered by price crossing an EMA.
After profit taking, price has to rise by a user-specified percent before taking profits again.
Also includes condition for fully closing position after meeting specified profit target.
To incorporate into your algo, turn the plotshape functions into alertcondition.
Grover Llorens Activator [alexgrover & Lucía Llorens] Trailing stops play a key role in technical analysis and are extremely popular trend following indicators. Their main strength lie in their ability to minimize whipsaws while conserving a decent reactivity, the most popular ones include the Supertrend, Parabolic SAR and Gann Hilo activator. However, and like many indicators, most trailing stops assume an infinitely long trend, which penalize their ability to provide early exit points, this isn't the case of the parabolic SAR who take this into account and thus converge toward the price at an increasing speed the longer a trend last.
Today a similar indicator is proposed. From an original idea of alexgrover & Lucía Llorens who wanted to revisit the classic parabolic SAR indicator, the Llorens activator aim to converge toward the price the longer a trend persist, thus allowing for potential early and accurate exit points. The code make use of the idea behind the price curve channel that you can find here :
I tried to make the code as concise as possible.
The Indicator
The indicator posses 2 user settings, length and mult , length control the rate of convergence of the indicator, with higher values of length making the indicator output converge more slowly toward the price. Mult is also related with the rate of convergence, basically once the price cross the trailing stop its value will become equal to the previous trailing stop value plus/minus mult*atr depending on the previous trailing stop value, therefore higher values of mult will require more time for the trailing stop to reach the closing price, use higher values of mult if you want to avoid potential whipsaws.
Above the indicator with slow convergence time (high length) and low mult.
Points with early exit points are highlighted.
Usage For Oscillators
The difference between the closing price and an overlay indicator can provide an oscillator with characteristics depending on the indicators used for differencing, Lucía Llorens stated that we should find indicators for differencing that highlight the cycles in the price, in other terms : Price - Signal , where we want to find Signal such that we maximize the visibility of the cycles, it can be demonstrated that in the case where the closing price is an additive model : Trend + Cycles + Noise , the zero lag estimation of the Trend component can allow for the conservation of the cycle and noise component, that is : Price - Estimate(Trend) , for example the difference between the price and moving average isn't optimal because of the moving average lag, instead the use of zero lag moving averages is more suitable, however the proposed indicator allow for a surprisingly good representation of the cycles when using differencing.
The normalization of this oscillator (via the RSI) allow to make the peak amplitude of the cycles more constant. Note however that such method can return an output with a sign inverse to the one of the original cycle component.
Conclusion
We proposed an indicator which share the logic of the SAR indicator, that is using convergence toward the price in order to provide early exit points detection. We have seen that this indicator can be used to highlight cycles when used for differencing and i don't exclude publishing more indicators based on this method.
Lucía Llorens has been a great person to work with, and provided enormous feedback and support while i was coding the indicator, this is why i include her in the indicator name as well as copyright notice. I hope we can make more indicators togethers in the future.
(altho i was against using buy/sells labels xD !)
Thanks for reading !
Trailing Stop Loss ATR + AlertI share this TSL indicator with alert (I use it only for Stocks), the configuration is very simple, you must select if it is a Short or Long operation, time at which the operation was opened,% of the daily ATR for TSL. It also contains:
- Alert
- Panel Info
Trailing Stop LossThis script demonstrate how to make a Training Stop Loss to "ride the wave". In comparison to classic Stop Loss this strategy follows the price upwards (for long positions) and when price drops by a fixed percentage then you exit your position.
atr_idemaTrailing stop indicator.
Trail when the top/bottom green line appears (with that line value as stop price).
PivotBoss VWAP Bands (Auto TF) - FixedWhat this indicator shows (high level)
The indicator plots a VWAP line and three bands above (R1, R2, R3) and three bands below (S1, S2, S3).
Band spacing is computed from STD(abs(VWAP − price), N) and multiplied by 1, 2 and 3 to form R1–R3 / S1–S3. The script is timeframe-aware: on 30m/1H charts it uses Weekly VWAP and weekly bands; on Daily charts it uses Monthly VWAP and monthly bands; otherwise it uses the session/chart VWAP.
VWAP = the market’s volume-weighted average price (a measure of fair value). Bands = volatility-scaled zones around that fair value.
Trading idea — concept summary
VWAP = fair value. Price above VWAP implies bullish bias; below VWAP implies bearish bias.
Bands = graded overbought/oversold zones. R1/S1 are near-term limits, R2/S2 are stronger, R3/S3 are extreme.
Use trend alignment + price action + volume to choose higher-probability trades. VWAP bands give location and magnitude; confirmations reduce false signals.
Entry rules (multiple strategies with examples)
A. Momentum breakout (trend-following) — preferred on trending markets
Setup: Price consolidates near or below R1 and then closes above R1 with above-average volume. Chart: 30m/1H (Weekly VWAP) or Daily (Monthly VWAP) depending on your timeframe.
Entry: Enter long at the close of the breakout bar that closes above R1.
Stop-loss: Place initial stop below the higher of (VWAP or recent swing low). Example: if price broke R1 at ₹1,200 and VWAP = ₹1,150, set stop at ₹1,145 (5 rupee buffer below VWAP) or below the last swing low if that is wider.
Target: Partial target at R2, full target at R3. Trail stop to VWAP or to R1 after price reaches R2.
Example numeric: Weekly VWAP = ₹1,150, R1 = ₹1,200, R2 = ₹1,260. Buy at ₹1,205 (close above R1), stop ₹1,145, target1 ₹1,260 (R2), target2 ₹1,320 (R3).
B. Mean-reversion fade near bands — for range-bound markets
Setup: Market is not trending (VWAP flatish). Price rallies up to R2 or R3 and shows rejection (pin bar, bearish engulfing) on increasing or neutral volume.
Entry: Enter short after a confirmed rejection candle that fails to sustain above R2 or R3 (prefer confirmation: close back below R1 or below the rejection candle low).
Stop-loss: Just above the recent high (e.g., 1–2 ATR or a fixed buffer above R2/R3).
Target: First target VWAP, second target S1. Reduce size if taking R3 fade as it’s an extreme.
Example numeric: VWAP = ₹950, R2 = ₹1,020. Price spikes to ₹1,025 and forms a bearish engulfing candle. Enter short at ₹1,015 after the next close below ₹1,020. Stop at ₹1,035, target VWAP ₹950.
C. Pullback entries in trending markets — higher probability
Setup: Price is above VWAP and trending higher (higher highs and higher lows). Price pulls back toward VWAP or S1 with decreasing downside volume and a reversal candle forms.
Entry: Long when price forms a bullish reversal (hammer/inside-bar) with a close back above the pullback candle.
Stop-loss: Below the pullback low (or below S2 if a larger stop is justified).
Target: VWAP then R1; if momentum resumes, trail toward R2/R3.
Example numeric: Price trending above Weekly VWAP at ₹1,400; pullback to S1 at ₹1,360. Enter long at ₹1,370 when a bullish candle closes; stop at ₹1,350; first target VWAP ₹1,400, second target R1 ₹1,450.
Exit rules and money management
Basic exit hierarchy
Hard stop exit — when price hits initial stop-loss. Always use.
Target exit — take partial profits at R1/R2 (for longs) or S1/S2 (for shorts). Use trailing stops for the remainder.
VWAP invalidation — if you entered long above VWAP and price returns and closes significantly below VWAP, consider exiting (condition depends on timeframe and trade size).
Price action exit — reversal patterns (strong opposite candle, bearish/bullish engulfing) near targets or beyond signals to exit.
Trailing rules
After price reaches R2, move stop to breakeven + a small buffer or to VWAP.
After price reaches R3, trail by 1 ATR or lock a defined profit percentage.
Position sizing & risk
Risk per trade: commonly 0.5–2% of account equity.
Determine position size by RiskAmount ÷ (EntryPrice − StopPrice).
If the stop distance is large (e.g., trading R3 fades), reduce position size.
Filters & confirmation (to reduce false signals)
Volume filter: For breakouts, require volume above short-term average (e.g., >20-period average). Breakouts on low volume are suspect.
Trend filter: Only take breakouts in the direction of the higher-timeframe trend (for example, use Daily/Weekly trend when trading 30m/1H).
Candle confirmation: Prefer entries on close of the confirming candle (not intrabar noise).
Multiple confirmations: When R1 break happens but RSI/plotted momentum indicator does not confirm, treat signal as lower probability.
Special considerations for timeframe-aware logic
On 30m/1H the script uses Weekly VWAP/bands. That means band levels change only on weekly candles — they are strong, structural levels. Treat R1/R2/R3 as significant and expect fewer, stronger signals.
On Daily, the script uses Monthly VWAP/bands. These are wider; trades should allow larger stops and smaller position sizes (or be used for swing trades).
On other intraday charts you get session VWAP (useful for intraday scalps).
Example: If you trade 1H and the Weekly R1 is at ₹2,400 while session VWAP is ₹2,350, a close above Weekly R1 represents a weekly-level breakout — prefer that for swing entries rather than scalps.
Example trade walkthrough (step-by-step)
Context: 1H chart, auto-mapped → Weekly VWAP used.
Weekly VWAP = ₹3,000; R1 = ₹3,080; R2 = ₹3,150.
Price consolidates below R1. A large bullish candle closes at ₹3,085 with volume 40% above the 20-bar average.
Entry: Buy at close ₹3,085.
Stop: Place stop at ₹2,995 (just under Weekly VWAP). Risk = ₹90.
Position size: If risking ₹900 per trade → size = 900 ÷ 90 = 10 units.
Targets: Partial take-profit at R2 = ₹3,150; rest trailed with stop moved to breakeven after R2 is hit.
If price reverses and closes below VWAP within two bars, exit immediately to limit drawdown.
When to avoid trading these signals
High-impact news (earnings, macro announcements) that can gap through bands unpredictably.
Thin markets with low volume — VWAP loses significance when volumes are extremely low.
When weekly/monthly bands are flat but intraday price is volatile without clear structure — prefer session VWAP on smaller timeframes.
Alerts & automation suggestions
Alert on close above R1 / below S1 (use the built-in alertcondition the script adds). For higher-confidence alerts, require volume filter in the alert condition.
Automated order rules (if you automate): use limit entry at breakout close plus a small slippage buffer, immediate stop order, and OCO for TP and SL.
Luxy Super-Duper SuperTrend Predictor Engine and Buy/Sell signalA professional trend-following grading system that analyzes historical trend
patterns to provide statistical duration estimates using advanced similarity
matching and k-nearest neighbors analysis. Combines adaptive Supertrend with
intelligent duration statistics, multi-timeframe confluence, volume confirmation,
and quality scoring to identify high-probability setups with data-driven
target ranges across all timeframes.
Note: All duration estimates are statistical calculations based on historical data, not guarantees of future performance.
WHAT MAKES THIS DIFFERENT
Unlike traditional SuperTrend indicators that only tell you trend direction, this system answers the critical question: "What is the typical duration for trends like this?"
The Statistical Analysis Engine:
• Analyzes your chart's last 15+ completed SuperTrend trends (bullish and bearish separately)
• Uses k-nearest neighbors similarity matching to find historically similar setups
• Calculates statistical duration estimates based on current market conditions
• Learns from estimation errors and adapts over time (Advanced mode)
• Displays visual duration analysis box showing median, average, and range estimates
• Tracks Statistical accuracy with backtest statistics
Complete Trading System:
• Statistical trend duration analysis with three intelligence levels
• Adaptive Supertrend with dynamic ATR-based bands
• Multi-timeframe confluence analysis (6 timeframes: 5M to 1W)
• Volume confirmation with spike detection and momentum tracking
• Quality scoring system (0-70 points) rating each setup
• One-click preset optimization for all trading styles
• Anti-repaint guarantee on all signals and duration estimates
METHODOLOGY CREDITS
This indicator's approach is inspired by proven trading methodologies from respected market educators:
• Mark Minervini - Volatility Contraction Pattern (VCP) and pullback entry techniques
• William O'Neil - Volume confirmation principles and institutional buying patterns (CANSLIM methodology)
• Dan Zanger - Volatility expansion entries and momentum breakout strategies
Important: These are educational references only. This indicator does not guarantee any specific trading results. Always conduct your own analysis and risk management.
KEY FEATURES
1. TREND DURATION ANALYSIS SYSTEM - The Core Innovation
The statistical analysis engine is what sets this indicator apart from standard SuperTrend systems. It doesn't just identify trend changes - it provides statistical analysis of potential duration.
How It Works:
Step 1: Historical Tracking
• Automatically records every completed SuperTrend trend (duration in bars)
• Maintains separate databases for bullish trends and bearish trends
• Stores up to 15 most recent trends of each type
• Captures market conditions at each trend flip: volume ratio, ATR ratio, quality score, price distance from SuperTrend, proximity to support/resistance
Step 2: Similarity Matching (k-Nearest Neighbors)
• When new trend begins, system compares current conditions to ALL historical flips
• Calculates similarity score based on:
- Volume similarity (30% weight) - Is volume behaving similarly?
- Volatility similarity (30% weight) - Is ATR/volatility similar?
- Quality similarity (20% weight) - Is setup strength comparable?
- Distance similarity (10% weight) - Is price distance from ST similar?
- Support/Resistance proximity (10% weight) - Similar structural context?
• Selects the 15 MOST SIMILAR historical trends (not just all trends)
• This is like asking: "When conditions looked like this before, how long did trends last?"
Step 3: Statistical Analysis
• Calculates median duration (most common outcome)
• Calculates average duration (mean of similar trends)
• Determines realistic range (min to max of similar trends)
• Applies exponential weighting (recent trends weighted more heavily)
• Outputs confidence-weighted statistical estimate
Step 4: Advanced Intelligence (Advanced Mode Only)
The Advanced mode applies five sophisticated multipliers to refine estimates:
A) Market Structure Multiplier (±30%):
• Detects nearby support/resistance levels using pivot detection
• If flip occurs NEAR a key level: Estimate adjusted -30% (expect bounce/rejection)
• If flip occurs in open space: Estimate adjusted +30% (clear path for continuation)
• Uses configurable lookback period and ATR-based proximity threshold
B) Asset Type Multiplier (±40%):
• Adjusts duration estimates based on asset volatility characteristics
• Small Cap / Biotech: +40% (explosive, extended moves)
• Tech Growth: +20% (momentum-driven, longer trends)
• Blue Chip / Large Cap: 0% (baseline, steady trends)
• Dividend / Value: -20% (slower, grinding trends)
• Cyclical: Variable based on macro regime
• Crypto / High Volatility: +30% (parabolic potential)
C) Flip Strength Multiplier (±20%):
• Analyzes the QUALITY of the trend flip itself
• Strong flip (high volume + expanding ATR + quality score 60+): +20%
• Weak flip (low volume + contracting ATR + quality score under 40): -20%
• Logic: Historical data shows that powerful flips tend to be followed by longer trends
D) Error Learning Multiplier (±15%):
• Tracks Statistical accuracy over last 10 completed trends
• Calculates error ratio: (estimated duration / Actual Duration)
• If system consistently over-estimates: Apply -15% correction
• If system consistently under-estimates: Apply +15% correction
• Learns and adapts to current market regime
E) Regime Detection Multiplier (±20%):
• Analyzes last 3 trends of SAME TYPE (bull-to-bull or bear-to-bear)
• Compares recent trend durations to historical average
• If recent trends 20%+ longer than average: +20% adjustment (trending regime detected)
• If recent trends 20%+ shorter than average: -20% adjustment (choppy regime detected)
• Detects whether market is in trending or mean-reversion mode
Three analysis modes:
SIMPLE MODE - Basic Statistics
• Uses raw median of similar trends only
• No multipliers, no adjustments
• Best for: Beginners, clean trending markets
• Fastest calculations, minimal complexity
STANDARD MODE - Full Statistical Analysis
• Similarity matching with k-nearest neighbors
• Exponential weighting of recent trends
• Median, average, and range calculations
• Best for: Most traders, general market conditions
• Balance of accuracy and simplicity
ADVANCED MODE - Statistics + Intelligence
• Everything in Standard mode PLUS
• All 5 advanced multipliers (structure, asset type, flip strength, learning, regime)
• Highest Statistical accuracy in testing
• Best for: Experienced traders, volatile/complex markets
• Maximum intelligence, most adaptive
Visual Duration Analysis Box:
When a new trend begins (SuperTrend flip), a box appears on your chart showing:
• Analysis Mode (Simple / Standard / Advanced)
• Number of historical trends analyzed
• Median expected duration (most likely outcome)
• Average expected duration (mean of similar trends)
• Range (minimum to maximum from similar trends)
• Advanced multipliers breakdown (Advanced mode only)
• Backtest accuracy statistics (if available)
The box extends from the flip bar to the estimated endpoint based on historical data, giving you a visual target for trend duration. Box updates in real-time as trend progresses.
Backtest & Accuracy Tracking:
• System backtests its own duration estimates using historical data
• Shows accuracy metrics: how well duration estimates matched actual durations
• Tracks last 10 completed duration estimates separately
• Displays statistics in dashboard and duration analysis boxes
• Helps you understand statistical reliability on your specific symbol/timeframe
Anti-Repaint Guarantee:
• duration analysis boxes only appear AFTER bar close (barstate.isconfirmed)
• Historical duration estimates never disappear or change
• What you see in history is exactly what you would have seen real-time
• No future data leakage, no lookahead bias
2. INTELLIGENT PRESET CONFIGURATIONS - One-Click Optimization
Unlike indicators that require tedious parameter tweaking, this system includes professionally optimized presets for every trading style. Select your approach from the dropdown and ALL parameters auto-configure.
"AUTO (DETECT FROM TF)" - RECOMMENDED
The smartest option: automatically selects optimal settings based on your chart timeframe.
• 1m-5m charts → Scalping preset (ATR: 7, Mult: 2.0)
• 15m-1h charts → Day Trading preset (ATR: 10, Mult: 2.5)
• 2h-4h-D charts → Swing Trading preset (ATR: 14, Mult: 3.0)
• W-M charts → Position Trading preset (ATR: 21, Mult: 4.0)
Benefits:
• Zero configuration - works immediately
• Always matched to your timeframe
• Switch timeframe = automatic adjustment
• Perfect for traders who use multiple timeframes
"SCALPING (1-5M)" - Ultra-Fast Signals
Optimized for: 1-5 minute charts, high-frequency trading, quick profits
Target holding period: Minutes to 1-2 hours maximum
Best markets: High-volume stocks, major crypto pairs, active futures
Parameter Configuration:
• Supertrend: ATR 7, Multiplier 2.0 (very sensitive)
• Volume: MA 10, High 1.8x, Spike 3.0x (catches quick surges)
• Volume Momentum: AUTO-DISABLED (too restrictive for fast scalping)
• Quality minimum: 40 points (accepts more setups)
• Duration Analysis: Uses last 15 trends with heavy recent weighting
Trading Logic:
Speed over precision. Short ATR period and low multiplier create highly responsive SuperTrend. Volume momentum filter disabled to avoid missing fast moves. Quality threshold relaxed to catch more opportunities in rapid market conditions.
Signals per session: 5-15 typically
Hold time: Minutes to couple hours
Best for: Active traders with fast execution
"DAY TRADING (15M-1H)" - Balanced Approach
Optimized for: 15-minute to 1-hour charts, intraday moves, session-based trading
Target holding period: 30 minutes to 8 hours (within trading day)
Best markets: Large-cap stocks, major indices, established crypto
Parameter Configuration:
• Supertrend: ATR 10, Multiplier 2.5 (balanced)
• Volume: MA 20, High 1.5x, Spike 2.5x (standard detection)
• Volume Momentum: 5/20 periods (confirms intraday strength)
• Quality minimum: 50 points (good setups preferred)
• Duration Analysis: Balanced weighting of recent vs historical
Trading Logic:
The most balanced configuration. ATR 10 with multiplier 2.5 provides steady trend following that avoids noise while catching meaningful moves. Volume momentum confirms institutional participation without being overly restrictive.
Signals per session: 2-5 typically
Hold time: 30 minutes to full day
Best for: Part-time and full-time active traders
"SWING TRADING (4H-D)" - Trend Stability
Optimized for: 4-hour to Daily charts, multi-day holds, trend continuation
Target holding period: 2-15 days typically
Best markets: Growth stocks, sector ETFs, trending crypto, commodity futures
Parameter Configuration:
• Supertrend: ATR 14, Multiplier 3.0 (stable)
• Volume: MA 30, High 1.3x, Spike 2.2x (accumulation focus)
• Volume Momentum: 10/30 periods (trend stability)
• Quality minimum: 60 points (high-quality setups only)
• Duration Analysis: Favors consistent historical patterns
Trading Logic:
Designed for substantial trend moves while filtering short-term noise. Higher ATR period and multiplier create stable SuperTrend that won't flip on minor corrections. Stricter quality requirements ensure only strongest setups generate signals.
Signals per week: 2-5 typically
Hold time: Days to couple weeks
Best for: Part-time traders, swing style
"POSITION TRADING (D-W)" - Long-Term Trends
Optimized for: Daily to Weekly charts, major trend changes, portfolio allocation
Target holding period: Weeks to months
Best markets: Blue-chip stocks, major indices, established cryptocurrencies
Parameter Configuration:
• Supertrend: ATR 21, Multiplier 4.0 (very stable)
• Volume: MA 50, High 1.2x, Spike 2.0x (long-term accumulation)
• Volume Momentum: 20/50 periods (major trend confirmation)
• Quality minimum: 70 points (excellent setups only)
• Duration Analysis: Heavy emphasis on multi-year historical data
Trading Logic:
Conservative approach focusing on major trend changes. Extended ATR period and high multiplier create SuperTrend that only flips on significant reversals. Very strict quality filters ensure signals represent genuine long-term opportunities.
Signals per month: 1-2 typically
Hold time: Weeks to months
Best for: Long-term investors, set-and-forget approach
"CUSTOM" - Advanced Configuration
Purpose: Complete manual control for experienced traders
Use when: You understand the parameters and want specific optimization
Best for: Testing new approaches, unusual market conditions, specific instruments
Full control over:
• All SuperTrend parameters
• Volume thresholds and momentum periods
• Quality scoring weights
• analysis mode and multipliers
• Advanced features tuning
Preset Comparison Quick Reference:
Chart Timeframe: Scalping (1M-5M) | Day Trading (15M-1H) | Swing (4H-D) | Position (D-W)
Signals Frequency: Very High | High | Medium | Low
Hold Duration: Minutes | Hours | Days | Weeks-Months
Quality Threshold: 40 pts | 50 pts | 60 pts | 70 pts
ATR Sensitivity: Highest | Medium | Lower | Lowest
Time Investment: Highest | High | Medium | Lowest
Experience Level: Expert | Advanced | Intermediate | Beginner+
3. QUALITY SCORING SYSTEM (0-70 Points)
Every signal is rated in real-time across three dimensions:
Volume Confirmation (0-30 points):
• Volume Spike (2.5x+ average): 30 points
• High Volume (1.5x+ average): 20 points
• Above Average (1.0x+ average): 10 points
• Below Average: 0 points
Volatility Assessment (0-30 points):
• Expanding ATR (1.2x+ average): 30 points
• Rising ATR (1.0-1.2x average): 15 points
• Contracting/Stable ATR: 0 points
Volume Momentum (0-10 points):
• Strong Momentum (1.2x+ ratio): 10 points
• Rising Momentum (1.0-1.2x ratio): 5 points
• Weak/Neutral Momentum: 0 points
Score Interpretation:
60-70 points - EXCELLENT:
• All factors aligned
• High conviction setup
• Maximum position size (within risk limits)
• Primary trading opportunities
45-59 points - STRONG:
• Multiple confirmations present
• Above-average setup quality
• Standard position size
• Good trading opportunities
30-44 points - GOOD:
• Basic confirmations met
• Acceptable setup quality
• Reduced position size
• Wait for additional confirmation or trade smaller
Below 30 points - WEAK:
• Minimal confirmations
• Low probability setup
• Consider passing
• Only for aggressive traders in strong trends
Only signals meeting your minimum quality threshold (configurable per preset) generate alerts and labels.
4. MULTI-TIMEFRAME CONFLUENCE ANALYSIS
The system can simultaneously analyze trend alignment across 6 timeframes (optional feature):
Timeframes analyzed:
• 5-minute (scalping context)
• 15-minute (intraday momentum)
• 1-hour (day trading bias)
• 4-hour (swing context)
• Daily (primary trend)
• Weekly (macro trend)
Confluence Interpretation:
• 5-6/6 aligned - Very strong multi-timeframe agreement (highest confidence)
• 3-4/6 aligned - Moderate agreement (standard setup)
• 1-2/6 aligned - Weak agreement (caution advised)
Dashboard shows real-time alignment count with color-coding. Higher confluence typically correlates with longer, stronger trends.
5. VOLUME MOMENTUM FILTER - Institutional Money Flow
Unlike traditional volume indicators that just measure size, Volume Momentum tracks the RATE OF CHANGE in volume:
How it works:
• Compares short-term volume average (fast period) to long-term average (slow period)
• Ratio above 1.0 = Volume accelerating (money flowing IN)
• Ratio above 1.2 = Strong acceleration (institutional participation likely)
• Ratio below 0.8 = Volume decelerating (money flowing OUT)
Why it matters:
• Confirms trend with actual money flow, not just price
• Leading indicator (volume often leads price)
• Catches accumulation/distribution before breakouts
• More intuitive than complex mathematical filters
Integration with signals:
• Optional filter - can be enabled/disabled per preset
• When enabled: Only signals with rising volume momentum fire
• AUTO-DISABLED in Scalping mode (too restrictive for fast trading)
• Configurable fast/slow periods per trading style
6. ADAPTIVE SUPERTREND MULTIPLIER
Traditional SuperTrend uses fixed ATR multiplier. This system dynamically adjusts the multiplier (0.8x to 1.2x base) based on:
• Trend Strength: Price correlation over lookback period
• Volume Weight: Current volume relative to average
Benefits:
• Tighter bands in calm markets (less premature exits)
• Wider bands in volatile conditions (avoids whipsaws)
• Better adaptation to biotech, small-cap, and crypto volatility
• Optional - can be disabled for classic constant multiplier
7. VISUAL GRADIENT RIBBON
26-layer exponential gradient fill between price and SuperTrend line provides instant visual trend strength assessment:
Color System:
• Green shades - Bullish trend + volume confirmation (strongest)
• Blue shades - Bullish trend, normal volume
• Orange shades - Bearish trend + volume confirmation
• Red shades - Bearish trend (weakest)
Opacity varies based on:
• Distance from SuperTrend (farther = more opaque)
• Volume intensity (higher volume = stronger color)
The ribbon provides at-a-glance trend strength without cluttering your chart. Can be toggled on/off.
8. INTELLIGENT ALERT SYSTEM
Two-tier alert architecture for flexibility:
Automatic Alerts:
• Fire automatically on BUY and SELL signals
• Include full context: quality score, volume state, volume momentum
• One alert per bar close (alert.freq_once_per_bar_close)
• Message format: "BUY: Supertrend bullish + Quality: 65/70 | Volume: HIGH | Vol Momentum: STRONG (1.35x)"
Customizable Alert Conditions:
• Appear in TradingView's "Create Alert" dialog
• Three options: BUY Signal Only, SELL Signal Only, ANY Signal (BUY or SELL)
• Use TradingView placeholders: {{ticker}}, {{interval}}, {{close}}, {{time}}
• Fully customizable message templates
All alerts use barstate.isconfirmed - Zero repaint guarantee.
9. ANTI-REPAINT ARCHITECTURE
Every component guaranteed non-repainting:
• Entry signals: Only appear after bar close
• duration analysis boxes: Created only on confirmed SuperTrend flips
• Informative labels: Wait for bar confirmation
• Alerts: Fire once per closed bar
• Multi-timeframe data: Uses lookahead=barmerge.lookahead_off
What you see in history is exactly what you would have seen in real-time. No disappearing signals, no changed duration estimates.
HOW TO USE THE INDICATOR
QUICK START - 3 Steps to Trading:
Step 1: Select Your Trading Style
Open indicator settings → "Quick Setup" section → Trading Style Preset dropdown
Options:
• Auto (Detect from TF) - RECOMMENDED: Automatically configures based on your chart timeframe
• Scalping (1-5m) - For 1-5 minute charts, ultra-fast signals
• Day Trading (15m-1h) - For 15m-1h charts, balanced approach
• Swing Trading (4h-D) - For 4h-Daily charts, trend stability
• Position Trading (D-W) - For Daily-Weekly charts, long-term trends
• Custom - Manual configuration (advanced users only)
Choose "Auto" and you're done - all parameters optimize automatically.
Step 2: Understand the Signals
BUY Signal (Green Triangle Below Price):
• SuperTrend flipped bullish
• Quality score meets minimum threshold (varies by preset)
• Volume confirmation present (if filter enabled)
• Volume momentum rising (if filter enabled)
• duration analysis box shows expected trend duration
SELL Signal (Red Triangle Above Price):
• SuperTrend flipped bearish
• Quality score meets minimum threshold
• Volume confirmation present (if filter enabled)
• Volume momentum rising (if filter enabled)
• duration analysis box shows expected trend duration
Duration Analysis Box:
• Appears at SuperTrend flip (start of new trend)
• Shows median, average, and range duration estimates
• Extends to estimated endpoint based on historical data visually
• Updates mode-specific intelligence (Simple/Standard/Advanced)
Step 3: Use the Dashboard for Context
Dashboard (top-right corner) shows real-time metrics:
• Row 1 - Quality Score: Current setup rating (0-70)
• Row 2 - SuperTrend: Direction and current level
• Row 3 - Volume: Status (Spike/High/Normal/Low) with color
• Row 4 - Volatility: State (Expanding/Rising/Stable/Contracting)
• Row 5 - Volume Momentum: Ratio and trend
• Row 6 - Duration Statistics: Accuracy metrics and track record
Every cell has detailed tooltip - hover for full explanations.
SIGNAL INTERPRETATION BY QUALITY SCORE:
Excellent Setup (60-70 points):
• Quality Score: 60-70
• Volume: Spike or High
• Volatility: Expanding
• Volume Momentum: Strong (1.2x+)
• MTF Confluence (if enabled): 5-6/6
• Action: Primary trade - maximum position size (within risk limits)
• Statistical reliability: Highest - duration estimates most accurate
Strong Setup (45-59 points):
• Quality Score: 45-59
• Volume: High or Above Average
• Volatility: Rising
• Volume Momentum: Rising (1.0-1.2x)
• MTF Confluence (if enabled): 3-4/6
• Action: Standard trade - normal position size
• Statistical reliability: Good - duration estimates reliable
Good Setup (30-44 points):
• Quality Score: 30-44
• Volume: Above Average
• Volatility: Stable or Rising
• Volume Momentum: Neutral to Rising
• MTF Confluence (if enabled): 3-4/6
• Action: Cautious trade - reduced position size, wait for additional confirmation
• Statistical reliability: Moderate - duration estimates less certain
Weak Setup (Below 30 points):
• Quality Score: Below 30
• Volume: Low or Normal
• Volatility: Contracting or Stable
• Volume Momentum: Weak
• MTF Confluence (if enabled): 1-2/6
• Action: Pass or wait for improvement
• Statistical reliability: Low - duration estimates unreliable
USING duration analysis boxES FOR TRADE MANAGEMENT:
Entry Timing:
• Enter on SuperTrend flip (signal bar close)
• duration analysis box appears simultaneously
• Note the median duration - this is your expected hold time
Profit Targets:
• Conservative: Use MEDIAN duration as profit target (50% probability)
• Moderate: Use AVERAGE duration (mean of similar trends)
• Aggressive: Aim for MAX duration from range (best historical outcome)
Position Management:
• Scale out at median duration (take partial profits)
• Trail stop as trend extends beyond median
• Full exit at average duration or SuperTrend flip (whichever comes first)
• Re-evaluate if trend exceeds estimated range
analysis mode Selection:
• Simple: Clean trending markets, beginners, minimal complexity
• Standard: Most markets, most traders (recommended default)
• Advanced: Volatile markets, complex instruments, experienced traders seeking highest accuracy
Asset Type Configuration (Advanced Mode):
If using Advanced analysis mode, configure Asset Type for optimal accuracy:
• Small Cap: Stocks under $2B market cap, low liquidity
• Biotech / Speculative: Clinical-stage pharma, penny stocks, high-risk
• Blue Chip / Large Cap: S&P 500, mega-cap tech, stable large companies
• Tech Growth: High-growth tech (TSLA, NVDA, growth SaaS)
• Dividend / Value: Dividend aristocrats, value stocks, utilities
• Cyclical: Energy, materials, industrials (macro-driven)
• Crypto / High Volatility: Bitcoin, altcoins, highly volatile assets
Correct asset type selection improves Statistical accuracy by 15-20%.
RISK MANAGEMENT GUIDELINES:
1. Stop Loss Placement:
Long positions:
• Place stop below recent swing low OR
• Place stop below SuperTrend level (whichever is tighter)
• Use 1-2 ATR distance as guideline
• Recommended: SuperTrend level (built-in volatility adjustment)
Short positions:
• Place stop above recent swing high OR
• Place stop above SuperTrend level (whichever is tighter)
• Use 1-2 ATR distance as guideline
• Recommended: SuperTrend level
2. Position Sizing by Quality Score:
• Excellent (60-70): Maximum position size (2% risk per trade)
• Strong (45-59): Standard position size (1.5% risk per trade)
• Good (30-44): Reduced position size (1% risk per trade)
• Weak (Below 30): Pass or micro position (0.5% risk - learning trades only)
3. Exit Strategy Options:
Option A - Statistical Duration-Based Exit:
• Exit at median estimated duration (conservative)
• Exit at average estimated duration (moderate)
• Trail stop beyond average duration (aggressive)
Option B - Signal-Based Exit:
• Exit on opposite signal (SELL after BUY, or vice versa)
• Exit on SuperTrend flip (trend reversal)
• Exit if quality score drops below 30 mid-trend
Option C - Hybrid (Recommended):
• Take 50% profit at median estimated duration
• Trail stop on remaining 50% using SuperTrend as trailing level
• Full exit on SuperTrend flip or quality collapse
4. Trade Filtering:
For higher win-rate (fewer trades, better quality):
• Increase minimum quality score (try 60 for swing, 50 for day trading)
• Enable volume momentum filter (ensure institutional participation)
• Require higher MTF confluence (5-6/6 alignment)
• Use Advanced analysis mode with appropriate asset type
For more opportunities (more trades, lower quality threshold):
• Decrease minimum quality score (40 for day trading, 35 for scalping)
• Disable volume momentum filter
• Lower MTF confluence requirement
• Use Simple or Standard analysis mode
SETTINGS OVERVIEW
Quick Setup Section:
• Trading Style Preset: Auto / Scalping / Day Trading / Swing / Position / Custom
Dashboard & Display:
• Show Dashboard (ON/OFF)
• Dashboard Position (9 options: Top/Middle/Bottom + Left/Center/Right)
• Text Size (Auto/Tiny/Small/Normal/Large/Huge)
• Show Ribbon Fill (ON/OFF)
• Show SuperTrend Line (ON/OFF)
• Bullish Color (default: Green)
• Bearish Color (default: Red)
• Show Entry Labels - BUY/SELL signals (ON/OFF)
• Show Info Labels - Volume events (ON/OFF)
• Label Size (Auto/Tiny/Small/Normal/Large/Huge)
Supertrend Configuration:
• ATR Length (default varies by preset: 7-21)
• ATR Multiplier Base (default varies by preset: 2.0-4.0)
• Use Adaptive Multiplier (ON/OFF) - Dynamic 0.8x-1.2x adjustment
• Smoothing Factor (0.0-0.5) - EMA smoothing applied to bands
• Neutral Bars After Flip (0-10) - Hide ST immediately after flip
Volume Momentum:
• Enable Volume Momentum Filter (ON/OFF)
• Fast Period (default varies by preset: 3-20)
• Slow Period (default varies by preset: 10-50)
Volume Analysis:
• Volume MA Length (default varies by preset: 10-50)
• High Volume Threshold (default: 1.5x)
• Spike Threshold (default: 2.5x)
• Low Volume Threshold (default: 0.7x)
Quality Filters:
• Minimum Quality Score (0-70, varies by preset)
• Require Volume Confirmation (ON/OFF)
Trend Duration Analysis:
• Show Duration Analysis (ON/OFF) - Display duration analysis boxes
• analysis mode - Simple / Standard / Advanced
• Asset Type - 7 options (Small Cap, Biotech, Blue Chip, Tech Growth, Dividend, Cyclical, Crypto)
• Use Exponential Weighting (ON/OFF) - Recent trends weighted more
• Decay Factor (0.5-0.99) - How much more recent trends matter
• Structure Lookback (3-30) - Pivot detection period for support/resistance
• Proximity Threshold (xATR) - How close to level qualifies as "near"
• Enable Error Learning (ON/OFF) - System learns from estimation errors
• Memory Depth (3-20) - How many past errors to remember
Box Visual Settings:
• duration analysis box Border Color
• duration analysis box Background Color
• duration analysis box Text Color
• duration analysis box Border Width
• duration analysis box Transparency
Multi-Timeframe (Optional Feature):
• Enable MTF Confluence (ON/OFF)
• Minimum Alignment Required (0-6)
• Individual timeframe enable/disable toggles
• Custom timeframe selection options
All preset configurations override manual inputs except when "Custom" is selected.
ADVANCED FEATURES
1. Scalpel Mode (Optional)
Advanced pullback entry system that waits for healthy retracements within established trends before signaling entry:
• Monitors price distance from SuperTrend levels
• Requires pullback to configurable range (default: 30-50%)
• Ensures trend remains intact before entry signal
• Reduces whipsaw and false breakouts
• Inspired by Mark Minervini's VCP pullback entries
Best for: Swing traders and day traders seeking precision entries
Scalpers: Consider disabling for faster entries
2. Error Learning System (Advanced analysis mode Only)
The system learns from its own estimation errors:
• Tracks last 10-20 completed duration estimates (configurable memory depth)
• Calculates error ratio for each: estimated duration / Actual Duration
• If system consistently over-estimates: Applies negative correction (-15%)
• If system consistently under-estimates: Applies positive correction (+15%)
• Adapts to current market regime automatically
This self-correction mechanism improves accuracy over time as the system gathers more data on your specific symbol and timeframe.
3. Regime Detection (Advanced analysis mode Only)
Automatically detects whether market is in trending or choppy regime:
• Compares last 3 trends to historical average
• Recent trends 20%+ longer → Trending regime (+20% to estimates)
• Recent trends 20%+ shorter → Choppy regime (-20% to estimates)
• Applied separately to bullish and bearish trends
Helps duration estimates adapt to changing market conditions without manual intervention.
4. Exponential Weighting
Option to weight recent trends more heavily than distant history:
• Default decay factor: 0.9
• Recent trends get higher weight in statistical calculations
• Older trends gradually decay in importance
• Rationale: Recent market behavior more relevant than old data
• Can be disabled for equal weighting
5. Backtest Statistics
System backtests its own duration estimates using historical data:
• Walks through past trends chronologically
• Calculates what duration estimate WOULD have been at each flip
• Compares to actual duration that occurred
• Displays accuracy metrics in duration analysis boxes and dashboard
• Helps assess statistical reliability on your specific chart
Note: Backtest uses only data available AT THE TIME of each historical flip (no lookahead bias).
TECHNICAL SPECIFICATIONS
• Pine Script Version: v6
• Indicator Type: Overlay (draws on price chart)
• Max Boxes: 500 (for duration analysis box storage)
• Max Bars Back: 5000 (for comprehensive historical analysis)
• Security Calls: 1 (for MTF if enabled - optimized)
• Repainting: NO - All signals and duration estimates confirmed on bar close
• Lookahead Bias: NO - All HTF data properly offset, all duration estimates use only historical data
• Real-time Updates: YES - Dashboard and quality scores update live
• Alert Capable: YES - Both automatic alerts and customizable alert conditions
• Multi-Symbol: Works on stocks, crypto, forex, futures, indices
Performance Optimization:
• Conditional calculations (duration analysis can be disabled to reduce load)
• Efficient array management (circular buffers for trend storage)
• Streamlined gradient rendering (26 layers, can be toggled off)
• Smart label cooldown system (prevents label spam)
• Optimized similarity matching (analyzes only relevant trends)
Data Requirements:
• Minimum 50-100 bars for initial duration analysis (builds historical database)
• Optimal: 500+ bars for robust statistical analysis
• Longer history = more accurate duration estimates
• Works on any timeframe from 1 minute to monthly
KNOWN LIMITATIONS
• Trending Markets Only: Performs best in clear trends. May generate false signals in choppy/sideways markets (use quality score filtering and regime detection to mitigate)
• Lagging Nature: Like all trend-following systems, signals occur AFTER trend establishment, not at exact tops/bottoms. Use duration analysis boxes to set realistic profit targets.
• Initial Learning Period: Duration analysis system requires 10-15 completed trends to build reliable historical database. Early duration estimates less accurate (first few weeks on new symbol/timeframe).
• Visual Load: 26-layer gradient ribbon may slow performance on older devices. Disable ribbon if experiencing lag.
• Statistical accuracy Variables: Duration estimates are statistical estimates, not guarantees. Accuracy varies by:
- Market regime (trending vs choppy)
- Asset volatility characteristics
- Quality of historical pattern matches
- Timeframe traded (higher TF = more reliable)
• Not Best Suitable For:
- Ultra-short-term scalping (sub-1-minute charts)
- Mean-reversion strategies (designed for trend-following)
- Range-bound trading (requires trending conditions)
- News-driven spikes (estimates based on technical patterns, not fundamentals)
FREQUENTLY ASKED QUESTIONS
Q: Does this indicator repaint?
A: Absolutely not. All signals, duration analysis boxes, labels, and alerts use barstate.isconfirmed checks. They only appear after the bar closes. What you see in history is exactly what you would have seen in real-time. Zero repaint guarantee.
Q: How accurate are the trend duration estimates?
A: Accuracy varies by mode, market conditions, and historical data quality:
• Simple mode: 60-70% accuracy (within ±20% of actual duration)
• Standard mode: 70-80% accuracy (within ±20% of actual duration)
• Advanced mode: 75-85% accuracy (within ±20% of actual duration)
Best accuracy achieved on:
• Higher timeframes (4H, Daily, Weekly)
• Trending markets (not choppy/sideways)
• Assets with consistent behavior (Blue Chip, Large Cap)
• After 20+ historical trends analyzed (builds robust database)
Remember: All duration estimates are statistical calculations based on historical patterns, not guarantees.
Q: Which analysis mode should I use?
A:
• Simple: Beginners, clean trending markets, want minimal complexity
• Standard: Most traders, general market conditions (RECOMMENDED DEFAULT)
• Advanced: Experienced traders, volatile/complex markets (biotech, small-cap, crypto), seeking maximum accuracy
Advanced mode requires correct Asset Type configuration for optimal results.
Q: What's the difference between the trading style presets?
A: Each preset optimizes ALL parameters for a specific trading approach:
• Scalping: Ultra-sensitive (ATR 7, Mult 2.0), more signals, shorter holds
• Day Trading: Balanced (ATR 10, Mult 2.5), moderate signals, intraday holds
• Swing Trading: Stable (ATR 14, Mult 3.0), fewer signals, multi-day holds
• Position Trading: Very stable (ATR 21, Mult 4.0), rare signals, week/month holds
Auto mode automatically selects based on your chart timeframe.
Q: Should I use Auto mode or manually select a preset?
A: Auto mode is recommended for most traders. It automatically matches settings to your timeframe and re-optimizes if you switch charts. Only use manual preset selection if:
• You want scalping settings on a 15m chart (overriding auto-detection)
• You want swing settings on a 1h chart (more conservative than auto would give)
• You're testing different approaches on same timeframe
Q: Can I use this for scalping and day trading?
A: Absolutely! The preset system is specifically designed for all trading styles:
• Select "Scalping (1-5m)" for 1-5 minute charts
• Select "Day Trading (15m-1h)" for 15m-1h charts
• Or use "Auto" mode and it configures automatically
Volume momentum filter is auto-disabled in Scalping mode for faster signals.
Q: What is Volume Momentum and why does it matter?
A: Volume Momentum compares short-term volume (fast MA) to long-term volume (slow MA). It answers: "Is money flowing into this asset faster now than historically?"
Why it matters:
• Volume often leads price (early warning system)
• Confirms institutional participation (smart money)
• No lag like price-based indicators
• More intuitive than complex mathematical filters
When the ratio is above 1.2, you have strong evidence that institutions are accumulating (bullish) or distributing (bearish).
Q: How do I set up alerts?
A: Two options:
Option 1 - Automatic Alerts:
1. Right-click on chart → Add Alert
2. Condition: Select this indicator
3. Choose "Any alert() function call"
4. Configure notification method (app, email, webhook)
5. You'll receive detailed alerts on every BUY and SELL signal
Option 2 - Customizable Alert Conditions:
1. Right-click on chart → Add Alert
2. Condition: Select this indicator
3. You'll see three options in dropdown:
- "BUY Signal" (long signals only)
- "SELL Signal" (short signals only)
- "ANY Signal" (both BUY and SELL)
4. Choose desired option and customize message template
5. Uses TradingView placeholders: {{ticker}}, {{close}}, {{time}}, etc.
All alerts fire only on confirmed bar close (no repaint).
Q: What is Scalpel Mode and should I use it?
A: Scalpel Mode waits for healthy pullbacks within established trends before signaling entry. It reduces whipsaws and improves entry timing.
Recommended ON for:
• Swing traders (want precision entries on pullbacks)
• Day traders (willing to wait for better prices)
• Risk-averse traders (prefer fewer but higher-quality entries)
Recommended OFF for:
• Scalpers (need immediate entries, can't wait for pullbacks)
• Momentum traders (want to enter on breakout, not pullback)
• Aggressive traders (prefer more opportunities over precision)
Q: Why do some duration estimates show wider ranges than others?
A: Range width reflects historical trend variability:
• Narrow range: Similar historical trends had consistent durations (high confidence)
• Wide range: Similar historical trends had varying durations (lower confidence)
Wide ranges often occur:
• Early in analysis (fewer historical trends to learn from)
• In volatile/choppy markets (inconsistent trend behavior)
• On lower timeframes (more noise, less consistency)
The median and average still provide useful targets even when range is wide.
Q: Can I customize the dashboard position and appearance?
A: Yes! Dashboard settings include:
• Position: 9 options (Top/Middle/Bottom + Left/Center/Right)
• Text Size: Auto, Tiny, Small, Normal, Large, Huge
• Show/Hide: Toggle entire dashboard on/off
Choose position that doesn't overlap important price action on your specific chart.
Q: Which timeframe should I trade on?
A: Depends on your trading style and time availability:
• 1-5 minute: Active scalping, requires constant monitoring
• 15m-1h: Day trading, check few times per session
• 4h-Daily: Swing trading, check once or twice daily
• Daily-Weekly: Position trading, check weekly
General principle: Higher timeframes produce:
• Fewer signals (less frequent)
• Higher quality setups (stronger confirmations)
• More reliable duration estimates (better statistical data)
• Less noise (clearer trends)
Start with Daily chart if new to trading. Move to lower timeframes as you gain experience.
Q: Does this work on all markets (stocks, crypto, forex)?
A: Yes, it works on all markets with trending characteristics:
Excellent for:
• Stocks (especially growth and momentum names)
• Crypto (BTC, ETH, major altcoins)
• Futures (indices, commodities)
• Forex majors (EUR/USD, GBP/USD, etc.)
Best results on:
• Trending markets (not range-bound)
• Liquid instruments (tight spreads, good fills)
• Volatile assets (clear trend development)
Less effective on:
• Range-bound/sideways markets
• Ultra-low volatility instruments
• Illiquid small-caps (use caution)
Configure Asset Type (in Advanced analysis mode) to match your instrument for best accuracy.
Q: How many signals should I expect per day/week?
A: Highly variable based on:
By Timeframe:
• 1-5 minute: 5-15 signals per session
• 15m-1h: 2-5 signals per day
• 4h-Daily: 2-5 signals per week
• Daily-Weekly: 1-2 signals per month
By Market Volatility:
• High volatility = more SuperTrend flips = more signals
• Low volatility = fewer flips = fewer signals
By Quality Filter:
• Higher threshold (60-70) = fewer but better signals
• Lower threshold (30-40) = more signals, lower quality
By Volume Momentum Filter:
• Enabled = Fewer signals (only volume-confirmed)
• Disabled = More signals (all SuperTrend flips)
Adjust quality threshold and filters to match your desired signal frequency.
Q: What's the difference between entry labels and info labels?
A:
Entry Labels (BUY/SELL):
• Your primary trading signals
• Based on SuperTrend flip + all confirmations (quality, volume, momentum)
• Include quality score and confirmation icons
• These are actionable entry points
Info Labels (Volume Spike):
• Additional market context
• Show volume events that may support or contradict trend
• 8-bar cooldown to prevent spam
• NOT necessarily entry points - contextual information only
Control separately: Can show entry labels without info labels (recommended for clean charts).
Q: Can I combine this with other indicators?
A: Absolutely! This works well with:
• RSI: For divergences and overbought/oversold conditions
• Support/Resistance: Confluence with key levels
• Fibonacci Retracements: Pullback targets in Scalpel Mode
• Price Action Patterns: Flags, pennants, cup-and-handle
• MACD: Additional momentum confirmation
• Bollinger Bands: Volatility context
This indicator provides trend direction and duration estimates - complement with other tools for entry refinement and additional confluence.
Q: Why did I get a low-quality signal? Can I filter them out?
A: Yes! Increase the Minimum Quality Score in settings.
If you're seeing signals with quality below your preference:
• Day Trading: Set minimum to 50
• Swing Trading: Set minimum to 60
• Position Trading: Set minimum to 70
Only signals meeting the threshold will appear. This reduces frequency but improves win-rate.
Q: How do I interpret the MTF Confluence count?
A: Shows how many of 6 timeframes agree with current trend:
• 6/6 aligned: Perfect agreement (extremely rare, highest confidence)
• 5/6 aligned: Very strong alignment (high confidence)
• 4/6 aligned: Good alignment (standard quality setup)
• 3/6 aligned: Moderate alignment (acceptable)
• 2/6 aligned: Weak alignment (caution)
• 1/6 aligned: Very weak (likely counter-trend)
Higher confluence typically correlates with longer, stronger trends. However, MTF analysis is optional - you can disable it and rely solely on quality scoring.
Q: Is this suitable for beginners?
A: Yes, but requires foundational knowledge:
You should understand:
• Basic trend-following concepts (higher highs, higher lows)
• Risk management principles (position sizing, stop losses)
• How to read candlestick charts
• What volume and volatility mean
Beginner-friendly features:
• Auto preset mode (zero configuration)
• Quality scoring (tells you signal strength)
• Dashboard tooltips (hover for explanations)
• duration analysis boxes (visual profit targets)
Recommended for beginners:
1. Start with "Auto" or "Swing Trading" preset on Daily chart
2. Use Standard Analysis Mode (not Advanced)
3. Set minimum quality to 60 (fewer but better signals)
4. Paper trade first for 2-4 weeks
5. Study methodology references (Minervini, O'Neil, Zanger)
Q: What is the Asset Type setting and why does it matter?
A: Asset Type (in Advanced analysis mode) adjusts duration estimates based on volatility characteristics:
• Small Cap: Explosive moves, extended trends (+30-40%)
• Biotech / Speculative: Parabolic potential, news-driven (+40%)
• Blue Chip / Large Cap: Baseline, steady trends (0% adjustment)
• Tech Growth: Momentum-driven, longer trends (+20%)
• Dividend / Value: Slower, grinding trends (-20%)
• Cyclical: Macro-driven, variable (±10%)
• Crypto / High Volatility: Parabolic potential (+30%)
Correct configuration improves Statistical accuracy by 15-20%. Using Blue Chip settings on a biotech stock may underestimate trend length (you'll exit too early).
Q: Can I backtest this indicator?
A: Yes! TradingView's Strategy Tester works with this indicator's signals.
To backtest:
1. Note the entry conditions (SuperTrend flip + quality threshold + filters)
2. Create a strategy script using same logic
3. Run Strategy Tester on historical data
Additionally, the indicator includes BUILT-IN duration estimate validation:
• System backtests its own duration estimates
• Shows accuracy metrics in dashboard and duration analysis boxes
• Helps assess reliability on your specific symbol/timeframe
Q: Why does Volume Momentum auto-disable in Scalping mode?
A: Scalping requires ultra-fast entries to catch quick moves. Volume Momentum filter adds friction by requiring volume confirmation before signaling, which can cause missed opportunities in rapid scalping.
Scalping preset is optimized for speed and frequency - the filter is counterproductive for that style. It remains enabled for Day Trading, Swing Trading, and Position Trading presets where patience improves results.
You can manually enable it in Custom mode if desired.
Q: How much historical data do I need for accurate duration estimates?
A:
Minimum: 50-100 bars (indicator will function but duration estimates less reliable)
Recommended: 500+ bars (robust statistical database)
Optimal: 1000+ bars (maximum Statistical accuracy)
More history = more completed trends = better pattern matching = more accurate duration estimates.
New symbols or newly-switched timeframes will have lower Statistical accuracy initially. Allow 2-4 weeks for the system to build historical database.
IMPORTANT DISCLAIMERS
No Guarantee of Profit:
This indicator is an educational tool and does not guarantee any specific trading results. All trading involves substantial risk of loss. Duration estimates are statistical calculations based on historical patterns and are not guarantees of future performance.
Past Performance:
Historical backtest results and Statistical accuracy statistics do not guarantee future performance. Market conditions change constantly. What worked historically may not work in current or future markets.
Not Financial Advice:
This indicator provides technical analysis signals and statistical duration estimates only. It is not financial, investment, or trading advice. Always consult with a qualified financial advisor before making investment decisions.
Risk Warning:
Trading stocks, options, futures, forex, and cryptocurrencies involves significant risk. You can lose all of your invested capital. Never trade with money you cannot afford to lose. Only risk capital you can lose without affecting your lifestyle.
Testing Required:
Always test this indicator on a demo account or with paper trading before risking real capital. Understand how it works in different market conditions. Verify Statistical accuracy on your specific instruments and timeframes before trusting it with real money.
User Responsibility:
You are solely responsible for your trading decisions. The developer assumes no liability for trading losses, incorrect duration estimates, software errors, or any other damages incurred while using this indicator.
Statistical Estimation Limitations:
Trend Duration estimates are statistical estimates based on historical pattern matching. They are NOT guarantees. Actual trend durations may differ significantly from duration estimates due to unforeseen news events, market regime changes, or lack of historical precedent for current conditions.
CREDITS & ACKNOWLEDGMENTS
Methodology Inspiration:
• Mark Minervini - Volatility Contraction Pattern (VCP) concepts and pullback entry techniques
• William O'Neil - Volume analysis principles and CANSLIM institutional buying patterns
• Dan Zanger - Momentum breakout strategies and volatility expansion entries
Technical Components:
• SuperTrend calculation - Classic ATR-based trend indicator (public domain)
• Statistical analysis - Standard median, average, range calculations
• k-Nearest Neighbors - Classic machine learning similarity matching concept
• Multi-timeframe analysis - Standard request.security implementation in Pine Script
For questions, feedback, or support, please comment below or send a private message.
Happy Trading!
Great Expectations [LucF]Great Expectations helps traders answer the question: What is possible? It is a powerful question, yet exploration of the unknown always entails risk. A more complete set of questions better suited to traders could be:
What opportunity exists from any given point on a chart?
What portion of this opportunity can be realistically captured?
What risk will be incurred in trying to do so, and how long will it take?
Great Expectations is the result of an exploration of these questions. It is a trade simulator that generates visual and quantitative information to help strategy modelers visually identify and analyse areas of optimal expectation on charts, whether they are designing automated or discretionary strategies.
WARNING: Great Expectations is NOT an indicator that helps determine the current state of a market. It works by looking at points in the past from which the future is already known. It uses one definition of repainting extensively (i.e. it goes back in the past to print information that could not have been know at the time). Repainting understood that way is in fact almost all the indicator does! —albeit for what I hope is a noble cause. The indicator is of no use whatsoever in analyzing markets in real-time. If you do not understand what it does, please stay away!
This is an indicator—not a strategy that uses TradingView’s backtesting engine. It works by simulating trades, not unlike a backtest, but with the crucial difference that it assumes a trade (either long or short) is entered on all bars in the historic sample. It walks forward from each bar and determines possible outcomes, gathering individual trade statistics that in turn generate precious global statistics from all outcomes tested on the chart.
Great Expectations provides numbers summarizing trade results on all simulations run from the chart. Those numbers cannot be compared to backtest-produced numbers since all non-filtered bars are examined, even if an entry was taken on the bar immediately preceding the current one, which never happens in a backtest. This peculiarity does NOT invalidate Great Expectations calculations; it just entails that results be considered under a different light. Provided they are evaluated within the indicator’s context, they can be useful—sometimes even more than backtesting results, e.g. in evaluating the impact of parameter-fitting or variations in entry, exit or filtering strats.
Traders and strategy modelers are creatures of hope often suffering from blurred vision; my hope is that Great Expectations will help them appraise the validity of their setup and strat intuitions in a realistic fashion, preventing confirmation bias from obstructing perspective—and great expectations from turning into financial great deceptions.
USE CASES
You’ve identified what looks like a promising setup on other indicators. You load Great Expectations on the chart and evaluate if its high-expectation areas match locations where your setup’s conditions occur. Unless today is your lucky day, chances are the indicator will help you realize your setup is not as promising as you had hoped.
You want to get a rough estimate of the optimal trade duration for a chart and you don’t mind using the entry and exit strategies provided with the indicator. You use the trade length readouts of the indicator.
You’re experimenting with a new stop strategy and want to know how long it will keep you in trades, on average. You integrate your stop strategy in the indicator’s code and look at the average trade length it produces and the TST ratio to evaluate its performance.
You have put together your own entry and exit criteria and are looking for a filter that will help you improve backtesting results. You visually ascertain the suitability of your filter by looking at its results on the charts with great Expectations, to see if your filter is choosing its areas correctly.
You have a strategy that shows backtested trades on your chart. Great Expectations can help you evaluate how well your strategy is benefitting from high-opportunity areas while avoiding poor expectation spots.
You want more complete statistics on your set of strategies than what backtesting will provide. You use Great Expectations, knowing that it tests all bars in the sample that correspond to your criteria, as opposed to backtesting results which are limited to a subset of all possible entries.
You want to fool your friends into thinking you’ve designed the holy grail of indicators, something that identifies optimal opportunities on any chart; you show them the P&L cloud.
FEATURES
For one trade
At any given point on the chart, assuming a trade is entered there, Great Expectations shows you information specific to that trade simulation both on the chart and in the Data Window.
The chart can display:
the P & L Cloud which shows whether the trade ended profitably or not, and by how much,
the Opportunity & Risk Cloud which the maximum opportunity and risk the simulation encountered. When superimposed over the P & L cloud, you will see what I call the managed opportunity and risk, i.e the portion of maximum opportunity that was captured and the portion of the maximum risk that was incurred,
the target and if it was reached,
a background that uses a gradient to show different levels of trade length, P&L or how frequently the target was reached during simulation.
The Data Window displays more than 40 values on individual trades and global results. For any given trade you will know:
Entry/Exit levels, including slippage impact,
It’s outcome and duration,
P/L achieved,
The fraction of the maximum opportunity/risk managed by the trade.
For all trades
After going through all the possible trades on the chart, the indicator will provide you with a rare view of all outcomes expressed with the P&L cloud, which allows us to instantly see the most/least profitable areas of a chart using trade data as support, while also showing its relationship with the opportunity/risk encountered during the simulation. The difference between the two clouds is the managed opportunity and risk.
The Data Window will present you with numbers which we will go through later. Some of them are: average stop size, P/L, win rate, % opportunity managed, trade lengths for different types of trade outcomes and the TST (Target:Stop Travel) ratio.
Let’s see Great Expectations in action… and remember to open your Data Window!
INPUTS
Trade direction : You must first choose if you wish to look at long or short trades. Because of the way the indicator works and the amount of visual information on the chart, it is only practical to look at one type of trades at a time. The default is Longs.
Maximum trade Length (MaxL) : This is the maximum walk forward distance the simulator will go in analyzing outcomes from any given point in the past. It also determines the size of the dead zone among the chart’s last bars. A red background line identifies the beginning of the dead zone for which not enough bars have elapsed to analyze outcomes for the maximum trade length defined. If an ATR-based entry stop is used, that length is added to the wait time before beginning simulations, so that the first entry starts with a clean ATR value. On a sample of around 16000 bars, my tests show that the indicator runs into server errors at lengths of around 290, i.e. having completed ~4,6M simulation loop iterations. That is way too high a length anyways; 100 will usually be amply enough to ring out all the possibilities out of a simulation, and on shorter time frames, 30 can be enough. While making it unduly small will prevent simulations of expressing the market’s potential, the less you use, the faster the indicator will run. The default is 40.
Unrealized P&L base at End of Trade (EOT) : When a simulation ends and the trade is still open, we calculate unrealized P&L from an exit order executed from either the last in-trade stop on the previous bar, or the close of the last bar. You can readily see the impact of this selection on the chart, with the P&L cloud. The default is on the close.
Display : The check box besides the title does nothing.
Show target : Shows a green line displaying the trade’s target expressed as a multiple of X, i.e. the amplitude of the entry stop. I call this value “X” and use it as a unit to express profit and loss on a trade (some call it “R”). The line is highlighted for trades where the close reached the target during the trade, whether the trade ended in profit or loss. This is also where you specify the multiple of X you wish to use in calculating targets. The multiple is used even if targets are not displayed.
Show P&L Cloud : The cloud allows traders to see right away the profitable areas of the chart. The only line printed with the cloud is the “end of trade line” (EOT). The EOT line is the only way one can see the level where a trade ended on the chart (in the Data Window you can see it as the “Exit Fill” value). The EOT level for the trade determines if the trade ended in a profit or a loss. Its value represents one of the following:
- fill from order executed at close of bar where stop is breached during trade (which produces “Realized P/L”),
- simulation of a fill pseudo-fill at the user-defined EOT level (last close or stop level) if the trade runs its course through MaxL bars without getting stopped (producing Unrealized P/L).
The EOT line and the cloud fill print in green when the trade’s outcome is profitable and in red when it is not. If the trade was closed after breaching the stop, the line appears brighter.
Show Opportunity&Risk Cloud : Displays the maximum opportunity/risk that was present during the trade, i.e. the maximum and minimum prices reached.
Background Color Scheme : Allows you to choose between 3 different color schemes for the background gradients, to accommodate different types of chart background/candles. Select “None” if you don’t want a background.
Background source : Determines what value will be used to generate the different intensities of the gradient. You can choose trade length (brighter is shorter), Trade P&L (brighter is higher) or the number of times the target was reached during simulation (brighter is higher). The default is Trade Length.
Entry strat : The check box besides the title does nothing. The default strat is All bars, meaning a trade will be simulated from all bars not excluded by the filters where a MaxL bars future exists. For fun, I’ve included a pseudo-random entry strat (an indirect way of changing the seed is to vary the starting date of the simulation).
Show Filter State : Displays areas where the combination of filters you have selected are allowing entries. Filtering occurs as per your selection(s), whether the state is displayed or not. The effect of multiple selections is additive. The filters are:
1. Bar direction: Longs will only be entered if close>open and vice versa.
2. Rising Volume: Applies to both long and shorts.
3. Rising/falling MA of the length you choose over the number of bars you choose.
4. Custom indicator: You can feed your own filtering signal through this from another indicator. It must produce a signal of 1 to allow long entries and 0 to allow shorts.
Show Entry Stops :
1. Multiple of user-defined length ATR.
2. Fixed percentage.
3. Fixed value.
All entry stops are calculated using the entry fill price as a reference. The fill price is calculated from the current bar’s open, to which slippage is added if configured. This simulates the case where the strategy issued the entry signal on the previous bar for it to be executed at the next bar’s open.
The entry stop remains active until the in-trade stop becomes the more aggressive of the two stops. From then on, the entry stop will be ignored, unless a bar close breaches the in-trade stop, in which case the stop will be reset with a new entry stop and the process repeats.
Show In-trade stops : Displays in bright red the selected in-trade stop (be sure to read the note in this section about them).
1. ATR multiple: added/subtracted from the average of the two previous bars minimum/maximum of open/close.
2. A trailing stop with a deviation expressed as a multiple of entry stop (X).
3. A fixed percentage trailing stop.
Trailing stops deviations are measured from the highest/lowest high/low reached during the trade.
Note: There is a twist with the in-trade stops. It’s that for any given bar, its in-trade stop can hold multiple values, as each successive pass of the advancing simulation loops goes over it from a different entry points. What is printed is the stop from the loop that ended on that bar, which may have nothing to do with other instances of the trade’s in-trade stop for the same bar when visited from other starting points in previous simulations. There is just no practical way to print all stop values that were used for any given bar. While the printed entry stops are the actual ones used on each bar, the in-trade stops shown are merely the last instance used among many.
Include Slippage : if checked, slippage will be added/subtracted from order price to yield the fill price. Slippage is in percentage. If you choose to include slippage in the simulations, remember to adjust it by considering the liquidity of the markets and the time frame you’ll be analyzing.
Include Fees : if checked, fees will be subtracted/added to both realized an unrealized trade profits/losses. Fees are in percentage. The default fees work well for crypto markets but will need adjusting for others—especially in Forex. Remember to modify them accordingly as they can have a major impact on results. Both fees and slippage are included to remind us of their importance, even if the global numbers produced by the indicator are not representative of a real trading scenario composed of sequential trades.
Date Range filtering : the usual. Just note that the checkbox has to be selected for date filtering to activate.
DATA WINDOW
Most of the information produced by this indicator is made available in the Data Window, which you bring up by using the icon below the Watchlist and Alerts buttons at the right of the TV UI. Here’s what’s there.
Some of the information presented in the Data Window is standard trade data; other values are not so standard; e. g. the notions of managed opportunity and risk and Target:Stop Travel ratio. The interplay between all the values provided by Great Expectations is inherently complex, even for a static set of entry/filter/exit strats. During the constant updating which the habitual process of progressive refinement in building strategies that is the lot of strategy modelers entails, another level of complexity is no doubt added to the analysis of this indicator’s values. While I don’t want to sound like Wolfram presenting A New Kind of Science , I do believe that if you are a serious strategy modeler and spend the time required to get used to using all the information this indicator makes available, you may find it useful.
Trade Information
Entry Order : This is the open of the bar where simulation starts. We suppose that an entry signal was generated at the previous bar.
Entry Fill (including slip.) : The actual entry price, including slippage. This is the base price from which other values will be calculated.
Exit Order : When a stop is breached, an exit order is executed from the close of the bar that breached the stop. While there is no “In-trade stop” value included in the Data Window (other than the End of trade Stop previously discussed), this “Exit Order” value is how we can know the level where the trade was stopped during the simulation. The “Trade Length” value will then show the bar where the stop was breached.
Exit Fill (including slip.) : When the exit order is simulated, slippage is added to the order level to create the fill.
Chart: Target : This is the target calculated at the beginning of the simulation. This value also appear on the chart in teal. It is controlled by the multiple of X defined under the “Show Target” checkbox in the Inputs.
Chart: Entry Stop : This value also appears on the chart (the red dots under points where a trade was simulated). Its value is controlled by the Entry Strat chosen in the Inputs.
X (% Fill, including Fees) and X (currency) : This is the stop’s amplitude (Entry Fill – Entry Stop) + Fees. It represents the risk incurred upon entry and will be used to express P&L. We will show R expressed in both a percentage of the Entry Fill level (this value), and currency (the next value). This value represents the risk in the risk:reward ratio and is considered to be a unit of 1 so that RR can be expressed as a single value (i.e. “2” actually meaning “1:2”).
Trade Length : If trade was stopped, it’s the number of bars elapsed until then. The trade is then considered “Closed”. If the trade ends without being stopped (there is no profit-taking strat implemented, so the stop is the only exit strat), then the trade is “Open”, the length is MaxL and it will show in orange. Otherwise the value will print in green/red to reflect if the trade is winning/losing.
P&L (X) : The P&L of the trade, expressed as a multiple of X, which takes into account fees paid at entry and exit. Given our default target setting at 2 units of “X”, a trade that closes at its target will have produced a P&L of +2.0, i.e. twice the value of X (not counting fees paid at exit ). A trade that gets stopped late 50% further that the entry stop’s level will produce a P&L of -1.5X.
P&L (currency, including Fees) : same value as above, but expressed in currency.
Target first reached at bar : If price closed above the target during the trade (even if it occurs after the trade was stopped), this will show when. This value will be used in calculating our TST ratio.
Times Stop/Target reached in sim. : Includes all occurrences during the complete simulation loop.
Opportunity (X) : The highest/lowest price reached during a simulation, i.e. the maximum opportunity encountered, whether the trade was previously stopped or not, expressed as a multiple of X.
Risk (X) : The lowest/highest price reached during a simulation, i.e. the maximum risk encountered, whether the trade was previously stopped or not, expressed as a multiple of X.
Risk:Opportunity : The greater this ratio, the greater Opportunity is, compared to Risk.
Managed Opportunity (%) : The portion of Opportunity that was captured by the highest/low stop position, even if it occurred after a previous stop closed the trade.
Managed Risk (%) : The portion of risk that was protected by the lowest/highest stop position, even if it occurred after a previous stop closed the trade. When this value is greater than 100%, it means the trade’s stop is protecting more than the maximum risk, which is frequent. You will, however, never see close to those values for the Managed Opportunity value, since the stop would have to be higher than the Maximum opportunity. It is much easier to alleviate the risk than it is to lock in profits.
Managed Risk:Opportunity : The ratio of the two preceding values.
Managed Opp. vs. Risk : The Managed Opportunity minus the Managed Risk. When it is negative, which is most often is, it means your strat is protecting a greater portion of the risk than it captures opportunity.
Global Numbers
Win Rate(%) : Percentage of winning trades over all entries. Open trades are considered winning if their last stop/close (as per user selection) locks in profits.
Avg X%, Avg X (currency) : Averages of previously described values:.
Avg Profitability/Trade (APPT) : This measures expectation using: Average Profitability Per Trade = (Probability of Win × Average Win) − (Probability of Loss × Average Loss) . It quantifies the average expectation/trade, which RR alone can’t do, as the probabilities of each outcome (win/lose) must also be used to calculate expectancy. The APPT combine the RR with the win rate to yield the true expectancy of a strategy. In my usual way of expressing risk with X, APPT is the equivalent of the average P&L per trade expressed in X. An APPT of -1.5 means that we lose on average 1.5X/trade.
Equity (X), Equity (currency) : The cumulative result of all trade outcomes, expressed as a multiple of X. Multiplied by the Average X in currency, this yields the Equity in currency.
Risk:Opportunity, Managed Risk:Opportunity, Managed Opp. vs. Risk : The global values of the ones previously described.
Avg Trade Length (TL) : One of the most important values derived by going through all the simulations. Again, it is composed of either the length of stopped trades, or MaxL when the trade isn’t stopped (open). This value can help systems modelers shape the characteristics of the components they use to build their strategies.
Avg Closed Win TL and Avg Closed Lose TL : The average lengths of winning/losing trades that were stopped.
Target reached? Avg bars to Stop and Target reached? Avg bars to Target : For the trades where the target was reached at some point in the simulation, the number of bars to the first point where the stop was breached and where the target was reached, respectively. These two values are used to calculate the next value.
TST (Target:Stop Travel Ratio) : This tracks the ratio between the two preceding values (Bars to first stop/Bars to first target), but only for trades where the target was reached somewhere in the loop. A ratio of 2 means targets are reached twice as fast as stops.
The next values of this section are counts or percentages and are self-explanatory.
Chart Plots
Contains chart plots of values already describes.
NOTES
Optimization/Overfitting: There is a fine line between optimizing and overfitting. Tools like this indicator can lead unsuspecting modelers down a path of overfitting that often turns strategies into over-specialized beasts that do not perform elegantly when confronted to the real-world. Proven testing strategies like walk forward analysis will go a long way in helping modelers alleviate this risk.
Input tuning: Because the results generated by the indicator will vary with the parameters used in the active entry, filtering and exit strats, it’s important to realize that although it may be fun at first, just slapping the default settings on a chart and time frame will not yield optimal nor reliable results. While using ATR as often as possible (as I do in this indicator) is a good way to make strat parametrization adaptable, it is not a foolproof solution.
There is no data for the last MaxL bars of the chart, since not enough trade future has elapsed to run a simulation from MaxL bars back.
Modifying the code: I have tried to structure the code modularly, even if that entails a larger code base, so that you can adapt it to your needs. I’ve included a few token components in each of the placeholders designed for entry strategies, filters, entry stops and in-trade stops. This will hopefully make it easier to add your own. In the same spirit, I have also commented liberally.
You will find in the code many instances of standard trade management tasks that can be lifted to code TV strategies where, as I do in mine, you manage everything yourself and don’t rely on built-in Pine strategy functions to act on your trades.
Enjoy!
THANKS
To @scarf who showed me how plotchar() could be used to plot values without ruining scale.
To @glaz for the suggestion to include a Chandelier stop strat; I will.
To @simpelyfe for the idea of using an indicator input for the filters (if some day TV lets us use more than one, it will be useful in other modules of the indicator).
To @RicardoSantos for the random generator used in the random entry strat.
To all scripters publishing open source on TradingView; their code is the best way to learn.
To my trading buddies Irving and Bruno; who showed me way back how pro traders get it done.
Luxy Momentum, Trend, Bias and Breakout Indicators V7
TABLE OF CONTENTS
This is Version 7 (V7) - the latest and most optimized release. If you are using any older versions (V6, V5, V4, V3, etc.), it is highly recommended to replace them with V7.
Why This Indicator is Different
Who Should Use This
Core Components Overview
The UT Bot Trading System
Understanding the Market Bias Table
Candlestick Pattern Recognition
Visual Tools and Features
How to Use the Indicator
Performance and Optimization
FAQ
---
### CREDITS & ATTRIBUTION
This indicator implements proven trading concepts using entirely original code developed specifically for this project.
### CONCEPTUAL FOUNDATIONS
• UT Bot ATR Trailing System
- Original concept by @QuantNomad: (search "UT-Bot-Strategy"
- Our version is a complete reimplementation with significant enhancements:
- Volume-weighted momentum adjustment
- Composite stop loss from multiple S/R layers
- Multi-filter confirmation system (swing, %, 2-bar, ZLSMA)
- Full integration with multi-timeframe bias table
- Visual audit trail with freeze-on-touch
- NOTE: No code was copied - this is a complete reimplementation with enhancements.
• Standard Technical Indicators (Public Domain Formulas):
- Supertrend: ATR-based trend calculation with custom gradient fills
- MACD: Gerald Appel's formula with separation filters
- RSI: J. Welles Wilder's formula with pullback zone logic
- ADX/DMI: Custom trend strength formula inspired by Wilder's directional movement concept, reimplemented with volume weighting and efficiency metrics
- ZLSMA: Zero-lag formula enhanced with Hull MA and momentum prediction
### Custom Implementations
- Trend Strength: Inspired by Wilder's ADX concept but using volume-weighted pressure calculation and efficiency metrics (not traditional +DI/-DI smoothing)
- All code implementations are original
### ORIGINAL FEATURES (70%+ of codebase)
- Multi-Timeframe Bias Table with live updates
- Risk Management System (R-multiple TPs, freeze-on-touch)
- Opening Range Breakout tracker with session management
- Composite Stop Loss calculator using 6+ S/R layers
- Performance optimization system (caching, conditional calcs)
- VIX Fear Index integration
- Previous Day High/Low auto-detection
- Candlestick pattern recognition with interactive tooltips
- Smart label and visual management
- All UI/UX design and table architecture
### DEVELOPMENT PROCESS
**AI Assistance:** This indicator was developed over 2+ months with AI assistance (ChatGPT/Claude) used for:
- Writing Pine Script code based on design specifications
- Optimizing performance and fixing bugs
- Ensuring Pine Script v6 compliance
- Generating documentation
**Author's Role:** All trading concepts, system design, feature selection, integration logic, and strategic decisions are original work by the author. The AI was a coding tool, not the system designer.
**Transparency:** We believe in full disclosure - this project demonstrates how AI can be used as a powerful development tool while maintaining creative and strategic ownership.
---
1. WHY THIS INDICATOR IS DIFFERENT
Most traders use multiple separate indicators on their charts, leading to cluttered screens, conflicting signals, and analysis paralysis. The Suite solves this by integrating proven technical tools into a single, cohesive system.
Key Advantages:
All-in-One Design: Instead of loading 5-10 separate indicators, you get everything in one optimized script. This reduces chart clutter and improves TradingView performance.
Multi-Timeframe Bias Table: Unlike standard indicators that only show the current timeframe, the Bias Table aggregates trend signals across multiple timeframes simultaneously. See at a glance whether 1m, 5m, 15m, 1h are aligned bullish or bearish - no more switching between charts.
Smart Confirmations: The indicator doesn't just give signals - it shows you WHY. Every entry has multiple layers of confirmation (MA cross, MACD momentum, ADX strength, RSI pullback, volume, etc.) that you can toggle on/off.
Dynamic Stop Loss System: Instead of static ATR stops, the SL is calculated from multiple support/resistance layers: UT trailing line, Supertrend, VWAP, swing structure, and MA levels. This creates more intelligent, price-action-aware stops.
R-Multiple Take Profits: Built-in TP system calculates targets based on your initial risk (1R, 1.5R, 2R, 3R). Lines freeze when touched with visual checkmarks, giving you a clean audit trail of partial exits.
Educational Tooltips Everywhere: Every single input has detailed tooltips explaining what it does, typical values, and how it impacts trading. You're not guessing - you're learning as you configure.
Performance Optimized: Smart caching, conditional calculations, and modular design mean the indicator runs fast despite having 15+ features. Turn off what you don't use for even better performance.
No Repainting: All signals respect bar close. Alerts fire correctly. What you see in history is what you would have gotten in real-time.
What Makes It Unique:
Integrated UT Bot + Bias Table: No other indicator combines UT Bot's ATR trailing system with a live multi-timeframe dashboard. You get precision entries with macro trend context.
Candlestick Pattern Recognition with Interactive Tooltips: Patterns aren't just marked - hover over any emoji for a full explanation of what the pattern means and how to trade it.
Opening Range Breakout Tracker: Built-in ORB system for intraday traders with customizable session times and real-time status updates in the Bias Table.
Previous Day High/Low Auto-Detection: Automatically plots PDH/PDL on intraday charts with theme-aware colors. Updates daily without manual input.
Dynamic Row Labels in Bias Table: The table shows your actual settings (e.g., "EMA 10 > SMA 20") not generic labels. You know exactly what's being evaluated.
Modular Filter System: Instead of forcing a fixed methodology, the indicator lets you build your own strategy. Start with just UT Bot, add filters one at a time, test what works for your style.
---
2. WHO WHOULD USE THIS
Designed For:
Intermediate to Advanced Traders: You understand basic technical analysis (MAs, RSI, MACD) and want to combine multiple confirmations efficiently. This isn't a "one-click profit" system - it's a professional toolkit.
Multi-Timeframe Traders: If you trade one asset but check multiple timeframes for confirmation (e.g., enter on 5m after checking 15m and 1h alignment), the Bias Table will save you hours every week.
Trend Followers: The indicator excels at identifying and following trends using UT Bot, Supertrend, and MA systems. If you trade breakouts and pullbacks in trending markets, this is built for you.
Intraday and Swing Traders: Works equally well on 5m-1h charts (day trading) and 4h-D charts (swing trading). Scalpers can use it too with appropriate settings adjustments.
Discretionary Traders: This isn't a black-box system. You see all the components, understand the logic, and make final decisions. Perfect for traders who want tools, not automation.
Works Across All Markets:
Stocks (US, international)
Cryptocurrency (24/7 markets supported)
Forex pairs
Indices (SPY, QQQ, etc.)
Commodities
NOT Ideal For :
Complete Beginners: If you don't know what a moving average or RSI is, start with basics first. This indicator assumes foundational knowledge.
Algo Traders Seeking Black Box: This is discretionary. Signals require context and confirmation. Not suitable for blind automated execution.
Mean-Reversion Only Traders: The indicator is trend-following at its core. While VWAP bands support mean-reversion, the primary methodology is trend continuation.
---
3. CORE COMPONENTS OVERVIEW
The indicator combines these proven systems:
Trend Analysis:
Moving Averages: Four customizable MAs (Fast, Medium, Medium-Long, Long) with six types to choose from (EMA, SMA, WMA, VWMA, RMA, HMA). Mix and match for your style.
Supertrend: ATR-based trend indicator with unique gradient fill showing trend strength. One-sided ribbon visualization makes it easier to see momentum building or fading.
ZLSMA : Zero-lag linear-regression smoothed moving average. Reduces lag compared to traditional MAs while maintaining smooth curves.
Momentum & Filters:
MACD: Standard MACD with separation filter to avoid weak crossovers.
RSI: Pullback zone detection - only enter longs when RSI is in your defined "buy zone" and shorts in "sell zone".
ADX/DMI: Trend strength measurement with directional filter. Ensures you only trade when there's actual momentum.
Volume Filter: Relative volume confirmation - require above-average volume for entries.
Donchian Breakout: Optional channel breakout requirement.
Signal Systems:
UT Bot: The primary signal generator. ATR trailing stop that adapts to volatility and gives clear entry/exit points.
Base Signals: MA cross system with all the above filters applied. More conservative than UT Bot alone.
Market Bias Table: Multi-timeframe dashboard showing trend alignment across 7 timeframes plus macro bias (3-day, weekly, monthly, quarterly, VIX).
Candlestick Patterns: Six major reversal patterns auto-detected with interactive tooltips.
ORB Tracker: Opening range high/low with breakout status (intraday only).
PDH/PDL: Previous day levels plotted automatically on intraday charts.
VWAP + Bands : Session-anchored VWAP with up to three standard deviation band pairs.
---
4. THE UT BOT TRADING SYSTEM
The UT Bot is the heart of the indicator's signal generation. It's an advanced ATR trailing stop that adapts to market volatility.
Why UT Bot is Superior to Fixed Stops:
Traditional ATR stops use a fixed multiplier (e.g., "stop = entry - 2×ATR"). UT Bot is smarter:
It TRAILS the stop as price moves in your favor
It WIDENS during high volatility to avoid premature stops
It TIGHTENS during consolidation to lock in profits
It FLIPS when price breaks the trailing line, signaling reversals
Visual Elements You'll See:
Orange Trailing Line: The actual UT stop level that adapts bar-by-bar
Buy/Sell Labels: Aqua triangle (long) or orange triangle (short) when the line flips
ENTRY Line: Horizontal line at your entry price (optional, can be turned off)
Suggested Stop Loss: A composite SL calculated from multiple support/resistance layers:
- UT trailing line
- Supertrend level
- VWAP
- Swing structure (recent lows/highs)
- Long-term MA (200)
- ATR-based floor
Take Profit Lines: TP1, TP1.5, TP2, TP3 based on R-multiples. When price touches a TP, it's marked with a checkmark and the line freezes for audit trail purposes.
Status Messages: "SL Touched ❌" or "SL Frozen" when the trade leg completes.
How UT Bot Differs from Other ATR Systems:
Multiple Filters Available: You can require 2-bar confirmation, minimum % price change, swing structure alignment, or ZLSMA directional filter. Most UT implementations have none of these.
Smart SL Calculation: Instead of just using the UT line as your stop, the indicator suggests a better SL based on actual support/resistance. This prevents getting stopped out by wicks while keeping risk controlled.
Visual Audit Trail: All SL/TP lines freeze when touched with clear markers. You can review your trades weeks later and see exactly where entries, stops, and targets were.
Performance Options: "Draw UT visuals only on bar close" lets you reduce rendering load without affecting logic or alerts - critical for slower machines or 1m charts.
Trading Logic:
UT Bot flips direction (Buy or Sell signal appears)
Check Bias Table for multi-timeframe confirmation
Optional: Wait for Base signal or candlestick pattern
Enter at signal bar close or next bar open
Place stop at "Suggested Stop Loss" line
Scale out at TP levels (TP1, TP2, TP3)
Exit remaining position on opposite UT signal or stop hit
---
5. UNDERSTANDING THE MARKET BIAS TABLE
This is the indicator's unique multi-timeframe intelligence layer. Instead of looking at one chart at a time, the table aggregates signals across seven timeframes plus macro trend bias.
Why Multi-Timeframe Analysis Matters:
Professional traders check higher and lower timeframes for context:
Is the 1h uptrend aligning with my 5m entry?
Are all short-term timeframes bullish or just one?
Is the daily trend supportive or fighting me?
Doing this manually means opening multiple charts, checking each indicator, and making mental notes. The Bias Table does it automatically in one glance.
Table Structure:
Header Row:
On intraday charts: 1m, 5m, 15m, 30m, 1h, 2h, 4h (toggle which ones you want)
On daily+ charts: D, W, M (automatic)
Green dot next to title = live updating
Headline Rows - Macro Bias:
These show broad market direction over longer periods:
3 Day Bias: Trend over last 3 trading sessions (uses 1h data)
Weekly Bias: Trend over last 5 trading sessions (uses 4h data)
Monthly Bias: Trend over last 30 daily bars
Quarterly Bias: Trend over last 13 weekly bars
VIX Fear Index: Market regime based on VIX level - bullish when low, bearish when high
Opening Range Breakout: Status of price vs. session open range (intraday only)
These rows show text: "BULLISH", "BEARISH", or "NEUTRAL"
Indicator Rows - Technical Signals:
These evaluate your configured indicators across all active timeframes:
Fast MA > Medium MA (shows your actual MA settings, e.g., "EMA 10 > SMA 20")
Price > Long MA (e.g., "Price > SMA 200")
Price > VWAP
MACD > Signal
Supertrend (up/down/neutral)
ZLSMA Rising
RSI In Zone
ADX ≥ Minimum
These rows show emojis: GREEB (bullish), RED (bearish), GRAY/YELLOW (neutral/NA)
AVG Column:
Shows percentage of active timeframes that are bullish for that row. This is the KEY metric:
AVG > 70% = strong multi-timeframe bullish alignment
AVG 40-60% = mixed/choppy, no clear trend
AVG < 30% = strong multi-timeframe bearish alignment
How to Use the Table:
For a long trade:
Check AVG column - want to see > 60% ideally
Check headline bias rows - want to see BULLISH, not BEARISH
Check VIX row - bullish market regime preferred
Check ORB row (intraday) - want ABOVE for longs
Scan indicator rows - more green = better confirmation
For a short trade:
Check AVG column - want to see < 40% ideally
Check headline bias rows - want to see BEARISH, not BULLISH
Check VIX row - bearish market regime preferred
Check ORB row (intraday) - want BELOW for shorts
Scan indicator rows - more red = better confirmation
When AVG is 40-60%:
Market is choppy, mixed signals. Either stay out or reduce position size significantly. These are low-probability environments.
Unique Features:
Dynamic Labels: Row names show your actual settings (e.g., "EMA 10 > SMA 20" not generic "Fast > Slow"). You know exactly what's being evaluated.
Customizable Rows: Turn off rows you don't care about. Only show what matters to your strategy.
Customizable Timeframes: On intraday charts, disable 1m or 4h if you don't trade them. Reduces calculation load by 20-40%.
Automatic HTF Handling: On Daily/Weekly/Monthly charts, the table automatically switches to D/W/M columns. No configuration needed.
Performance Smart: "Hide BIAS table on 1D or above" option completely skips all table calculations on higher timeframes if you only trade intraday.
---
6. CANDLESTICK PATTERN RECOGNITION
The indicator automatically detects six major reversal patterns and marks them with emojis at the relevant bars.
Why These Six Patterns:
These are the most statistically significant reversal patterns according to trading literature:
High win rate when appearing at support/resistance
Clear visual structure (not subjective)
Work across all timeframes and assets
Studied extensively by institutions
The Patterns:
Bullish Patterns (appear at bottoms):
Bullish Engulfing: Green candle completely engulfs prior red candle's body. Strong reversal signal.
Hammer: Small body with long lower wick (at least 2× body size). Shows rejection of lower prices by buyers.
Morning Star: Three-candle pattern (large red → small indecision → large green). Very strong bottom reversal.
Bearish Patterns (appear at tops):
Bearish Engulfing: Red candle completely engulfs prior green candle's body. Strong reversal signal.
Shooting Star: Small body with long upper wick (at least 2× body size). Shows rejection of higher prices by sellers.
Evening Star: Three-candle pattern (large green → small indecision → large red). Very strong top reversal.
Interactive Tooltips:
Unlike most pattern indicators that just draw shapes, this one is educational:
Hover your mouse over any pattern emoji
A tooltip appears explaining: what the pattern is, what it means, when it's most reliable, and how to trade it
No need to memorize - learn as you trade
Noise Filter:
"Min candle body % to filter noise" setting prevents false signals:
Patterns require minimum body size relative to price
Filters out tiny candles that don't represent real buying/selling pressure
Adjust based on asset volatility (higher % for crypto, lower for low-volatility stocks)
How to Trade Patterns:
Patterns are NOT standalone entry signals. Use them as:
Confirmation: UT Bot gives signal + pattern appears = stronger entry
Reversal Warning: In a trade, opposite pattern appears = consider tightening stop or taking profit
Support/Resistance Validation: Pattern at key level (PDH, VWAP, MA 200) = level is being respected
Best combined with:
UT Bot or Base signal in same direction
Bias Table alignment (AVG > 60% or < 40%)
Appearance at obvious support/resistance
---
7. VISUAL TOOLS AND FEATURES
VWAP (Volume Weighted Average Price):
Session-anchored VWAP with standard deviation bands. Shows institutional "fair value" for the trading session.
Anchor Options: Session, Day, Week, Month, Quarter, Year. Choose based on your trading timeframe.
Bands: Up to three pairs (X1, X2, X3) showing statistical deviation. Price at outer bands often reverses.
Auto-Hide on HTF: VWAP hides on Daily/Weekly/Monthly charts automatically unless you enable anchored mode.
Use VWAP as:
Directional bias (above = bullish, below = bearish)
Mean reversion levels (outer bands)
Support/resistance (the VWAP line itself)
Previous Day High/Low:
Automatically plots yesterday's high and low on intraday charts:
Updates at start of each new trading day
Theme-aware colors (dark text for light charts, light text for dark charts)
Hidden automatically on Daily/Weekly/Monthly charts
These levels are critical for intraday traders - institutions watch them closely as support/resistance.
Opening Range Breakout (ORB):
Tracks the high/low of the first 5, 15, 30, or 60 minutes of the trading session:
Customizable session times (preset for NYSE, LSE, TSE, or custom)
Shows current breakout status in Bias Table row (ABOVE, BELOW, INSIDE, BUILDING)
Intraday only - auto-disabled on Daily+ charts
ORB is a classic day trading strategy - breakout above opening range often leads to continuation.
Extra Labels:
Change from Open %: Shows how far price has moved from session open (intraday) or daily open (HTF). Green if positive, red if negative.
ADX Badge: Small label at bottom of last bar showing current ADX value. Green when above your minimum threshold, red when below.
RSI Badge: Small label at top of last bar showing current RSI value with zone status (buy zone, sell zone, or neutral).
These labels provide quick at-a-glance confirmation without needing separate indicator windows.
---
8. HOW TO USE THE INDICATOR
Step 1: Add to Chart
Load the indicator on your chosen asset and timeframe
First time: Everything is enabled by default - the chart will look busy
Don't panic - you'll turn off what you don't need
Step 2: Start Simple
Turn OFF everything except:
UT Bot labels (keep these ON)
Bias Table (keep this ON)
Moving Averages (Fast and Medium only)
Suggested Stop Loss and Take Profits
Hide everything else initially. Get comfortable with the basic UT Bot + Bias Table workflow first.
Step 3: Learn the Core Workflow
UT Bot gives a Buy or Sell signal
Check Bias Table AVG column - do you have multi-timeframe alignment?
If yes, enter the trade
Place stop at Suggested Stop Loss line
Scale out at TP levels
Exit on opposite UT signal
Trade this simple system for a week. Get a feel for signal frequency and win rate with your settings.
Step 4: Add Filters Gradually
If you're getting too many losing signals (whipsaws in choppy markets), add filters one at a time:
Try: "Require 2-Bar Trend Confirmation" - wait for 2 bars to confirm direction
Try: ADX filter with minimum threshold - only trade when trend strength is sufficient
Try: RSI pullback filter - only enter on pullbacks, not chasing
Try: Volume filter - require above-average volume
Add one filter, test for a week, evaluate. Repeat.
Step 5: Enable Advanced Features (Optional)
Once you're profitable with the core system, add:
Supertrend for additional trend confirmation
Candlestick patterns for reversal warnings
VWAP for institutional anchor reference
ORB for intraday breakout context
ZLSMA for low-lag trend following
Step 6: Optimize Settings
Every setting has a detailed tooltip explaining what it does and typical values. Hover over any input to read:
What the parameter controls
How it impacts trading
Suggested ranges for scalping, day trading, and swing trading
Start with defaults, then adjust based on your results and style.
Step 7: Set Up Alerts
Right-click chart → Add Alert → Condition: "Luxy Momentum v6" → Choose:
"UT Bot — Buy" for long entries
"UT Bot — Sell" for short entries
"Base Long/Short" for filtered MA cross signals
Optionally enable "Send real-time alert() on UT flip" in settings for immediate notifications.
Common Workflow Variations:
Conservative Trader:
UT signal + Base signal + Candlestick pattern + Bias AVG > 70%
Enter only at major support/resistance
Wider UT sensitivity, multiple filters
Aggressive Trader:
UT signal + Bias AVG > 60%
Enter immediately, no waiting
Tighter UT sensitivity, minimal filters
Swing Trader:
Focus on Daily/Weekly Bias alignment
Ignore intraday noise
Use ORB and PDH/PDL less (or not at all)
Wider stops, patient approach
---
9. PERFORMANCE AND OPTIMIZATION
The indicator is optimized for speed, but with 15+ features running simultaneously, chart load time can add up. Here's how to keep it fast:
Biggest Performance Gains:
Disable Unused Timeframes: In "Time Frames" settings, turn OFF any timeframe you don't actively trade. Each disabled TF saves 10-15% calculation time. If you only day trade 5m, 15m, 1h, disable 1m, 2h, 4h.
Hide Bias Table on Daily+: If you only trade intraday, enable "Hide BIAS table on 1D or above". This skips ALL table calculations on higher timeframes.
Draw UT Visuals Only on Bar Close: Reduces intrabar rendering of SL/TP/Entry lines. Has ZERO impact on logic or alerts - purely visual optimization.
Additional Optimizations:
Turn off VWAP bands if you don't use them
Disable candlestick patterns if you don't trade them
Turn off Supertrend fill if you find it distracting (keep the line)
Reduce "Limit to 10 bars" for SL/TP lines to minimize line objects
Performance Features Built-In:
Smart Caching: Higher timeframe data (3-day bias, weekly bias, etc.) updates once per day, not every bar
Conditional Calculations: Volume filter only calculates when enabled. Swing filter only runs when enabled. Nothing computes if turned off.
Modular Design: Every component is independent. Turn off what you don't need without breaking other features.
Typical Load Times:
5m chart, all features ON, 7 timeframes: ~2-3 seconds
5m chart, core features only, 3 timeframes: ~1 second
1m chart, all features: ~4-5 seconds (many bars to calculate)
If loading takes longer, you likely have too many indicators on the chart total (not just this one).
---
10. FAQ
Q: How is this different from standard UT Bot indicators?
A: Standard UT Bot (originally by @QuantNomad) is just the ATR trailing line and flip signals. This implementation adds:
- Volume weighting and momentum adjustment to the trailing calculation
- Multiple confirmation filters (swing, %, 2-bar, ZLSMA)
- Smart composite stop loss system from multiple S/R layers
- R-multiple take profit system with freeze-on-touch
- Integration with multi-timeframe Bias Table
- Visual audit trail with checkmarks
Q: Can I use this for automated trading?
A: The indicator is designed for discretionary trading. While it has clear signals and alerts, it's not a mechanical system. Context and judgment are required.
Q: Does it repaint?
A: No. All signals respect bar close. UT Bot logic runs intrabar but signals only trigger on confirmed bars. Alerts fire correctly with no lookahead.
Q: Do I need to use all the features?
A: Absolutely not. The indicator is modular. Many profitable traders use just UT Bot + Bias Table + Moving Averages. Start simple, add complexity only if needed.
Q: How do I know which settings to use?
A: Every single input has a detailed tooltip. Hover over any setting to see:
What it does
How it affects trading
Typical values for scalping, day trading, swing trading
Start with defaults, adjust gradually based on results.
Q: Can I use this on crypto 24/7 markets?
A: Yes. ORB will not work (no defined session), but everything else functions normally. Use "Day" anchor for VWAP instead of "Session".
Q: The Bias Table is blank or not showing.
A: Check:
"Show Table" is ON
Table position isn't overlapping another indicator's table (change position)
At least one row is enabled
"Hide BIAS table on 1D or above" is OFF (if on Daily+ chart)
Q: Why are candlestick patterns not appearing?
A: Patterns are relatively rare by design - they only appear at genuine reversal points. Check:
Pattern toggles are ON
"Min candle body %" isn't too high (try 0.05-0.10)
You're looking at a chart with actual reversals (not strong trending market)
Q: UT Bot is too sensitive/not sensitive enough.
A: Adjust "Sensitivity (Key×ATR)". Lower number = tighter stop, more signals. Higher number = wider stop, fewer signals. Read the tooltip for guidance.
Q: Can I get alerts for the Bias Table?
A: The Bias Table is a dashboard for visual analysis, not a signal generator. Set alerts on UT Bot or Base signals, then manually check Bias Table for confirmation.
Q: Does this work on stocks with low volume?
A: Yes, but turn OFF the volume filter. Low volume stocks will never meet relative volume requirements.
Q: How often should I check the Bias Table?
A: Before every entry. It takes 2 seconds to glance at the AVG column and headline rows. This one check can save you from fighting the trend.
Q: What if UT signal and Base signal disagree?
A: UT Bot is more aggressive (ATR trailing). Base signals are more conservative (MA cross + filters). If they disagree, either:
Wait for both to align (safest)
Take the UT signal but with smaller size (aggressive)
Skip the trade (conservative)
There's no "right" answer - depends on your risk tolerance.
---
FINAL NOTES
The indicator gives you an edge. How you use that edge determines results.
For questions, feedback, or support, comment on the indicator page or message the author.
Happy Trading!
CoffeeShopCrypto Supertrend Liquidity EngineMost SuperTrend indicators use fixed ATR multipliers that ignore context—forcing traders to constantly tweak settings that rarely adapt well across timeframes or assets.
This Supertrend is a nodd to and a more completion of the work
done by Olivier Seban ( @olivierseban )
This version replaces guesswork with an adaptive factor based on prior session volatility, dynamically adjusting stops to match current conditions. It also introduces liquidity-aware zones, real-time strength histograms, and a visual control panel—making your stoploss smarter, more responsive, and aligned with how the market actually moves.
📏 The Multiplier Problem & Adaptive Factor Solution
Traditional SuperTrend indicators rely on fixed ATR multipliers—often arbitrary numbers like 1.5, 2, or 3. The issue? No logical basis ties these values to actual market conditions. What works on a 5-minute Nasdaq chart fails on a daily EUR/USD chart. Traders spend hours tweaking multipliers per asset, timeframe, or volatility phase—and still end up with stoplosses that are either too tight or too loose. Worse, the market doesn’t care about your setting—it behaves according to underlying volatility, not your parameter.
This version fixes that by automating the multiplier selection entirely. It uses a 4-zone model based on the current ATR relative to the previous session’s ATR, dynamically adjusting the SuperTrend factor to match current volatility. It eliminates guesswork, adapts to the asset and timeframe, and ensures you’re always using a context-aware stoploss—one that evolves with the market instead of fighting it.
ATR EXAMPLE
Let’s say prior session ATR = 2.00
Now suppose current ATR = 0.32
This places us in Zone 1 (Very Low Volatility)
It doesn’t imply "overbought" or "oversold" — it tells you the market is moving very little, which often means:
Lower risk | Smaller stops | Smaller opportunities (and losses)
🔁 Liquidity Zones vs. Arbitrary Pullbacks
The standard SuperTrend stop loss line often looks like price “barely misses it” before continuing its trend. Traders call this "stop hunting," but what’s really happening is liquidity collection—price pulls back into a zone rich in orders before continuing. The problem? The old SuperTrend doesn’t show this zone. It only draws the outer limit, leaving no visual cue for where entries or continuation moves might realistically originate.
This script introduces 2 levels in the Liquidity Zone. One for Support and one for Stophunts, which draw dynamically between the current price and the SuperTrend line. These levels reflect where the market is most likely to revisit before resuming the trend. By visualizing the area just above the Supertrend stop loss, you can anticipate pullbacks, spot ideal re-entries, and avoid premature exits. This bridges the gap between mechanical stoploss logic and real-world liquidity behavior.
⏳ Prior Session ATR vs. Live ATR
Using real-time ATR to determine movement potential is like driving by looking in your rearview mirror. It’s reactive, not predictive. Traders often base decisions on live ATR, unaware that today’s range is still unfolding —creating volatility mismatches between what’s calculated and what actually matters. Since ATR reflects range, calculating it mid-session gives an incomplete and misleading picture of true volatility.
Instead, this system uses the ATR from the previous session , anchoring your volatility assumptions in a fully-formed price structure . It tells you how far price moved in the last full market phase—be it London, New York, or Tokyo—giving you a more reliable gauge of expected range today. This is a smarter way to estimate how far price could move rather than how far it has moved.
The Smoothing function will take the ATR, Support, Resistance, Stophunt Levels, and the Moving Avearage and smooth them by the calculation you choose.
It will also plot a moving average on your chart against closing prices by the smoothing function you choose.
🧭 Scalping vs. Trending Modes
The market moves in at least 4 phases. Trending, Ranging, Consolidation, Distribution.
Every trader has a different style —some scalp low-volatility moves during off-hours, while others ride macro trends across days. The problem with classic SuperTrend? It treats every market condition the same. A fixed system can’t possibly provide proper stoploss spacing for both a fast scalp and a long-term swing. Traders are forced to rebuild their system every time the market changes character or the session shifts.
This version solves that with a simple toggle:
Scalping or Trend Mode . With one switch, it inverts the logic of the adaptive factor to either tighten or loosen your trailing stops. During low-liquidity hours or consolidation phases, Scalping Mode offers snug stoplosses. During expansion or clear directional bias.
Trend Mode lets the trade breathe. This is flexibility built directly into the logic—not something you have to recalibrate manually.
📉 Histogram Oscillator for Move Strength
In legacy indicators, there’s no built-in way to gauge when the move is losing power . Traders rely on price action or momentum indicators to guess if a trend is fading. But this adds clutter, lag, and often contradiction. The classic SuperTrend doesn’t offer insight into how strong or weak the current trend leg is—only whether price has crossed a line.
This version includes a Trending Liquidity Histogram —a histogram that shows whether the liquidity in the SuperTrend zone is expanding or compressing. When the bars weaken or cross toward zero, it signals liquidity exhaustion . This early warning gives you time to prep for reversals or anticipate pullbacks. It even adapts visually depending on your trading mode, showing color-coded signals for scalping vs. trending behavior. It's both a strength gauge and a trade timing tool—built into your stoploss logic.
Histogram in Scalping Mode
Histogram in Trending Mode
📊 Visual Table for Real-Time Clarity
A major issue with custom indicators is opacity —you don’t always know what settings or values are currently being used. Even worse, if your dynamic logic changes mid-trade, you may not notice unless you go digging into the code or logs. This can create confusion, especially for discretionary traders.
This SuperTrend solves it with a clean visual summary table right on your chart. It shows your current ATR value, adaptive multiplier, trailing stop level, and whether a new zone size is active. That means no surprises and no second-guessing—everything important is visible and updated in real-time.
MACD with Holt–Winters Smoothing [AIBitcoinTrend]👽 MACD with Holt–Winters Smoothing (AIBitcoinTrend)
The MACD with Holt–Winters Smoothing is an momentum indicator that enhances traditional MACD analysis by incorporating Holt–Winters exponential smoothing. This adaptation reduces lag while maintaining trend sensitivity, making it more effective for detecting trend reversals and sustained momentum shifts. Additionally, the indicator includes real-time divergence detection and an ATR-based trailing stop system, helping traders manage risk dynamically.
👽 What Makes the MACD with Holt–Winters Smoothing Unique?
Unlike the standard MACD, which relies on simple exponential moving averages, this version applies Holt–Winters smoothing to better capture trends while filtering out market noise. Combined with real-time divergence detection and a trailing stop system, this indicator allows traders to:
✅ Identify trend strength with a dynamically smoothed MACD signal.
✅ Detect bullish and bearish divergences in real time.
✅Implement Crossover/Crossunder signals tied to ATR-based trailing stops for risk management
👽 The Math Behind the Indicator
👾 Holt–Winters Smoothing for MACD
Traditional MACD calculations use exponential moving averages (EMA) to identify momentum. This indicator improves upon it by applying Holt’s linear trend equations, which enhance signal accuracy by reducing lag and smoothing out fluctuations.
Key Features:
Alpha (α) - Controls the weight of the new data in smoothing.
Beta (β) - Determines how fast the trend component adapts to new changes.
The Holt–Winters Signal Line provides a refined MACD crossover system for better trade execution.
👾 Real-Time Divergence Detection
The indicator identifies bullish and bearish divergences between MACD and price action.
Bullish Divergence: Occurs when price makes a lower low, but MACD makes a higher low – signaling potential upward momentum.
Bearish Divergence: Occurs when price makes a higher high, but MACD makes a lower high – signaling potential downward momentum.
👾 Dynamic ATR-Based Trailing Stop
The indicator includes a trailing stop system based on ATR (Average True Range). This allows traders to manage positions dynamically based on volatility.
Bullish Trailing Stop: Triggers when MACD crosses above the Holt–Winters signal, with a stop placed at low - (ATR × Multiplier).
Bearish Trailing Stop: Triggers when MACD crosses below the Holt–Winters signal, with a stop placed at high + (ATR × Multiplier).
Trailing Stop Adjustments: Expands or contracts dynamically with market conditions, reducing premature exits while securing profits.
👽 How Traders Can Use This Indicator
👾 Divergence Trading
Traders can use real-time divergence detection to anticipate trend reversals before they occur.
Bullish Divergence Setup:
Look for MACD making a higher low, while price makes a lower low.
Enter long when MACD confirms upward momentum.
Bearish Divergence Setup:
Look for MACD making a lower high, while price makes a higher high.
Enter short when MACD confirms downward momentum.
👾 Trailing Stop & Signal-Based Trading
Bullish Setup:
✅ MACD crosses above the Holt–Winters signal.
✅ A bullish trailing stop is placed using low - ATR × Multiplier.
✅ Exit if the price crosses below the stop.
Bearish Setup:
✅ MACD crosses below the Holt–Winters signal.
✅ A bearish trailing stop is placed using high + ATR × Multiplier.
✅ Exit if the price crosses above the stop.
This systematic trade management approach helps traders lock in profits while reducing drawdowns.
👽 Why It’s Useful for Traders
Lag Reduction: Holt–Winters smoothing ensures faster and more reliable trend detection.
Real-Time Divergence Alerts: Identify potential reversals before they happen.
Adaptive Risk Management: ATR-based trailing stops adjust to volatility dynamically.
Works Across Markets & Timeframes: Effective for stocks, forex, crypto, and futures trading.
👽 Indicator Settings
MACD Fast & Slow Lengths: Adjust the MACD short- and long-term EMA periods.
Holt–Winters Alpha & Beta: Fine-tune the smoothing sensitivity.
Enable Divergence Detection: Toggle real-time divergence analysis.
Lookback Period for Divergences: Configure how far back pivot points are detected.
ATR Multiplier for Trailing Stops: Adjust stop-loss sensitivity to market volatility.
Trend Filtering: Enable signal filtering based on trend direction.
Disclaimer: This indicator is designed for educational purposes and does not constitute financial advice. Please consult a qualified financial advisor before making investment decisions.
Dskyz (DAFE) Adaptive Regime - Quant Machine ProDskyz (DAFE) Adaptive Regime - Quant Machine Pro:
Buckle up for the Dskyz (DAFE) Adaptive Regime - Quant Machine Pro, is a strategy that’s your ultimate edge for conquering futures markets like ES, MES, NQ, and MNQ. This isn’t just another script—it’s a quant-grade powerhouse, crafted with precision to adapt to market regimes, deliver multi-factor signals, and protect your capital with futures-tuned risk management. With its shimmering DAFE visuals, dual dashboards, and glowing watermark, it turns your charts into a cyberpunk command center, making trading as thrilling as it is profitable.
Unlike generic scripts clogging up the space, the Adaptive Regime is a DAFE original, built from the ground up to tackle the chaos of futures trading. It identifies market regimes (Trending, Range, Volatile, Quiet) using ADX, Bollinger Bands, and HTF indicators, then fires trades based on a weighted scoring system that blends candlestick patterns, RSI, MACD, and more. Add in dynamic stops, trailing exits, and a 5% drawdown circuit breaker, and you’ve got a system that’s as safe as it is aggressive. Whether you’re a newbie or a prop desk pro, this strat’s your ticket to outsmarting the markets. Let’s break down every detail and see why it’s a must-have.
Why Traders Need This Strategy
Futures markets are a gauntlet—fast moves, volatility spikes (like the April 28, 2025 NQ 1k-point drop), and institutional traps that punish the unprepared. Meanwhile, platforms are flooded with low-effort scripts that recycle old ideas with zero innovation. The Adaptive Regime stands tall, offering:
Adaptive Intelligence: Detects market regimes (Trending, Range, Volatile, Quiet) to optimize signals, unlike one-size-fits-all scripts.
Multi-Factor Precision: Combines candlestick patterns, MA trends, RSI, MACD, volume, and HTF confirmation for high-probability trades.
Futures-Optimized Risk: Calculates position sizes based on $ risk (default: $300), with ATR or fixed stops/TPs tailored for ES/MES.
Bulletproof Safety: 5% daily drawdown circuit breaker and trailing stops keep your account intact, even in chaos.
DAFE Visual Mastery: Pulsing Bollinger Band fills, dynamic SL/TP lines, and dual dashboards (metrics + position) make signals crystal-clear and charts a work of art.
Original Craftsmanship: A DAFE creation, built with community passion, not a rehashed clone of generic code.
Traders need this because it’s a complete, adaptive system that blends quant smarts, user-friendly design, and DAFE flair. It’s your edge to trade with confidence, cut through market noise, and leave the copycats in the dust.
Strategy Components
1. Market Regime Detection
The strategy’s brain is its ability to classify market conditions into five regimes, ensuring signals match the environment.
How It Works:
Trending (Regime 1): ADX > 20, fast/slow EMA spread > 0.3x ATR, HTF RSI > 50 or MACD bullish (htf_trend_bull/bear).
Range (Regime 2): ADX < 25, price range < 3% of close, no HTF trend.
Volatile (Regime 3): BB width > 1.5x avg, ATR > 1.2x avg, HTF RSI overbought/oversold.
Quiet (Regime 4): BB width < 0.8x avg, ATR < 0.9x avg.
Other (Regime 5): Default for unclear conditions.
Indicators: ADX (14), BB width (20), ATR (14, 50-bar SMA), HTF RSI (14, daily default), HTF MACD (12,26,9).
Why It’s Brilliant:
Regime detection adapts signals to market context, boosting win rates in trending or volatile conditions.
HTF RSI/MACD add a big-picture filter, rare in basic scripts.
Visualized via gradient background (green for Trending, orange for Range, red for Volatile, gray for Quiet, navy for Other).
2. Multi-Factor Signal Scoring
Entries are driven by a weighted scoring system that combines candlestick patterns, trend, momentum, and volume for robust signals.
Candlestick Patterns:
Bullish: Engulfing (0.5), hammer (0.4 in Range, 0.2 else), morning star (0.2), piercing (0.2), double bottom (0.3 in Volatile, 0.15 else). Must be near support (low ≤ 1.01x 20-bar low) with volume spike (>1.5x 20-bar avg).
Bearish: Engulfing (0.5), shooting star (0.4 in Range, 0.2 else), evening star (0.2), dark cloud (0.2), double top (0.3 in Volatile, 0.15 else). Must be near resistance (high ≥ 0.99x 20-bar high) with volume spike.
Logic: Patterns are weighted higher in specific regimes (e.g., hammer in Range, double bottom in Volatile).
Additional Factors:
Trend: Fast EMA (20) > slow EMA (50) + 0.5x ATR (trend_bull, +0.2); opposite for trend_bear.
RSI: RSI (14) < 30 (rsi_bull, +0.15); > 70 (rsi_bear, +0.15).
MACD: MACD line > signal (12,26,9, macd_bull, +0.15); opposite for macd_bear.
Volume: ATR > 1.2x 50-bar avg (vol_expansion, +0.1).
HTF Confirmation: HTF RSI < 70 and MACD bullish (htf_bull_confirm, +0.2); RSI > 30 and MACD bearish (htf_bear_confirm, +0.2).
Scoring:
bull_score = sum of bullish factors; bear_score = sum of bearish. Entry requires score ≥ 1.0.
Example: Bullish engulfing (0.5) + trend_bull (0.2) + rsi_bull (0.15) + htf_bull_confirm (0.2) = 1.05, triggers long.
Why It’s Brilliant:
Multi-factor scoring ensures signals are confirmed by multiple market dynamics, reducing false positives.
Regime-specific weights make patterns more relevant (e.g., hammers shine in Range markets).
HTF confirmation aligns with the big picture, a quant edge over simplistic scripts.
3. Futures-Tuned Risk Management
The risk system is built for futures, calculating position sizes based on $ risk and offering flexible stops/TPs.
Position Sizing:
Logic: Risk per trade (default: $300) ÷ (stop distance in points * point value) = contracts, capped at max_contracts (default: 5). Point value = tick value (e.g., $12.5 for ES) * ticks per point (4) * contract multiplier (1 for ES, 0.1 for MES).
Example: $300 risk, 8-point stop, ES ($50/point) → 0.75 contracts, rounded to 1.
Impact: Precise sizing prevents over-leverage, critical for micro contracts like MES.
Stops and Take-Profits:
Fixed: Default stop = 8 points, TP = 16 points (2:1 reward/risk).
ATR-Based: Stop = 1.5x ATR (default), TP = 3x ATR, enabled via use_atr_for_stops.
Logic: Stops set at swing low/high ± stop distance; TPs at 2x stop distance from entry.
Impact: ATR stops adapt to volatility, while fixed stops suit stable markets.
Trailing Stops:
Logic: Activates at 50% of TP distance. Trails at close ± 1.5x ATR (atr_multiplier). Longs: max(trail_stop_long, close - ATR * 1.5); shorts: min(trail_stop_short, close + ATR * 1.5).
Impact: Locks in profits during trends, a game-changer in volatile sessions.
Circuit Breaker:
Logic: Pauses trading if daily drawdown > 5% (daily_drawdown = (max_equity - equity) / max_equity).
Impact: Protects capital during black swan events (e.g., April 27, 2025 ES slippage).
Why It’s Brilliant:
Futures-specific inputs (tick value, multiplier) make it plug-and-play for ES/MES.
Trailing stops and circuit breaker add pro-level safety, rare in off-the-shelf scripts.
Flexible stops (ATR or fixed) suit different trading styles.
4. Trade Entry and Exit Logic
Entries and exits are precise, driven by bull_score/bear_score and protected by drawdown checks.
Entry Conditions:
Long: bull_score ≥ 1.0, no position (position_size <= 0), drawdown < 5% (not pause_trading). Calculates contracts, sets stop at swing low - stop points, TP at 2x stop distance.
Short: bear_score ≥ 1.0, position_size >= 0, drawdown < 5%. Stop at swing high + stop points, TP at 2x stop distance.
Logic: Tracks entry_regime for PNL arrays. Closes opposite positions before entering.
Exit Conditions:
Stop-Loss/Take-Profit: Hits stop or TP (strategy.exit).
Trailing Stop: Activates at 50% TP, trails by ATR * 1.5.
Emergency Exit: Closes if price breaches stop (close < long_stop_price or close > short_stop_price).
Reset: Clears stop/TP prices when flat (position_size = 0).
Why It’s Brilliant:
Score-based entries ensure multi-factor confirmation, filtering out weak signals.
Trailing stops maximize profits in trends, unlike static exits in basic scripts.
Emergency exits add an extra safety layer, critical for futures volatility.
5. DAFE Visuals
The visuals are pure DAFE magic, blending function with cyberpunk flair to make signals intuitive and charts stunning.
Shimmering Bollinger Band Fill:
Display: BB basis (20, white), upper/lower (green/red, 45% transparent). Fill pulses (30–50 alpha) by regime, with glow (60–95 alpha) near bands (close ≥ 0.995x upper or ≤ 1.005x lower).
Purpose: Highlights volatility and key levels with a futuristic glow.
Visuals make complex regimes and signals instantly clear, even for newbies.
Pulsing effects and regime-specific colors add a DAFE signature, setting it apart from generic scripts.
BB glow emphasizes tradeable levels, enhancing decision-making.
Chart Background (Regime Heatmap):
Green — Trending Market: Strong, sustained price movement in one direction. The market is in a trend phase—momentum follows through.
Orange — Range-Bound: Market is consolidating or moving sideways, with no clear up/down trend. Great for mean reversion setups.
Red — Volatile Regime: High volatility, heightened risk, and larger/faster price swings—trade with caution.
Gray — Quiet/Low Volatility: Market is calm and inactive, with small moves—often poor conditions for most strategies.
Navy — Other/Neutral: Regime is uncertain or mixed; signals may be less reliable.
Bollinger Bands Glow (Dynamic Fill):
Neon Red Glow — Warning!: Price is near or breaking above the upper band; momentum is overstretched, watch for overbought conditions or reversals.
Bright Green Glow — Opportunity!: Price is near or breaking below the lower band; market could be oversold, prime for bounce or reversal.
Trend Green Fill — Trending Regime: Fills between bands with green when the market is trending, showing clear momentum.
Gold/Yellow Fill — Range Regime: Fills with gold/aqua in range conditions, showing the market is sideways/oscillating.
Magenta/Red Fill — Volatility Spike: Fills with vivid magenta/red during highly volatile regimes.
Blue Fill — Neutral/Quiet: A soft blue glow for other or uncertain market states.
Moving Averages:
Display: Blue fast EMA (20), red slow EMA (50), 2px.
Purpose: Shows trend direction, with trend_dir requiring ATR-scaled spread.
Dynamic SL/TP Lines:
Display: Pulsing colors (red SL, green TP for Trending; yellow/orange for Range, etc.), 3px, with pulse_alpha for shimmer.
Purpose: Tracks stops/TPs in real-time, color-coded by regime.
6. Dual Dashboards
Two dashboards deliver real-time insights, making the strat a quant command center.
Bottom-Left Metrics Dashboard (2x13):
Metrics: Mode (Active/Paused), trend (Bullish/Bearish/Neutral), ATR, ATR avg, volume spike (YES/NO), RSI (value + Oversold/Overbought/Neutral), HTF RSI, HTF trend, last signal (Buy/Sell/None), regime, bull score.
Display: Black (29% transparent), purple title, color-coded (green for bullish, red for bearish).
Purpose: Consolidates market context and signal strength.
Top-Right Position Dashboard (2x7):
Metrics: Regime, position side (Long/Short/None), position PNL ($), SL, TP, daily PNL ($).
Display: Black (29% transparent), purple title, color-coded (lime for Long, red for Short).
Purpose: Tracks live trades and profitability.
Why It’s Brilliant:
Dual dashboards cover market context and trade status, a rare feature.
Color-coding and concise metrics guide beginners (e.g., green “Buy” = go).
Real-time PNL and SL/TP visibility empower disciplined trading.
7. Performance Tracking
Logic: Arrays (regime_pnl_long/short, regime_win/loss_long/short) track PNL and win/loss by regime (1–5). Updated on trade close (barstate.isconfirmed).
Purpose: Prepares for future adaptive thresholds (e.g., adjust bull_score min based on regime performance).
Why It’s Brilliant: Lays the groundwork for self-optimizing logic, a quant edge over static scripts.
Key Features
Regime-Adaptive: Optimizes signals for Trending, Range, Volatile, Quiet markets.
Futures-Optimized: Precise sizing for ES/MES with tick-based risk inputs.
Multi-Factor Signals: Candlestick patterns, RSI, MACD, and HTF confirmation for robust entries.
Dynamic Exits: ATR/fixed stops, 2:1 TPs, and trailing stops maximize profits.
Safe and Smart: 5% drawdown breaker and emergency exits protect capital.
DAFE Visuals: Shimmering BB fill, pulsing SL/TP, and dual dashboards.
Backtest-Ready: Fixed qty and tick calc for accurate historical testing.
How to Use
Add to Chart: Load on a 5min ES/MES chart in TradingView.
Configure Inputs: Set instrument (ES/MES), tick value ($12.5/$1.25), multiplier (1/0.1), risk ($300 default). Enable ATR stops for volatility.
Monitor Dashboards: Bottom-left for regime/signals, top-right for position/PNL.
Backtest: Run in strategy tester to compare regimes.
Live Trade: Connect to Tradovate or similar. Watch for slippage (e.g., April 27, 2025 ES issues).
Replay Test: Try April 28, 2025 NQ drop to see regime shifts and stops.
Disclaimer
Trading futures involves significant risk of loss and is not suitable for all investors. Past performance does not guarantee future results. Backtest results may differ from live trading due to slippage, fees, or market conditions. Use this strategy at your own risk, and consult a financial advisor before trading. Dskyz (DAFE) Trading Systems is not responsible for any losses incurred.
Backtesting:
Frame: 2023-09-20 - 2025-04-29
Slippage: 3
Fee Typical Range (per side, per contract)
CME Exchange $1.14 – $1.20
Clearing $0.10 – $0.30
NFA Regulatory $0.02
Firm/Broker Commis. $0.25 – $0.80 (retail prop)
TOTAL $1.60 – $2.30 per side
Round Turn: (enter+exit) = $3.20 – $4.60 per contract
Final Notes
The Dskyz (DAFE) Adaptive Regime - Quant Machine Pro is more than a strategy—it’s a revolution. Crafted with DAFE’s signature precision, it rises above generic scripts with adaptive regimes, quant-grade signals, and visuals that make trading a thrill. Whether you’re scalping MES or swinging ES, this system empowers you to navigate markets with confidence and style. Join the DAFE crew, light up your charts, and let’s dominate the futures game!
(This publishing will most likely be taken down do to some miscellaneous rule about properly displaying charting symbols, or whatever. Once I've identified what part of the publishing they want to pick on, I'll adjust and repost.)
Use it with discipline. Use it with clarity. Trade smarter.
**I will continue to release incredible strategies and indicators until I turn this into a brand or until someone offers me a contract.
Created by Dskyz, powered by DAFE Trading Systems. Trade smart, trade bold.






















