INVITE-ONLY SCRIPT

Quantum Reversal Engine [ApexLegion]

86
Quantum Reversal Engine [ApexLegion]


STRATEGY OVERVIEW
This strategy is constructed using 5 custom analytical filters that analyze different market dimensions - trend structure, momentum expansion, volume confirmation, price action patterns, and reversal detection - with results processed through a multi-component scoring calculation that determines signal generation and position management decisions.
Why These Custom Filters Were Independently Developed:
This strategy employs five custom-developed analytical filters:

1. Apex Momentum Core (AMC) - Custom oscillator with volatility-scaled deviation calculation
Standard oscillators lag momentum shifts by 2-3 bars. Custom calculation designed for momentum analysis

2. Apex Wick Trap (AWT) - Wick dominance analysis for trap detection
Existing wick analysis tools don't quantify trap conditions. Uses specific ratios for wick dominance detection

3. Apex Volume Pulse (AVP) - Volume surge validation with participation confirmation
Volume indicators typically use simple averages. Uses surge multipliers with participation validation

4. Apex TrendGuard (ATG) - Angle-based trend detection with volatility band integration
EMA slope calculations often produce false signals. Uses angle analysis with volatility bands for confirmation

5. Quantum Composite Filter (QCF) - Multi-component scoring and signal generation system
Composite scoring designed to filter noise by requiring multiple confirmations before signal activation.

Each filter represents mathematical calculations designed to address specific analytical requirements.

Framework Operation: The strategy functions as a scoring framework where each filter contributes weighted points based on market conditions. Entry signals are generated when minimum threshold scores are met. Exit management operates through a three-tier system with continued signal strength evaluation determining position holds versus closures at each TP level.
Integration Challenge: The core difficulty was creating a scoring system where five independent filters could work together without generating conflicting signals. This required backtesting to determine effective weight distributions.

Custom Filter Development:
Each of the five filters represents analytical approaches developed through testing and validation:

Integration Validation: Each filter underwent individual testing before integration. The composite scoring system required validation to verify that filters complement rather than conflict with each other, resulting in a cohesive analytical framework that was tested during the development period.

These filters represent custom-developed components created specifically for this strategy, with each component addressing different analytical requirements through testing and parameter adjustment.

Programming Features:
Multi-timeframe data handling with backup systems
Performance optimization techniques
Error handling for live trading scenarios
Parameter adaptation based on market conditions

Strategy Features:
Uses multi-filter confirmation approach
Adapts position holding based on continued signal strength
Includes analysis tools for trade review and optimization

Ongoing Development: The strategy was developed through testing and validation processes during the creation period.


COMPONENT EXPLANATION

EMA System
Uses 8 exponential moving averages (7, 14, 21, 30, 50, 90, 120, 200 periods) for trend identification. Primary signals come from 8/21 EMA crossovers, while longer EMAs provide structural context. EMA 1-4 determine short-term structure, EMA 5-8 provide long-term trend confirmation.

Apex Momentum Core (AMC)
Built custom oscillator mathematics after testing dozens of momentum calculation methods. Final algorithm uses price deviation from EMA baseline with volatility scaling to reduce lag while maintaining accuracy across different market conditions.

Custom momentum oscillator using price deviation from EMA baseline:
Pine Script®
apxCI = 100 * (source - emaBase) / (sensitivity * sqrt(deviation + 1)) fastLine = EMA(apxCI, smoothing) signalLine = SMA(fastLine, 4)

Signals generate when fastLine crosses signalLine at +50/-50 thresholds.
This identifies momentum expansion before traditional oscillators.

Apex Volume Pulse (AVP)
Created volume surge analysis that goes beyond simple averages. Extensive testing determined 1.3x multiplier with participation validation provides reliable confirmation while filtering false volume spikes.

Compares current volume to 21-period moving average.
Requires 1.3x average volume for signal confirmation. This filters out low-volume moves during quiet periods and confirms breakouts with actual participation.

Apex Wick Trap (AWT)
Developed proprietary wick trap detection through analysis of failed breakout patterns. Tested various ratio combinations before settling on 60% wick dominance + 20% body limit as effective trap identification parameters.

Analyzes candle structure to identify failed breakouts:
Pine Script®
candleRange = math.max(high - low, 0.00001) candleBody = math.abs(close - open) bodyRatio = candleBody / candleRange upperWick = high - math.max(open, close) lowerWick = math.min(open, close) - low upperWickRatio = upperWick / candleRange lowerWickRatio = lowerWick / candleRange trapWickLong = showAWT and lowerWickRatio > minWickDom and bodyRatio < bodyToRangeLimit and close > open trapWickShort = showAWT and upperWickRatio > minWickDom and bodyRatio < bodyToRangeLimit and close < open
This catches reversals after fake breakouts.

Apex TrendGuard (ATG)
Built angle-based trend detection after standard EMA crossovers proved insufficient. Combined slope analysis with volatility bands through iterative testing to eliminate false trend signals.

EMA slope analysis with volatility bands:
Fast EMA (21) vs Slow EMA (55) for trend direction
Angle calculation: atan(fast - slow) * 180 / π
ATR bands (1.75x multiplier) for breakout confirmation
Minimum 25° angle for strong trend classification


Core Algorithm Framework

1. Composite Signal Generation
Pine Script®
calculateCompositeSignals() => // Component Conditions structSignalLong = trapWickLong structSignalShort = trapWickShort momentumLong = amcBuySignal momentumShort = amcSellSignal volumeSpike = volume > volAvg_AVP * volMult_AVP priceStrength_Long = close > open and close > close[1] priceStrength_Short = close < open and close < close[1] rsiMfiComboValue = (ta.rsi(close, 14) + ta.mfi(close, 14)) / 2 reversalTrigger_Long = ta.crossover(rsiMfiComboValue, 50) reversalTrigger_Short = ta.crossunder(rsiMfiComboValue, 50) isEMACrossUp = ta.crossover(emaFast_ATG, emaSlow_ATG) isEMACrossDown = ta.crossunder(emaFast_ATG, emaSlow_ATG) // Enhanced Composite Score Calculation scoreBuy = 0.0 scoreBuy += structSignalLong ? scoreStruct : 0.0 scoreBuy += momentumLong ? scoreMomentum : 0.0 scoreBuy += flashSignal ? weightFlash : 0.0 scoreBuy += blinkSignal ? weightBlink : 0.0 scoreBuy += volumeSpike_AVP ? scoreVolume : 0.0 scoreBuy += priceStrength_Long ? scorePriceAction : 0.0 scoreBuy += reversalTrigger_Long ? scoreReversal : 0.0 scoreBuy += emaAlignment_Bull ? weightTrendAlign : 0.0 scoreBuy += strongUpTrend ? weightTrendAlign : 0.0 scoreBuy += highRisk_Long ? -1.2 : 0.0 scoreBuy += signalGreenDot ? 1.0 : 0.0 scoreBuy += isAMCUp ? 0.8 : 0.0 scoreBuy += isVssBuy ? 1.5 : 0.0 scoreBuy += isEMACrossUp ? 1.0 : 0.0 scoreBuy += signalRedX ? -1.0 : 0.0 scoreSell = 0.0 scoreSell += structSignalShort ? scoreStruct : 0.0 scoreSell += momentumShort ? scoreMomentum : 0.0 scoreSell += flashSignal ? weightFlash : 0.0 scoreSell += blinkSignal ? weightBlink : 0.0 scoreSell += volumeSpike_AVP ? scoreVolume : 0.0 scoreSell += priceStrength_Short ? scorePriceAction : 0.0 scoreSell += reversalTrigger_Short ? scoreReversal : 0.0 scoreSell += emaAlignment_Bear ? weightTrendAlign : 0.0 scoreSell += strongDownTrend ? weightTrendAlign : 0.0 scoreSell += highRisk_Short ? -1.2 : 0.0 scoreSell += signalRedX ? 1.0 : 0.0 scoreSell += isAMCDown ? 0.8 : 0.0 scoreSell += isVssSell ? 1.5 : 0.0 scoreSell += isEMACrossDown ? 1.0 : 0.0 scoreSell += signalGreenDot ? -1.0 : 0.0 compositeBuySignal = enableComposite and scoreBuy >= thresholdCompositeBuy compositeSellSignal = enableComposite and scoreSell >= thresholdCompositeSell if compositeBuySignal and compositeSellSignal compositeBuySignal := false compositeSellSignal := false [compositeBuySignal, compositeSellSignal, scoreBuy, scoreSell] [compositeBuySignal, compositeSellSignal, scoreBuy, scoreSell] = calculateCompositeSignals() // Final Entry Signals entryCompositeBuySignal = compositeBuySignal and ta.rising(emaFast_ATG, 2) entryCompositeSellSignal = compositeSellSignal and ta.falling(emaFast_ATG, 2)

Calculates weighted scores from independent modules and activates signals only when threshold requirements are met.

2. Smart Exit Hold Evaluation System
Pine Script®
evaluateSmartHold() => compositeBuyRecentCount = 0 compositeSellRecentCount = 0 for i = 0 to signalLookbackBars - 1 compositeBuyRecentCount += compositeBuySignal ? 1 : 0 compositeSellRecentCount += compositeSellSignal ? 1 : 0 avgVolume = ta.sma(volume, 20) volumeSpike = volume > avgVolume * volMultiplier // MTF Bull/Bear conditions mtf_bull = mtf_emaFast_final > mtf_emaSlow_final mtf_bear = mtf_emaFast_final < mtf_emaSlow_final emaBackupDivergence = math.abs(mtf_emaFast_backup - mtf_emaSlow_backup) / mtf_emaSlow_backup emaBackupStrong = emaBackupDivergence > 0.008 mtfConflict_Long = inLong and mtf_bear and emaBackupStrong mtfConflict_Short = inShort and mtf_bull and emaBackupStrong // Layer 1: ATR-Based Dynamic Threshold (Market Volatility Intelligence) atr_raw = ta.atr(atrLen) atrValue = na(atr_raw) ? close * 0.02 : atr_raw atrRatio = atrValue / close dynamicThreshold = atrRatio > 0.02 ? 1.0 : (atrRatio > 0.01 ? 1.5 : 2.8) // Layer 2: ROI-Conditional Time Intelligence (Selective Pressure) timeMultiplier_Long = realROI >= 0 ? 1.0 : // Profitable positions: No time pressure holdTimer_Long <= signalLookbackBars ? 1.0 : // Loss positions 1-8 bars: Base holdTimer_Long <= signalLookbackBars * 2 ? 1.1 : // Loss positions 9-16 bars: +10% stricter 1.3 // Loss positions 17+ bars: +30% stricter timeMultiplier_Short = realROI >= 0 ? 1.0 : // Profitable positions: No time pressure holdTimer_Short <= signalLookbackBars ? 1.0 : // Loss positions 1-8 bars: Base holdTimer_Short <= signalLookbackBars * 2 ? 1.1 : // Loss positions 9-16 bars: +10% stricter 1.3 // Loss positions 17+ bars: +30% stricter // Dual-Layer Threshold Calculation baseThreshold_Long = mtfConflict_Long ? dynamicThreshold + 1.0 : dynamicThreshold baseThreshold_Short = mtfConflict_Short ? dynamicThreshold + 1.0 : dynamicThreshold timeAdjustedThreshold_Long = baseThreshold_Long * timeMultiplier_Long timeAdjustedThreshold_Short = baseThreshold_Short * timeMultiplier_Short // Final Smart Hold Decision with Dual-Layer Intelligence smartHold_Long = not mtfConflict_Long and smartScoreLong >= timeAdjustedThreshold_Long and compositeBuyRecentCount >= signalMinCount smartHold_Short = not mtfConflict_Short and smartScoreShort >= timeAdjustedThreshold_Short and compositeSellRecentCount >= signalMinCount [smartHold_Long, smartHold_Short, mtf_bull, mtf_bear] [smartHold_Long, smartHold_Short, mtf_bull, mtf_bear] = evaluateSmartHold()

Evaluates whether to hold positions past TP1/TP2/TP3 levels based on continued signal strength, volume confirmation, and multi-timeframe trend alignment


HOW TO USE THE STRATEGY

Step 1: Initial Setup
Apply strategy to your preferred timeframe (backtested on 15M)
Enable "Use Heikin-Ashi Base" for smoother signals in volatile markets
"Show EMA Lines" and "Show Ichimoku Cloud" are enabled for visual context
Set default quantities to match your risk management (5% equity default)

Step 2: Signal Recognition
快照
Visual Signal Guide:
Visual Signal Guide - Complete Reference:
🔶 Red Diamond: Bearish momentum breakdown - short reversal signal
🔷 Blue Diamond: Strong bullish momentum - long reversal signal
🔵 Blue Dot: Volume-confirmed directional move - trend continuation
🟢 Green Dot: Bullish EMA crossover - trend reversal confirmation
🟠 Orange X: Oversold reversal setup - counter-trend opportunity
❌ Red X: Bearish EMA breakdown - trend reversal warning
✡ Star Uprising: Strong bullish convergence
💥 Ultra Entry: Ultra-rapid downward momentum acceleration
▲ VSS Long: Velocity-based bullish momentum confirmation
▼ VSS Short: Velocity-based bearish momentum confirmation
快照
Step 3: Entry Execution
For Long Positions:
1. ✅ EMA1 crossed above EMA2 exactly 3 bars ago [ta.crossover(ema1,ema2)[3]]
2. ✅ Current EMA structure: EMA1 > EMA2 (maintained)
3. ✅ Composite score ≥ 5.0 points (6.5+ for 5-minute timeframes)
4. ✅ Cooldown period completed (no recent stop losses)
5. ✅ Volume spike confirmation (green dot/blue dot signals)
6. ✅ Bullish candle closes above EMA structure

For Short Positions:
1. ✅ EMA1 crossed below EMA2 exactly 3 bars ago [ta.crossunder(ema1,ema2)[3]]
2. ✅ Current EMA structure: EMA1 < EMA2 (maintained)
3. ✅ Composite score ≥ 5.4 points (7.0+ for 5-minute timeframes)
4. ✅ Cooldown period completed (no recent stop losses)
5. ✅ Momentum breakdown (red diamond/red X signals)
6. ✅ Bearish candle closes below EMA structure

🎯 Critical Timing Note: The strategy requires EMA crossover to have occurred 3 bars prior to entry, not at the current bar. This attempts to avoid premature entries and may improve signal reliability.

Step 4: Reading Market Context
EMA Ribbon Interpretation:
All EMAs ascending = Strong uptrend context
EMAs 1-3 above EMAs 4-8 = Bullish structure
Tight EMA spacing = Low volatility/consolidation
Wide EMA spacing = High volatility/trending

Ichimoku Cloud Context:
Price above cloud = Bullish environment
Price below cloud = Bearish environment
Cloud color intensity = Momentum strength
Thick cloud = Strong support/resistance


THE SMART EXIT GRID SYSTEM
Smart Exit Grid Approach:
The Smart Exit Grid uses dynamic hold evaluation that continuously analyzes market conditions after position entry. This differs from traditional fixed profit targets by adapting exit timing based on real-time signal strength.

How Smart Exit Grid System Works
The system operates through three evaluation phases:

Smart Score Calculation:
The smart score calculation aggregates 22 signal components in real-time, combining reversal warnings, continuation signals, trend alignment indicators, EMA structural analysis, and risk penalties into a numerical representation of market conditions. MTF analysis provides additional confirmation as a separate validation layer.
Signal Stack Management:
The per-tick signal accumulation system monitors 22 active signal types with MTF providing trend validation and conflict detection as a separate confirmation layer.

Take Profit Progression:
Smart Exit Activation:
The QRE system activates Smart Exit Grid immediately upon position entry. When strategy.entry() executes, the system initializes monitoring systems designed to track position progress.

Upon position opening, holdTimer begins counting, establishing the foundation for subsequent decisions. The Smart Exit Grid starts accumulating signals from entry, with all 22 signal components beginning real-time tracking when the trade opens.

The system operates on continuous evaluation where smartScoreLong and smartScoreShort calculate from the first tick after entry. QRE's approach is designed to capture market structure changes, trend deteriorations, or signal pattern shifts that can trigger protective exits even before the first take profit level is reached.

This activation creates a proactive position management framework. The 8-candle sliding window starts from entry, meaning that if market conditions change rapidly after entry - due to news events, liquidity shifts, or technical changes - the system can respond within the configured lookback period.

TP Markers as Reference Points:
The TP1, TP2, and TP3 levels function as reference points rather than mandatory exit triggers. When longTP1Hit or shortTP1Hit conditions activate, they serve as profit confirmation markers that inform the Smart Exit algorithm about achieved reward levels, but don't automatically initiate position closure.

These TP markers enhance the Smart Exit decision matrix by providing profit context to ongoing signal evaluation. The system recognizes when positions have achieved target returns, but the actual exit decision remains governed by continuous smart score evaluation and signal stack analysis.

TP2 Reached: Enhanced Monitoring
TP2 represents significant profit capture with additional monitoring features:

This approach is designed to help avoid premature profit-taking during trending conditions. If TP2 is reached but smartScoreLong remains above the dynamic threshold and the 8-candle sliding window shows persistent signals, the position continues holding. If market structure deteriorates before reaching TP2, the Smart Exit can trigger closure based on signal analysis.

The visual TP circles that appear when levels are reached serve as performance tracking tools, allowing users to see how frequently entries achieve various profit levels while understanding that actual exit timing depends on market structure analysis.

Risk Management Systems:
Operating independently from the Smart Exit Grid are two risk management systems: the Trap Wick Detection Protocol and the Stop Loss Mechanism. These systems maintain override authority over other exit logic.

The Trap Wick System monitors for conditionBearTrapExit during long positions and conditionBullTrapExit during short positions. When detected, these conditions trigger position closure with state reset, bypassing Smart Exit evaluations. This system recognizes that certain candlestick patterns may indicate reversal risk.

Volatility Exit Monitoring: The strategy monitors for isStrongBearCandle combined with conditionBearTrapExit, recognizing when market structure may be shifting.

Volume Validation: Before exiting on volatility, the strategy requires volume confirmation: volume > ta.sma(volume, 20) * 1.8. This is designed to filter exits on weak, low-volume movements.

The Stop Loss Mechanism operates through multiple triggers including traditional price-based stops (longSLHit, shortSLHit) and early exit conditions based on smart score deterioration combined with negative ROI. The early exit logic activates when smartScoreLong < 1.0 or smartScoreShort < 1.0 while realROI < -0.9%.

These risk management systems are designed so that risk scenarios can trigger protective closure with state reset across all 22 signal counters, TP tracking variables, and smart exit states.

This architecture - Smart Exit activation, TP markers as navigation tools, and independent risk management - creates a position management system that adapts to market conditions while maintaining risk discipline through dedicated protection protocols.

TP3 Reached: Enhanced Protection
Once TP3 is hit, the strategy shifts into enhanced monitoring:
EMA Structure Monitoring: isEMAStructureDown becomes a primary exit trigger
MTF Alignment: The higher timeframe receives increased consideration
Wick Trap Priority: conditionBearTrapExit becomes an immediate exit signal

Approach Differences:
Traditional Fixed Exits:
Exit at predetermined levels regardless of market conditions
May exit during trend continuation
May exit before trend completion
Limited adaptation to changing volatility

Smart Exit Grid Approach:
Adaptive timing based on signal conditions
Exits when supporting signals weaken
Multi-timeframe validation for trend confirmation
Volume confirmation requirements for holds
Structural monitoring for trend analysis

Dynamic ATR-Based Smart Score Threshold System
Market Volatility Adaptive Scoring
Pine Script®
// Real-time ATR Analysis atr_raw = ta.atr(atrLen) atrValue = na(atr_raw) ? close * 0.02 : atr_raw atrRatio = atrValue / close // Three-Tier Dynamic Threshold Matrix dynamicThreshold = atrRatio > 0.02 ? 1.0 : // High volatility: Lower threshold (atrRatio > 0.01 ? 1.5 : // Medium volatility: Standard 2.8) // Low volatility: Higher threshold

The market volatility adaptive scoring calculates real-time ATR with a 2% fallback for new markets. The atrRatio represents the relationship between current volatility and price, creating a foundation for threshold adjustment.
The three-tier dynamic threshold matrix responds to market conditions by adjusting requirements based on volatility levels: lowering thresholds during high volatility periods above 2% ATR ratio to 1.0 points, maintaining standard requirements at 1.5 points for medium volatility between 1-2%, and raising standards to 2.8 points during low volatility periods below 1%.

Profit-Loss Adaptive Management:
The system applies different evaluation criteria based on position performance:

Winning Positions (realROI ≥ 0%):
→ timeMultiplier = 1.0 (No additional pressure)
→ Maintains base threshold requirements
→ Allows natural progression to TP2/TP3 levels

Losing Positions (realROI < 0%):
→ Progressive time pressure activated
→ Increasingly strict requirements over time
→ Faster decision-making on underperforming trades

ROI-Adaptive Smart Hold Decision Process:
The strategy uses a profit-loss adaptive system:

Winning Position Management (ROI ≥ 0%):
✅ Standard threshold requirements maintained
✅ No additional time-based pressure applied
✅ Allows positions to progress toward TP2/TP3 levels
✅ timeMultiplier remains at 1.0 regardless of hold duration

Losing Position Management (ROI < 0%):
⚠️ Time-based threshold adjustments activated
⚠️ Progressive increase in required signal strength over time
⚠️ Earlier exit evaluation on underperforming positions
⚠️ timeMultiplier increases from 1.0 → 1.1 → 1.3 based on hold duration
Real-Time Monitoring:
Monitor Analysis Table → "Smart" filter → "Score" vs "Dynamic Threshold"

Winning positions: Evaluation based on signal strength deterioration only
Losing positions: Evaluation considers both signal strength and progressive time adjustments
Breakeven positions (0% ROI): Treated as winning positions - no time adjustments

This approach differentiates between winning and losing positions in the hold evaluation process, requiring higher signal thresholds for extended holding of losing positions while maintaining standard requirements for winning ones.
ROI-Conditional Decision Matrix Examples:

Scenario 1 - Winning Position in Any Market:
Position ROI: +0.8% → timeMultiplier = 1.0 (regardless of hold time)
ATR Medium (1.2%) → dynamicThreshold = 1.5
Final Threshold = 1.5 × 1.0 = 1.5 points ✅ Position continues

Scenario 2 - Losing Position, Extended Hold:
Position ROI: -0.5% → Time pressure activated
Hold Time: 20 bars → timeMultiplier = 1.3
ATR Low (0.8%) → dynamicThreshold = 2.8
Final Threshold = 2.8 × 1.3 = 3.64 points ⚡ Enhanced requirements

Scenario 3 - Fresh Losing Position:
Position ROI: -0.3% → Time pressure activated
Hold Time: 5 bars → timeMultiplier = 1.0 (still early)
ATR High (2.1%) → dynamicThreshold = 1.0
Final Threshold = 1.0 × 1.0 = 1.0 points 📊 Recovery opportunity

Scenario 4 - Breakeven Position:
Position ROI: 0.0% → timeMultiplier = 1.0 (no pressure)
Hold Time: 15 bars → No time penalty applied
Final Threshold = dynamicThreshold only ⚖️ Neutral treatment

🔄8-Candle Sliding Window Signal Rotation System

Composite Signal Counting Mechanism
Pine Script®
// Dynamic Lookback Window (configurable: default 8) signalLookbackBars = input.int(8, "Composite Lookback Bars", minval=1, maxval=50) // Rolling Signal Analysis compositeBuyRecentCount = 0 compositeSellRecentCount = 0 for i = 0 to signalLookbackBars - 1 compositeBuyRecentCount += compositeBuySignal ? 1 : 0 compositeSellRecentCount += compositeSellSignal ? 1 : 0

Candle Flow Example (8-bar window):
[Current] [1] [2] [3] [4] [5] [6] [7] [8] → [Drop oldest]
✓ ✓ ✗ ✓ ✗ ✓ ✗ ✓ 🗑️
New Signal Count = 5/8 signals in window
Threshold Check: 5 ≥ signalMinCount (2) = HOLD CONFIRMED

Signal Decay & Refresh Mechanism
Pine Script®
// Signal Persistence Tracking if compositeBuyRecentCount >= signalMinCount smartHold_Long = true else smartHold_Long = false

The composite signal counting operates through a configurable sliding window. The system maintains rolling counters that scan backward through the specified number of candles.

During each evaluation cycle, the algorithm iterates through historical bars, incrementing counters when composite signals are detected. This creates a dynamic signal persistence measurement where recent signal density determines holding decisions.

The sliding window rotation functions like a moving conveyor belt where new signals enter while the oldest signals drop off. For example, in an 8-bar window, if 5 out of 8 recent candles showed composite buy signals, and the minimum required count is 2, the system confirms the hold condition. As new bars form, the window slides forward, potentially changing the signal count and triggering exit conditions when signal density falls below the threshold.

Signal decay and refresh occur continuously where smartHold_Long remains true only when compositeBuyRecentCount exceeds signalMinCount. When recent signal density drops below the minimum requirement, the system switches to exit mode.

Advanced Signal Stack Management - 22-Signal Real-Time Evaluation
Pine Script®
// Long Position Signal Stacking (calc_on_every_tick=true) if inLong // Primary Reversal Signals if signalRedDiamond: signalCountRedDiamond += 1 // -0.5 points if signalStarUprising: signalCountStarUprising += 1 // +1.5 points if entryUltraShort: signalCountUltra += 1 // -1.0 points // Trend Confirmation Signals if strongUpTrend: trendUpCount_Long += 1 // +1.5 points if emaAlignment_Bull: bullAlignCount_Long += 1 // +1.0 points // Risk Assessment Signals if highRisk_Long: riskCount_Long += 1 // -1.5 points if topZone: tzoneCount_Long += 1 // -0.5 points

The per-tick signal accumulation system operates with calc_on_every_tick=true for real-time responsiveness. During long positions, the system monitors primary reversal signals where Red Diamond signals subtract 0.5 points as reversal warnings, Star Uprising adds 1.5 points for continuation signals, and Ultra Short signals deduct 1.0 points as counter-trend warnings.

Trend confirmation signals provide weighted scoring where strongUpTrend adds 1.5 points for aligned momentum, emaAlignment_Bull contributes 1.0 point for structural support, and various EMA-based confirmations contribute to the overall score. Risk assessment signals apply negative weighting where highRisk_Long situations subtract 1.5 points, topZone conditions deduct 0.5 points, and other risk factors create defensive scoring adjustments.

The smart score calculation aggregates all 22 components in real-time, combining reversal warnings, continuation signals, trend alignment indicators, EMA structural analysis, and risk penalties into a numerical representation of market conditions. This score updates continuously, providing the foundation for hold-or-exit decisions.

快照

MULTI-TIMEFRAME (MTF) SYSTEM

MTF Data Collection
The strategy requests higher timeframe data (default 30-minute) for trend confirmation:
Pine Script®
[temp_mtf_fast, temp_mtf_slow, temp_mtf_close] = request.security(syminfo.tickerid, mtfTimeframe, [ta.ema(close, emaFastLen), ta.ema(close, emaSlowLen), close], lookahead=barmerge.lookahead_off, gaps=barmerge.gaps_off)

MTF Watchtower System - Implementation Logic
The system employs a timeframe discrimination protocol where currentTFInMinutes is compared against a 30-minute threshold. This creates different operational behavior between timeframes:

📊 Timeframe Testing Results:
30M+ charts: Full MTF confirmation → Tested with full features
15M charts: Local EMA + adjusted parameters → Standard testing baseline
5M charts: Local EMA only → Requires parameter adjustment
1M charts: High noise → Limited testing conducted

When the chart timeframe is 30 minutes or above, the strategy activates useMTF = true and requests external MTF data through request.security(). For timeframes below 30 minutes, including your 5-minute setup, the system deliberately uses local EMA calculations to avoid MTF lag and data inconsistencies.

The triple-layer data sourcing architecture works as follows: timeframes from 1 minute to 29 minutes rely on chart-based EMA calculations for immediate responsiveness. Timeframes of 30 minutes and above utilize MTF data through the security function, with a backup system that doubles the EMA length (emaLen * 2) if MTF data fails. When MTF data is unavailable or invalid, the system falls back to local EMA as the final safety net.

Data validation occurs through a pipeline where mtf_dataValid checks not only for non-null values but also verifies that EMA values are positive above zero. The system tracks data sources through mtf_dataSource which displays "MTF Data" for successful external requests, "Backup EMA" for failed MTF with backup system active, or "Chart EMA" for local calculations.

🔄 MTF Smart Score Caching & Recheck System
Pine Script®
// Cache Update Decision Logic mtfSmartIntervalSec = input.int(300, "Smart Grid Recheck Interval (sec)") // 5-minute cache canRecheckSmartScore = na(timenow) ? false : (na(lastCheckTime) or (timenow - lastCheckTime) > mtfSmartIntervalSec * 1000) // Cache Management if canRecheckSmartScore lastCheckTime := timenow cachedSmartScoreLong := smartScoreLong // Store current calculation cachedSmartScoreShort := smartScoreShort


The performance-optimized caching system addresses the computational intensity of continuous MTF analysis through intelligent interval management. The mtfSmartIntervalSec parameter, defaulting to 300 seconds (5 minutes), determines cache refresh frequency. The system evaluates canRecheckSmartScore by comparing current time against lastCheckTime plus the configured interval.

When cache updates trigger, the system stores current calculations in cachedSmartScoreLong and cachedSmartScoreShort, creating stable reference points that reduce excessive MTF requests. This cache management balances computational efficiency with analytical accuracy.

The cache versus real-time hybrid system creates a multi-layered decision matrix where immediate signals update every tick for responsive market reaction, cached MTF scores refresh every 5 minutes for stability filtering, dynamic thresholds recalculate every bar for volatility adaptation, and sliding window analysis updates every bar for trend persistence validation.

This architecture balances real-time signal detection with multi-timeframe strategic validation, creating adaptive trading intelligence that responds immediately to market changes while maintaining strategic stability through cached analysis and volatility-adjusted decision thresholds.

⚡The Execution Section Deep Dive
The execution section represents the culmination of all previous systems – where analysis transforms into action.

🚪 Entry Execution: The Gateway Protocol
Primary Entry Validation:
Entry isn't just about seeing a signal – it's about passing through multiple security checkpoints, each designed to filter out low-quality opportunities.

Stage 1: Signal Confirmation
entryCompositeBuySignal must be TRUE for longs
entryCompositeSellSignal must be TRUE for shorts

Stage 2: Enhanced Entry Validation
The strategy employs an "OR" logic system that recognizes different types of market opportunities:

Path A - Trend Reversal Entry:
When emaTrendReversal_Long triggers, it indicates the market structure is shifting in favor of the trade direction. This isn't just about a single EMA crossing – it represents a change in market momentum that experienced traders recognize as potential high-probability setups.

Path B - Momentum Breakout Entry:
The strongBullMomentum condition is where QRE identifies accelerating market conditions:
Criteria:
EMA1 rising for 3+ candles AND
EMA2 rising for 2+ candles AND
Close > 10-period high
This combination captures those explosive moves where the market doesn't just trend – it accelerates, creating momentum-driven opportunities.

Path C - Recovery Entry:
When previous exit states are clean (no recent stop losses), the strategy permits entry based purely on signal strength. This pathway is designed to help avoid the strategy becoming overly cautious after successful trades.

🛡️ The Priority Exit Matrix: When Rules Collide
Not all exit signals are created equal. QRE uses a strict hierarchy that is designed to avoid conflicting signals from causing hesitation:

Priority Level 1 - Exception Exits (Immediate Action):
Condition: TP3 reached AND Wick Trap detected
Action: Immediate exit regardless of other signals
Rationale: Historical analysis suggests wick traps at TP3 may indicate potential reversals

Priority Level 2 - Structural Breakdown:
Condition: TP3 active AND EMA structure deteriorating AND Smart Score insufficient
Logic: isEMAStructureDown AND NOT smartHold_Long
This represents the strategy recognizing that the underlying market structure that justified the trade is failing. It's like a building inspector identifying structural issues – you don't wait for additional confirmation.

Priority Level 3 - Enhanced Volatility Exits:
Conditions: TP2 active AND Strong counter-candle AND Wick trap AND Volume spike
Logic: Multiple confirmation required to reduce false exits

Priority Level 4 - Standard Smart Score Exits:
Condition: Any TP level active AND smartHold evaluates to FALSE
This is the bread-and-butter exit logic where signal deterioration triggers exit

⚖️ Stop Loss Management: Risk Control Protocol

Dual Stop Loss System:
QRE provides two stop loss modes that users can select based on their preference:

Fixed Mode (Default - useAdaptiveSL = false):
Uses predetermined percentage levels regardless of market volatility:
- Long SL = entryPrice × (1 - fixedRiskP - slipBuffer)
- Short SL = entryPrice × (1 + fixedRiskP + slipBuffer)
- Default: 0.6% risk + 0.3% slippage buffer = 0.9% total stop
- Consistent and predictable stop loss levels
- Recommended for users who prefer stable risk parameters

Adaptive Mode (Optional - useAdaptiveSL = true):
Dynamic system that adjusts stop loss based on market volatility:
- Base Calculation uses ATR (Average True Range)
- Long SL = entryPrice × (1 - (ATR × atrMultSL) / entryPrice - slipBuffer)
- Short SL = entryPrice × (1 + (ATR × atrMultSL) / entryPrice + slipBuffer)
- Automatically widens stops during high volatility periods
- Tightens stops during low volatility periods
- Advanced users can enable for volatility-adaptive risk management

Trend Multiplier Enhancement (Both Modes):
When strongUpTrend is detected for long positions, the stop loss receives 1.5x breathing room. Strong trends often have deeper retracements before continuing. This is designed to help avoid the strategy being shaken out of active trades by normal market noise.

Mode Selection Guidance:
- New Users: Start with Fixed Mode for predictable risk levels
- Experienced Users: Consider Adaptive Mode for volatility-responsive stops
- Volatile Markets: Adaptive Mode may provide better stop placement
- Stable Markets: Fixed Mode often sufficient for consistent risk management

Early Exit Conditions:
Beyond traditional stop losses, QRE implements "smart stops" that trigger before price-based stops:
Early Long Exit: (smartScoreLong < 1.0 OR prev5BearCandles) AND realROI < -0.9%

🔄 State Management: The Memory System
Complete State Reset Protocol:
When a position closes, QRE doesn't just wipe the slate clean – it performs a methodical reset:

TP State Cleanup:
All Boolean flags: tp1/tp2/tp3HitBefore → FALSE
All Reached flags: tp1/tp2/tp3Reached → FALSE
All Active flags: tp1/tp2/tp3HoldActive → FALSE

Signal Counter Reset:
Every one of the 22 signal counters returns to zero.
This is designed to avoid signal "ghosting" where old signals influence new trades.

Memory Preservation:
While operational states reset, certain information is preserved for learning:

killReasonLong/Short: Why did this trade end?
lastExitWasTP1/TP2/TP3: What was the exit quality?
reEntryCount: How many consecutive re-entries have occurred?

🔄 Re-Entry Logic: The Comeback System
Re-Entry Conditions Matrix:
QRE implements a re-entry system that recognizes not all exits are created equal:

TP-Based Re-Entry (Enabled):
Criteria: Previous exit was TP1, TP2, or TP3
Cooldown: Minimal or bypassed entirely
Logic: Target-based exits indicate potentially viable market conditions

EMA-Based Re-Entry (Conditional):
Criteria: Previous exit was EMA-based (structural change)
Requirements: Must wait for EMA confirmation in new direction
Minimum Wait: 5 candles

Advanced Re-Entry Features:
When adjustReEntryTargets is enabled, the strategy becomes more aggressive with re-entries:
Target Adjustment: TP1 multiplied by reEntryTP1Mult (default 2.0)
Stop Adjustment: SL multiplied by reEntrySLMult (default 1.5)
Logic: If we're confident enough to re-enter, we should be confident enough to hold for bigger moves
Performance Tracking: Strategy tracks re-entry win rate, average ROI, and total performance separately from initial entries for optimization analysis.

📊 Exit Reason Analytics: Learning from Every Trade
Kill Reason Tracking:
Every exit is categorized and stored:
"TP3 Exit–Wick Trap": Exit at target level with wick pattern detection
"Smart Exit–EMA Down": Structural breakdown exit
"Smart Exit–Volatility": Volatility-based protection exit
"Exit Post-TP1/TP2/TP3": Standard smart exit progression
"Long SL Exit" / "Short SL Exit": Stop loss exits

Performance Differentiation:
The strategy tracks performance by exit type, allowing for continuous analysis:
TP-based exits: Achieved target levels, analyze for pattern improvement
EMA-based exits: Mixed results, analyze for pattern improvement
SL-based exits: Learning opportunities, adjust entry criteria
Volatility exits: Protective measures, monitor performance

🎛️ Trailing Stop Implementation:
Conditional Trailing Activation:
Activation Criteria: Position profitable beyond trailingStartPct AND
(TP hold active OR re-entry trade)

Dynamic Trailing Logic:
Unlike simple trailing stops, QRE's implementation considers market context:
Trending Markets: Wider trail offsets to avoid whipsaws
Volatile Markets: Tighter offsets to protect gains
Re-Entry Trades: Enhanced trailing to maximize second-chance opportunities

Return-to-Entry Protection:
When deactivateOnReturn is enabled, the strategy will close positions that return to entry level after being profitable. This is designed to help avoid the frustration of watching profitable trades turn into losers.

🧠 How It All Works Together
The beauty of QRE lies not in any single component, but in how everything integrates:

The Entry Decision: Multiple pathways are designed to help identify opportunities while maintaining filtering standards.

The Progression System: Each TP level unlocks new protection features, like achieving ranks in a video game.

The Exit Matrix: Prioritized decision-making aims to reduce analysis paralysis while providing appropriate responses to different market conditions.

The Memory System: Learning from each trade while preventing contamination between separate opportunities.

The Re-Entry Logic: Re-entry system that balances opportunity with risk management.

This creates a trading system where entry conditions filter for quality, progression systems adapt to changing market conditions, exit priorities handle conflicting signals intelligently, memory systems learn from each trade cycle, and re-entry logic maximizes opportunities while managing risk exposure.

📊 ANALYSIS TABLE INTERPRETATION - [Complete User Guide]
快照
⚙️ Enabling Analysis Mode
Navigate to strategy settings → "Testing & Analysis" → Enable "Show Analysis Table". The Analysis Table displays different information based on the selected test filter and provides real-time insight into all strategy components, helping users understand current market conditions, position status, and system decision-making processes.

📋 Filter Mode Interpretations

"All" Mode (Default View):
Composite Section:
Buy Score: Aggregated strength from all 22 bullish signals (threshold 5.0+ triggers entry consideration)
Sell Score: Aggregated strength from all 22 bearish signals (threshold 5.4+ triggers entry consideration)

APEX Filters:
ATG Trend: Shows current trend direction analysis
Indicates whether momentum filters are aligned for directional bias

ReEntry Section:
Most Recent Exit: Displays exit type and timeframe since last position closure
Status: Shows if ReEntry system is Ready/Waiting/Disabled
Count: Current re-entry attempts versus maximum allowed attempts

Position Section (When Active):
Status: Current position state (LONG/SHORT/FLAT)
ROI: Dual calculation showing Custom vs Real ROI percentages
Entry Price: Original position entry level
Current Price: Live market price for comparison
TP Tracking: Progress toward profit targets

"Smart" Filter (Critical for Active Positions):
Smart Exit Section:
Hold Timer: Time elapsed since position opened (bar-based counting)
Status: Whether Smart Exit Grid is Enabled/Disabled
Score: Current smart score calculation from 22-component matrix
Dynamic Threshold: ATR-based minimum score required for holding
Final Threshold: Time and ROI-adjusted threshold actually used for decisions
Score Check: Pass/Fail based on Score vs Final Threshold comparison
Smart Hold: Current hold decision status
Final Hold: Final recommendation based on all factors

🎯 Advanced Smart Exit Debugging - ROI & Time-Based Threshold System
Understanding the Multi-Layer Threshold System:

Layer 1: Dynamic Threshold (ATR-Based)
atrRatio = ATR / close
dynamicThreshold = atrRatio > 0.02 ? 1.0 : // High volatility: Lower threshold
(atrRatio > 0.01 ? 1.5 : // Medium volatility: Standard
2.8) // Low volatility: Higher threshold

Layer 2: Time Multiplier (ROI & Duration-Based)
Winning Positions (ROI ≥ 0%):
→ timeMultiplier = 1.0 (No time pressure, regardless of hold duration)

Losing Positions (ROI < 0%):
→ holdTimer ≤ 8 bars: timeMultiplier = 1.0 (Early stage, standard requirements)
→ holdTimer 9-16 bars: timeMultiplier = 1.1 (10% stricter requirements)
→ holdTimer 17+ bars: timeMultiplier = 1.3 (30% stricter requirements)

Layer 3: Final Threshold Calculation
finalThreshold = dynamicThreshold × timeMultiplier

Examples:
- Winning Position: 2.8 × 1.0 = 2.8 (Always standard)
- Losing Position (Early): 2.8 × 1.0 = 2.8 (Same as winning initially)
- Losing Position (Extended): 2.8 × 1.3 = 3.64 (Much stricter)
Real-Time Debugging Display:
Smart Exit Section shows:

Score: 3.5 → Current smartScoreLong/Short value
Dynamic Threshold: 2.8 → Base ATR-calculated threshold
Final Threshold: 3.64 (ATR×1.3) → Actual threshold used for decisions
Score Check: FAIL (3.5 vs 3.64) → Pass/Fail based on final comparison
Final Hold: NO HOLD → Actual system decision

Position Status Indicators:
Winner + Early: ATR×1.0 (No pressure)
Winner + Extended: ATR×1.0 (No pressure - winners can run indefinitely)
Loser + Early: ATR×1.0 (Recovery opportunity)
Loser + Extended: ATR×1.1 or ATR×1.3 (Increasing pressure to exit)

MTF Section:

Data Source: Shows whether using MTF Data/EMA Backup/Local EMA
Timeframe: Configured watchtower timeframe setting
Data Valid: Confirms successful MTF data retrieval status
Trend Signal: Higher timeframe directional bias analysis
Close Price: MTF price data availability confirmation

"Composite" Filter:
Composite Section:
Buy Score: Real-time weighted scoring from multiple indicators
Sell Score: Opposing directional signal strength
Threshold: Minimum scores required for signal activation

Components:
Flash/Blink: Momentum acceleration indicators (F = Flash active, B = Blink active)
Individual filter contributions showing which specific signals are firing

"ReEntry" Filter:
ReEntry System:

System: Shows if re-entry feature is Enabled/Disabled
Eligibility: Conditions for new entries in each direction
Performance: Success metrics of re-entry attempts when enabled
快照
🎯 Key Status Indicators
Status Column Symbols:

✓ = Condition met / System active / Signal valid
✗ = Condition not met / System inactive / No signal
⏳ = Cooldown active (waiting period)
✅ = Ready state / Good condition
🔄 = Processing / Transitioning state

🔍 Critical Reading Guidelines
For Active Positions - Smart Exit Priority Reading:
1. First Check Position Type:
ROI ≥ 0% = Winning Position (Standard requirements)
ROI < 0% = Losing Position (Progressive requirements)

2. Check Hold Duration:
Early Stage (≤8 bars): Standard multiplier regardless of ROI
Extended Stage (9-16 bars): Slight pressure on losing positions
Long Stage (17+ bars): Strong pressure on losing positions

3. Score vs Final Threshold Analysis:
Score ≥ Final Threshold = HOLD (Continue position)
Score < Final Threshold = EXIT (Close position)
Watch for timeMultiplier changes as position duration increases

4. Understanding "Why No Hold?"
Common scenarios when Score Check shows FAIL:
Losing position held too long (timeMultiplier increased to 1.1 or 1.3)
Low volatility period (dynamic threshold raised to 2.8)
Signal deterioration (smart score dropped below required level)
MTF conflict (higher timeframe opposing position direction)

For Entry Signal Analysis:
Composite Score Reading: Signal strength relative to threshold requirements
Component Analysis: Individual filter contributions to overall score
EMA Structure: Confirm 3-bar crossover requirement met
Cooldown Status: Ensure sufficient time passed since last exit

For ReEntry Opportunities (when enabled):
System Status: Availability and eligibility for re-engagement
Exit Type Analysis: TP-based exits enable immediate re-entry, SL-based exits require cooldown
Condition Monitoring: Requirements for potential re-entry signals

Debugging Common Issues:
Issue: "Score is high but no hold?"
→ Check Final Threshold vs Score (not Dynamic Threshold)
→ Losing position may have increased timeMultiplier
→ Extended hold duration applying pressure

Issue: "Why different thresholds for same score?"
→ Position ROI status affects multiplier
→ Time elapsed since entry affects multiplier
→ Market volatility affects base threshold

Issue: "MTF conflicts with local signals?"
→ Higher timeframe trend opposing position
→ System designed to exit on MTF conflicts
→ Check MTF Data Valid status

⚡ Performance Optimization Notes
For Better Performance:
Analysis table updates may impact performance on some devices
Use specific filters rather than "All" mode for focused monitoring
Consider disabling during live trading for optimal chart performance
Enable only when needed for debugging or analysis

Strategic Usage:
Monitor "Smart" filter when positions are active for exit timing decisions
Use "Composite" filter during setup phases for signal strength analysis
Reference "ReEntry" filter after position closures for re-engagement opportunities
Track Final Threshold changes to understand exit pressure evolution

Advanced Debugging Workflow:

Position Entry Analysis:
Check Composite score vs threshold
Verify EMA crossover timing (3 bars prior)
Confirm cooldown completion

Hold Decision Monitoring:
Track Score vs Final Threshold progression
Monitor timeMultiplier changes over time
Watch for MTF conflicts

Exit Timing Analysis:
Identify which threshold layer caused exit
Track performance by exit type
Analyze re-entry eligibility

This analysis system provides transparency into strategy decision-making processes, allowing users to understand how signals are generated and positions are managed according to the programmed logic during various market conditions and position states.


SIGNAL TYPES AND CHARACTERISTICS

🔥 Core Momentum Signals

Flash Signal
Calculation: ta.rma(math.abs(close - close[1]), 5) > ta.sma(math.abs(close - close[1]), 7)
Purpose: Detects sudden price acceleration using smoothed momentum comparison
Characteristics: Triggers when recent price movement exceeds historical average movement
Usage: Primary momentum confirmation across multiple composite calculations
Weight: 1.3 points in composite scoring

Blink Signal
Calculation: math.abs(ta.change(close, 1)) > ta.sma(math.abs(ta.change(close, 1)), 5)
Purpose: Identifies immediate price velocity spikes
Characteristics: More sensitive than Flash, captures single-bar momentum bursts
Usage: Secondary momentum confirmation, often paired with Flash
Weight: 1.3 points in composite scoring

⚡ Advanced Composite Signals

Apex Pulse Signal
Calculation: apexAngleValue > 30 or apexAngleValue < -30
Purpose: Detects extreme EMA angle momentum
Characteristics: Identifies when trend angle exceeds ±30 degrees
Usage: Confirms directional momentum strength in trend-following scenarios

Pressure Surge Signal
Calculation: volSpike_AVP and strongTrendUp_ATG
Purpose: Combines volume expansion with trend confirmation
Characteristics: Requires both volume spike and strong uptrend simultaneously
Usage: bullish signal for trend continuation

Shift Wick Signal
Calculation: ta.crossunder(ema1, ema2) and isWickTrapDetected and directionFlip
Purpose: Detects bearish reversal with wick trap confirmation
Characteristics: Combines EMA crossunder with upper wick dominance and directional flip
Usage: Reversal signal for trend change identification

🛡️ Trap Exit Protection Signals

Bear Trap Exit
Calculation: isUpperWickTrap and isBearEngulfNow
Conditions: Previous bullish candle with 80%+ upper wick, followed by current bearish engulfing
Purpose: Emergency exit signal for long positions
Priority: Highest - overrides all other hold conditions
Action: Immediate position closure with full state reset

Bull Trap Exit
Calculation: isLowerWickTrap and isBullEngulfNow
Conditions: Previous bearish candle with 80%+ lower wick, followed by current bullish engulfing
Purpose: Emergency exit signal for short positions
Priority: Highest - overrides all other hold conditions
Action: Immediate position closure with full state reset

📊 Technical Analysis Foundation Signals

RSI-MFI Hybrid System
Base Calculation: (ta.rsi(close, 14) + ta.mfi(close, 14)) / 2
Oversold Threshold: < 35
Overbought Threshold: > 65
Weak Condition: < 35 and declining
Strong Condition: > 65 and rising
Usage: Momentum confirmation and reversal identification

ADX-DMI Trend Classification
Strong Up Trend: (adx > 25 and diplus > diminus and (diplus - diminus) > 5) or (ema1 > ema2 and ema2 > ema3 and ta.rising(ema2, 3))
Strong Down Trend: (adx > 20 and diminus > diplus - 5) or (ema1 < ema2 and ta.falling(ema1, 3))
Trend Weakening: adx < adx[1] and adx[1] < adx[2]
Usage: Primary trend direction confirmation

Bollinger Band Squeeze Detection
Calculation: bbWidth < ta.lowest(bbWidth, 20) * 1.2
Purpose: Identifies low volatility periods before breakouts
Usage: Entry filter - avoids trades during consolidation

🎨 Visual Signal Indicators

Red X Signal
Calculation: isBearCandle and ta.crossunder(ema1, ema2)
Visual: Red X above price
Purpose: Bearish EMA crossunder with confirming candle
Composite Weight: +1.0 for short positions, -1.0 for long positions
Characteristics: Simple but effective trend change indicator

Green Dot Signal
Calculation: isBullCandle and ta.crossover(ema1, ema2)
Visual: Green dot below price
Purpose: Bullish EMA crossover with confirming candle
Composite Weight: +1.0 for long positions, -1.0 for short positions
Characteristics: Entry confirmation for trend-following strategies

Blue Diamond Signal
Trigger Conditions: amcBuySignal and score >= 4
Scoring Components: 11 different technical conditions
Key Requirements: AMC bullish + momentum rise + EMA expansion + volume confirmation
Visual: Blue diamond below price
Purpose: Bullish reversal or continuation signal
Characteristics: Multi-factor confirmation requiring 4+ technical alignments

Red Diamond Signal
Trigger Conditions: amcSellSignal and score >= 5
Scoring Components: 11 different technical conditions (stricter than Blue Diamond)
Key Requirements: AMC bearish + momentum crash + EMA compression + volume decline
Visual: Red diamond above price
Purpose: Potential bearish reversal or continuation signal
Characteristics: Requires higher threshold (5 vs 4) for more selective triggering

🔵 Specialized Detection Signals
Blue Dot Signal
Calculation: volumePulse and isCandleStrong and volIsHigh
Requirements: Volume > 2.0x MA, strong candle body > 35% of range, volume MA > 55
Purpose: Volume-confirmed momentum signal
Visual: Blue dot above price
Characteristics: Volume-centric signal for high-liquidity environments

Orange X Signal
Calculation: Complex multi-factor oversold reversal detection
Requirements: AMC oversold + wick trap + flash/blink + RSI-MFI oversold + bullish flip
Purpose: Oversold bounce signal with multiple confirmations
Visual: Orange X below price
Characteristics: Reversal signal requiring 5+ simultaneous conditions

VSS (Velocity Signal System)
Components: Volume spike + EMA angle + trend direction
Buy Signal: vssTrigger and vssTrendDir == 1
Sell Signal: vssTrigger and vssTrendDir == -1
Visual: Green/Red triangles
Purpose: Velocity-based momentum detection
Characteristics: Fast-response signal for momentum trading

⭐ Elite Composite Signals
Star Uprising Signal
Base Requirements: entryCompositeBuySignal and echoBodyLong and strongUpTrend and isAMCUp
Additional Confirmations: RSI hybrid strong + not high risk
Special Conditions: At bottom zone OR RSI bottom bounce OR strong volume bounce
Visual: Star symbol below price
Purpose: Bullish reversal signal from oversold conditions
Characteristics: Most selective bullish signal requiring multiple confirmations

Ultra Short Signal
Scoring System: 7-component scoring requiring 4+ points
Key Components: EMA trap + volume decline + RSI weakness + composite confirmation
Additional Requirements: Falling EMA structure + volume spike + flash confirmation
Visual: Explosion emoji above price
Purpose: Aggressive short entry for trend reversal or continuation
Characteristics: Complex multi-layered signal for experienced short selling

🎯 Composite Signal Architecture
Enhanced Composite Scoring
Long Composite: 15+ weighted components including structure, momentum, flash/blink, volume, price action, reversal triggers, trend alignment

Short Composite: Mirror structure with bearish bias
Threshold: 5.0 points required for signal activation
Conflict Resolution: If both long and short signals trigger simultaneously, both are disabled
Final Validation: Requires EMA momentum confirmation (ta.rising(emaFast_ATG, 2) for longs, ta.falling(emaFast_ATG, 2) for shorts)

Risk Assessment Integration
High Risk Long: RSI > 70 OR close > upper Bollinger Band 80%
High Risk Short: RSI < 30 OR close < lower Bollinger Band 80%
Zone Analysis: Top zone (95% of 50-bar high) vs Bottom zone (105% of 50-bar low)
Risk Penalty: High risk conditions subtract 1.5 points from composite scores

This signal architecture creates a multi-layered detection system where simple momentum signals provide foundation, technical analysis adds structure, visual indicators offer clarity, specialized detectors capture different market conditions, and composite signals identify potential opportunities while integrated risk assessment is designed to filter risky entries.


VISUAL FEATURES SHOWCASE

Ichimoku Cloud Visualization
Dynamic Color Intensity: Cloud transparency adapts to momentum strength - darker colors indicate stronger directional moves, while lighter transparency shows weakening momentum phases.
Gradient Color Mapping: Bullish momentum renders blue-purple spectrum with increasing opacity, while bearish momentum displays corresponding color gradients with intensity-based transparency.
Real-time Momentum Feedback: Color saturation provides immediate visual feedback on market structure strength, allowing traders to assess levels at a glance without additional indicators.

EMA Ribbon Bands
The 8-level exponential moving average system creates a comprehensive trend structure map with gradient color coding.

Signal Type Visualization
快照
STRATEGY PROPERTIES & BACKTESTING DISCLOSURE

📊 Default Strategy Configuration:
✅ Initial Capital: 100,000 USD (realistic for average traders)
✅ Commission: 0.075% per trade (realistic exchange fees)
✅ Slippage: 3 ticks (market impact consideration)
✅ Position Size: 5% equity per trade (sustainable risk level)
✅ Pyramiding: Disabled (single position management)
✅ Sample Size: 185 trades over 12-month backtesting period
✅ Risk Management: Adaptive stop loss with maximum 1% risk per trade

COMPREHENSIVE BACKTESTING RESULTS

Testing Period & Market Conditions:

Backtesting Period: June 25, 2024 - June 25, 2025 (12 months)
Timeframe: 15-minute charts (MTF system active)
Market: BTCUSDT (Bitcoin/Tether)
Market Conditions: Full market cycle including volatility periods
Deep Backtesting: Enabled for maximum accuracy

📈 Performance Summary:

Total Return: +2.19% (+2,193.59 USDT)
Total Trades Executed: 185 trades
Win Rate: 34.05% (63 winning trades out of 185)
Profit Factor: 1.295 (gross profit ÷ gross loss)
Maximum Drawdown: 0.65% (653.17 USDT)
Risk-Adjusted Returns: Consistent with conservative risk management approach

📊 Detailed Trade Analysis:

Position Distribution:

Long Positions: 109 trades (58.9%) | Win Rate: 36.70%
Short Positions: 76 trades (41.1%) | Win Rate: 30.26%
Average Trade Duration: Optimized for 15-minute timeframe efficiency

Profitability Metrics:

Average Profit per Trade: 11.74 USDT (0.23%)
Average Winning Trade: 151.17 USDT (3.00%)
Average Losing Trade: 60.27 USDT (1.20%)
Win/Loss Ratio: 2.508 (winners are 2.5x larger than losses)
Largest Single Win: 436.02 USDT (8.69%)
Largest Single Loss: 107.41 USDT (controlled risk management)

💰 Financial Performance Breakdown:

Gross Profit: 9,523.93 USDT (9.52% of capital)
Gross Loss: 7,352.48 USDT (7.35% of capital)
Net Profit After Costs: 2,171.44 USDT (2.17%)
Commission Costs: 1,402.47 USDT (realistic trading expenses)
Maximum Equity Run-up: 2,431.66 USDT (2.38%)

⚖️ Risk Management Validation:

Maximum Drawdown: 0.65% showing controlled risk management
Drawdown Recovery: Consistent equity curve progression
Risk per Trade: Successfully maintained below 1.5% per position
Position Sizing: 5% equity allocation proved sustainable throughout testing period

📋 Strategy Performance Characteristics:
✅ Strengths Demonstrated:

Controlled Risk: Maximum drawdown well below industry standards (< 1%)
Positive Expectancy: Win/loss ratio of 2.5+ creates profitable edge
Consistent Performance: Steady equity curve without extreme volatility
Realistic Costs: Includes actual commission and slippage impacts
Sample Size: 185 trades during testing period

⚠️ Performance Considerations:

Win Rate: 34% win rate requires discipline to follow system signals
Market Dependency: Performance may vary significantly in different market conditions
Timeframe Sensitivity: Optimized for 15-minute charts; other timeframes may show different results
Slippage Impact: Real trading conditions may affect actual performance

📊 Benchmark Comparison:

Strategy Return: +2.19% over 12 months
Buy & Hold Bitcoin: +71.12% over same period
Strategy Advantage: Significantly lower drawdown and volatility
Risk-Adjusted Performance: Different risk profile compared to holding cryptocurrency

🎯 Real-World Application Insights:
Expected Trading Frequency:

Average: 15.4 trades per month (185 trades ÷ 12 months)
Weekly Frequency: Approximately 3-4 trades per week
Active Management: Requires regular monitoring during market hours

Capital Requirements:

Minimum Used in Testing: $10,000 for sustainable position sizing
Tested Range: $50,000-$100,000 for comfortable risk management
Commission Impact: 0.075% per trade totaled 1.4% of capital over 12 months


⚠️ IMPORTANT BACKTESTING DISCLAIMERS:
📈 Performance Reality:
Past performance does not guarantee future results. Backtesting results represent hypothetical performance and may not reflect actual trading outcomes due to market changes, execution differences, and emotional factors.
🔄 Market Condition Dependency:
This strategy's performance during the tested period may not be representative of performance in different market conditions, volatility regimes, or trending vs. sideways markets.
💸 Cost Considerations:
Actual trading costs may vary based on broker selection, market conditions, and trade size. Commission rates and slippage assumptions may differ from real-world execution.
🎯 Realistic Expectations:
The 34% win rate requires psychological discipline to continue following signals during losing streaks. Risk management and position sizing are critical for replicating these results.
⚡ Technology Dependencies:
Strategy performance assumes reliable internet connection, platform stability, and timely signal execution. Technical failures may impact actual results.


CONFIGURATION OPTIMIZATION

[Timeframe-Specific Settings]
5-Minute Timeframe Optimization (Advanced Users Only)

⚠️ Important Warning: 5-minute timeframes operate without MTF confirmation, resulting in reduced signal quality and higher false signal rates.

Example 5-Minute Parameters:
Composite Thresholds: Long 6.5, Short 7.0 (vs 15M default 5.0/5.4)
Signal Lookback Bars: 12 (vs 15M default 8)
Volume Multiplier: 2.2 (vs 15M default 1.8)
MTF Timeframe: Disabled (automatic below 30M)

Risk Management Adjustments:
Position Size: Reduce to 3% (vs 5% default)
TP1: 0.8%, TP2: 1.2%, TP3: 2.0% (tighter targets)
SL: 0.8% (tighter stop loss)
Cooldown Minutes: 8 (vs 5 default)

Usage Notes for 5-Minute Trading:
- Wait for higher composite scores before entry
- Require stronger volume confirmation
- Monitor EMA structure more closely

15-Minute Scalping Setup:
TP1: 1.0%, TP2: 1.5%, TP3: 2.5%
Composite Threshold: 5.0 (higher filtering)
TP ATR Multiplier: 7.0
SL ATR Multiplier: 2.5
Volume Multiplier: 1.8 (requires stronger confirmation)
Hold Time: 2 bars minimum

3-Hour Swing Setup:
TP1: 2.0%, TP2: 4.0%, TP3: 8.0%
Composite Threshold: 4.5 (more signals)
TP ATR Multiplier: 8.0
SL ATR Multiplier: 3.2
Volume Multiplier: 1.2
Hold Time: 6 bars minimum


Market-Specific Adjustments

High Volatility Periods:
Increase ATR multipliers (TP: 2.0x, SL: 1.2x)
Raise composite thresholds (+0.5 points)
Reduce position size
Enable cooldown periods
Low Volatility Periods:
Decrease ATR multipliers (TP: 1.2x, SL: 0.8x)
Lower composite thresholds (-0.3 points)
Standard position sizing
Disable extended cooldowns
News Events:
Temporarily disable strategy 30 minutes before major releases
Increase volume requirements (2.0x multiplier)
Reduce position sizes by 50%
Monitor for unusual price action


RISK MANAGEMENT

Dual ROI System: Adaptive vs Fixed Mode

Adaptive RR Mode:
Uses ATR (Average True Range) for automatic adjustment
TP1: 1.0x ATR from entry price
TP2: 1.5x ATR from entry price
TP3: 2.0x ATR from entry price
Stop Loss: 1.0x ATR from entry price
Automatically adjusts to market volatility

Fixed Percentage Mode:
Uses predetermined percentage levels
TP1: 1.0% (default)
TP2: 1.5% (default)
TP3: 2.5% (default)
Stop Loss: 0.9% total (0.6% risk tolerance + 0.3% slippage buffer)(default)
Consistent levels regardless of volatility

Mode Selection: Enable "Use Adaptive RR" for ATR-based targets, disable for fixed percentages. Adaptive mode works better in varying volatility conditions, while fixed mode provides predictable risk/reward ratios.


Stop Loss Management

In Adaptive SL Mode:
Automatically scales with market volatility
Tight stops during low volatility (smaller ATR)
Wider stops during high volatility (larger ATR)
Include 0.3% slippage buffer in both modes

In Fixed Mode:
Consistent percentage-based stops
2% for crypto, 1.5% for forex, 1% for stocks
Manual adjustment needed for different market conditions


Trailing Stop System
Configuration:
Enable Trailing: Activates dynamic stop loss adjustment
Start Trailing %: Profit level to begin trailing (default 1.0%)
Trailing Offset %: Distance from current price (default 0.5%)
Close if Return to Entry: Optional immediate exit if price returns to entry level
Operation: Once position reaches trailing start level, stop loss automatically adjusts upward (longs) or downward (shorts) maintaining the offset distance from favorable price movement.

Timeframe-Specific Risk Considerations

15-Minute and Above (Tested):
✅ Full MTF system active
✅ Standard risk parameters apply
✅ Backtested performance metrics valid
✅ Standard position sizing (5%)

5-Minute Timeframes (Advanced Only):
⚠️ MTF system inactive - local signals only
⚠️ Higher false signal rate expected
⚠️ Reduced position sizing preferred (3%)
⚠️ Tighter stop losses required (0.8% vs 1.2%)
⚠️ Requires parameter optimization
⚠️ Monitor performance closely

1-Minute Timeframes (Limited Testing):
❌ Excessive noise levels
❌ Strategy not optimized for this frequency

Risk Management Practices

Allocate no more than 5% of your total investment portfolio to high-risk trading
Never trade with funds you cannot afford to lose
Thoroughly backtest and validate the strategy with small amounts before full implementation
Always maintain proper risk management and stop-loss settings


IMPORTANT DISCLAIMERS

Performance Disclaimer
Past performance does not guarantee future results. All trading involves substantial risk of loss. This strategy is provided for informational purposes and does not constitute financial advice.

Market Risk
Cryptocurrency and forex markets are highly volatile. Prices can move rapidly against positions, resulting in significant losses. Users should never risk more than they can afford to lose.

Strategy Limitations
This strategy relies on technical analysis and may not perform well during fundamental market shifts, news events, or unprecedented market conditions. No trading strategy can guarantee 100% success or eliminate the risk of loss.

Legal Compliance
You are responsible for compliance with all applicable regulations and laws in your jurisdiction. Consult with licensed financial professionals when necessary.

User Responsibility
Users are responsible for their own trading decisions, risk management, and compliance with applicable regulations in their jurisdiction.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。