Cari dalam skrip untuk "entry"
[MV] %B with SMA + Volume Based Colored Bars
Entry Signal when %B Crosses with SMA and this is more meaningful if it supports colored bars.
Black Bar when prices go down and volume is bigger than 150% of its average, that indicates us price action is supported by a strong bearish volume
Blue Bar when prices go up and volume bigger than 150% of its average, that indicates us price action is supported by a strong bullish volume
VBC author @KIVANCfr3762
FX Sniper: T3-CCI Strategy - With 100 IndicatorsEntry signal when moving above -100, sell signal when going below 100
Amazing Crossover SystemEntry Rules
BUY when the 5 EMA crosses above the 10 EMA from underneath and the RSI crosses above the 50.0 mark from the bottom.
SELL when the 5 EMA crosses below the 10 EMA from the top and the RSI crosses below the 50.0 mark from the top.
Make sure that the RSI did cross 50.0 from the top or bottom and not just ranging tightly around the level.
How to setup Alert:
1) Add the Amazing Crossover System to your chart via Indicators
2) Find your currency pair
3) Set the timeframe on the chart to 1 hour
4) Press 'Alt + A' (create alert shortcut)
5) Set the following criteria for the alert:
Condition = 'Amazing Crossover System', Plot, ' BUY Signal'
The rest of the alert can be customized to your preferences
5) Repeat steps 1 - 4, but set the Condition = 'Amazing Crossover System', Plot, ' SELL Signal'
Keltner Channel Enhanced [DCAUT]█ Keltner Channel Enhanced
📊 ORIGINALITY & INNOVATION
The Keltner Channel Enhanced represents an important advancement over standard Keltner Channel implementations by introducing dual flexibility in moving average selection for both the middle band and ATR calculation. While traditional Keltner Channels typically use EMA for the middle band and RMA (Wilder's smoothing) for ATR, this enhanced version provides access to 25+ moving average algorithms for both components, enabling traders to fine-tune the indicator's behavior to match specific market characteristics and trading approaches.
Key Advancements:
Dual MA Algorithm Flexibility: Independent selection of moving average types for middle band (25+ options) and ATR smoothing (25+ options), allowing optimization of both trend identification and volatility measurement separately
Enhanced Trend Sensitivity: Ability to use faster algorithms (HMA, T3) for middle band while maintaining stable volatility measurement with traditional ATR smoothing, or vice versa for different trading strategies
Adaptive Volatility Measurement: Choice of ATR smoothing algorithm affects channel responsiveness to volatility changes, from highly reactive (SMA, EMA) to smoothly adaptive (RMA, TEMA)
Comprehensive Alert System: Five distinct alert conditions covering breakouts, trend changes, and volatility expansion, enabling automated monitoring without constant chart observation
Multi-Timeframe Compatibility: Works effectively across all timeframes from intraday scalping to long-term position trading, with independent optimization of trend and volatility components
This implementation addresses key limitations of standard Keltner Channels: fixed EMA/RMA combination may not suit all market conditions or trading styles. By decoupling the trend component from volatility measurement and allowing independent algorithm selection, traders can create highly customized configurations for specific instruments and market phases.
📐 MATHEMATICAL FOUNDATION
Keltner Channel Enhanced uses a three-component calculation system that combines a flexible moving average middle band with ATR-based (Average True Range) upper and lower channels, creating volatility-adjusted trend-following bands.
Core Calculation Process:
1. Middle Band (Basis) Calculation:
The basis line is calculated using the selected moving average algorithm applied to the price source over the specified period:
basis = ma(source, length, maType)
Supported algorithms include EMA (standard choice, trend-biased), SMA (balanced and symmetric), HMA (reduced lag), WMA, VWMA, TEMA, T3, KAMA, and 17+ others.
2. Average True Range (ATR) Calculation:
ATR measures market volatility by calculating the average of true ranges over the specified period:
trueRange = max(high - low, abs(high - close ), abs(low - close ))
atrValue = ma(trueRange, atrLength, atrMaType)
ATR smoothing algorithm significantly affects channel behavior, with options including RMA (standard, very smooth), SMA (moderate smoothness), EMA (fast adaptation), TEMA (smooth yet responsive), and others.
3. Channel Calculation:
Upper and lower channels are positioned at specified multiples of ATR from the basis:
upperChannel = basis + (multiplier × atrValue)
lowerChannel = basis - (multiplier × atrValue)
Standard multiplier is 2.0, providing channels that dynamically adjust width based on market volatility.
Keltner Channel vs. Bollinger Bands - Key Differences:
While both indicators create volatility-based channels, they use fundamentally different volatility measures:
Keltner Channel (ATR-based):
Uses Average True Range to measure actual price movement volatility
Incorporates gaps and limit moves through true range calculation
More stable in trending markets, less prone to extreme compression
Better reflects intraday volatility and trading range
Typically fewer band touches, making touches more significant
More suitable for trend-following strategies
Bollinger Bands (Standard Deviation-based):
Uses statistical standard deviation to measure price dispersion
Based on closing prices only, doesn't account for intraday range
Can compress significantly during consolidation (squeeze patterns)
More touches in ranging markets
Better suited for mean-reversion strategies
Provides statistical probability framework (95% within 2 standard deviations)
Algorithm Combination Effects:
The interaction between middle band MA type and ATR MA type creates different indicator characteristics:
Trend-Focused Configuration (Fast MA + Slow ATR): Middle band uses HMA/EMA/T3, ATR uses RMA/TEMA, quick trend changes with stable channel width, suitable for trend-following
Volatility-Focused Configuration (Slow MA + Fast ATR): Middle band uses SMA/WMA, ATR uses EMA/SMA, stable trend with dynamic channel width, suitable for volatility trading
Balanced Configuration (Standard EMA/RMA): Classic Keltner Channel behavior, time-tested combination, suitable for general-purpose trend following
Adaptive Configuration (KAMA + KAMA): Self-adjusting indicator responding to efficiency ratio, suitable for markets with varying trend strength and volatility regimes
📊 COMPREHENSIVE SIGNAL ANALYSIS
Keltner Channel Enhanced provides multiple signal categories optimized for trend-following and breakout strategies.
Channel Position Signals:
Upper Channel Interaction:
Price Touching Upper Channel: Strong bullish momentum, price moving more than typical volatility range suggests, potential continuation signal in established uptrends
Price Breaking Above Upper Channel: Exceptional strength, price exceeding normal volatility expectations, consider adding to long positions or tightening trailing stops
Price Riding Upper Channel: Sustained strong uptrend, characteristic of powerful bull moves, stay with trend and avoid premature profit-taking
Price Rejection at Upper Channel: Momentum exhaustion signal, consider profit-taking on longs or waiting for pullback to middle band for reentry
Lower Channel Interaction:
Price Touching Lower Channel: Strong bearish momentum, price moving more than typical volatility range suggests, potential continuation signal in established downtrends
Price Breaking Below Lower Channel: Exceptional weakness, price exceeding normal volatility expectations, consider adding to short positions or protecting against further downside
Price Riding Lower Channel: Sustained strong downtrend, characteristic of powerful bear moves, stay with trend and avoid premature covering
Price Rejection at Lower Channel: Momentum exhaustion signal, consider covering shorts or waiting for bounce to middle band for reentry
Middle Band (Basis) Signals:
Trend Direction Confirmation:
Price Above Basis: Bullish trend bias, middle band acts as dynamic support in uptrends, consider long positions or holding existing longs
Price Below Basis: Bearish trend bias, middle band acts as dynamic resistance in downtrends, consider short positions or avoiding longs
Price Crossing Above Basis: Potential trend change from bearish to bullish, early signal to establish long positions
Price Crossing Below Basis: Potential trend change from bullish to bearish, early signal to establish short positions or exit longs
Pullback Trading Strategy:
Uptrend Pullback: Price pulls back from upper channel to middle band, finds support, and resumes upward, ideal long entry point
Downtrend Bounce: Price bounces from lower channel to middle band, meets resistance, and resumes downward, ideal short entry point
Basis Test: Strong trends often show price respecting the middle band as support/resistance on pullbacks
Failed Test: Price breaking through middle band against trend direction signals potential reversal
Volatility-Based Signals:
Narrow Channels (Low Volatility):
Consolidation Phase: Channels contract during periods of reduced volatility and directionless price action
Breakout Preparation: Narrow channels often precede significant directional moves as volatility cycles
Trading Approach: Reduce position sizes, wait for breakout confirmation, avoid range-bound strategies within channels
Breakout Direction: Monitor for price breaking decisively outside channel range with expanding width
Wide Channels (High Volatility):
Trending Phase: Channels expand during strong directional moves and increased volatility
Momentum Confirmation: Wide channels confirm genuine trend with substantial volatility backing
Trading Approach: Trend-following strategies excel, wider stops necessary, mean-reversion strategies risky
Exhaustion Signs: Extreme channel width (historical highs) may signal approaching consolidation or reversal
Advanced Pattern Recognition:
Channel Walking Pattern:
Upper Channel Walk: Price consistently touches or exceeds upper channel while staying above basis, very strong uptrend signal, hold longs aggressively
Lower Channel Walk: Price consistently touches or exceeds lower channel while staying below basis, very strong downtrend signal, hold shorts aggressively
Basis Support/Resistance: During channel walks, price typically uses middle band as support/resistance on minor pullbacks
Pattern Break: Price crossing basis during channel walk signals potential trend exhaustion
Squeeze and Release Pattern:
Squeeze Phase: Channels narrow significantly, price consolidates near middle band, volatility contracts
Direction Clues: Watch for price positioning relative to basis during squeeze (above = bullish bias, below = bearish bias)
Release Trigger: Price breaking outside narrow channel range with expanding width confirms breakout
Follow-Through: Measure squeeze height and project from breakout point for initial profit targets
Channel Expansion Pattern:
Breakout Confirmation: Rapid channel widening confirms volatility increase and genuine trend establishment
Entry Timing: Enter positions early in expansion phase before trend becomes overextended
Risk Management: Use channel width to size stops appropriately, wider channels require wider stops
Basis Bounce Pattern:
Clean Bounce: Price touches middle band and immediately reverses, confirms trend strength and entry opportunity
Multiple Bounces: Repeated basis bounces indicate strong, sustainable trend
Bounce Failure: Price penetrating basis signals weakening trend and potential reversal
Divergence Analysis:
Price/Channel Divergence: Price makes new high/low while staying within channel (not reaching outer band), suggests momentum weakening
Width/Price Divergence: Price breaks to new extremes but channel width contracts, suggests move lacks conviction
Reversal Signal: Divergences often precede trend reversals or significant consolidation periods
Multi-Timeframe Analysis:
Keltner Channels work particularly well in multi-timeframe trend-following approaches:
Three-Timeframe Alignment:
Higher Timeframe (Weekly/Daily): Identify major trend direction, note price position relative to basis and channels
Intermediate Timeframe (Daily/4H): Identify pullback opportunities within higher timeframe trend
Lower Timeframe (4H/1H): Time precise entries when price touches middle band or lower channel (in uptrends) with rejection
Optimal Entry Conditions:
Best Long Entries: Higher timeframe in uptrend (price above basis), intermediate timeframe pulls back to basis, lower timeframe shows rejection at middle band or lower channel
Best Short Entries: Higher timeframe in downtrend (price below basis), intermediate timeframe bounces to basis, lower timeframe shows rejection at middle band or upper channel
Risk Management: Use higher timeframe channel width to set position sizing, stops below/above higher timeframe channels
🎯 STRATEGIC APPLICATIONS
Keltner Channel Enhanced excels in trend-following and breakout strategies across different market conditions.
Trend Following Strategy:
Setup Requirements:
Identify established trend with price consistently on one side of basis line
Wait for pullback to middle band (basis) or brief penetration through it
Confirm trend resumption with price rejection at basis and move back toward outer channel
Enter in trend direction with stop beyond basis line
Entry Rules:
Uptrend Entry:
Price pulls back from upper channel to middle band, shows support at basis (bullish candlestick, momentum divergence)
Enter long on rejection/bounce from basis with stop 1-2 ATR below basis
Aggressive: Enter on first touch; Conservative: Wait for confirmation candle
Downtrend Entry:
Price bounces from lower channel to middle band, shows resistance at basis (bearish candlestick, momentum divergence)
Enter short on rejection/reversal from basis with stop 1-2 ATR above basis
Aggressive: Enter on first touch; Conservative: Wait for confirmation candle
Trend Management:
Trailing Stop: Use basis line as dynamic trailing stop, exit if price closes beyond basis against position
Profit Taking: Take partial profits at opposite channel, move stops to basis
Position Additions: Add to winners on subsequent basis bounces if trend intact
Breakout Strategy:
Setup Requirements:
Identify consolidation period with contracting channel width
Monitor price action near middle band with reduced volatility
Wait for decisive breakout beyond channel range with expanding width
Enter in breakout direction after confirmation
Breakout Confirmation:
Price breaks clearly outside channel (upper for longs, lower for shorts), channel width begins expanding from contracted state
Volume increases significantly on breakout (if using volume analysis)
Price sustains outside channel for multiple bars without immediate reversal
Entry Approaches:
Aggressive: Enter on initial break with stop at opposite channel or basis, use smaller position size
Conservative: Wait for pullback to broken channel level, enter on rejection and resumption, tighter stop
Volatility-Based Position Sizing:
Adjust position sizing based on channel width (ATR-based volatility):
Wide Channels (High ATR): Reduce position size as stops must be wider, calculate position size using ATR-based risk calculation: Risk / (Stop Distance in ATR × ATR Value)
Narrow Channels (Low ATR): Increase position size as stops can be tighter, be cautious of impending volatility expansion
ATR-Based Risk Management: Use ATR-based risk calculations, position size = 0.01 × Capital / (2 × ATR), use multiples of ATR (1-2 ATR) for adaptive stops
Algorithm Selection Guidelines:
Different market conditions benefit from different algorithm combinations:
Strong Trending Markets: Middle band use EMA or HMA, ATR use RMA, capture trends quickly while maintaining stable channel width
Choppy/Ranging Markets: Middle band use SMA or WMA, ATR use SMA or WMA, avoid false trend signals while identifying genuine reversals
Volatile Markets: Middle band and ATR both use KAMA or FRAMA, self-adjusting to changing market conditions reduces manual optimization
Breakout Trading: Middle band use SMA, ATR use EMA or SMA, stable trend with dynamic channels highlights volatility expansion early
Scalping/Day Trading: Middle band use HMA or T3, ATR use EMA or TEMA, both components respond quickly
Position Trading: Middle band use EMA/TEMA/T3, ATR use RMA or TEMA, filter out noise for long-term trend-following
📋 DETAILED PARAMETER CONFIGURATION
Understanding and optimizing parameters is essential for adapting Keltner Channel Enhanced to specific trading approaches.
Source Parameter:
Close (Most Common): Uses closing price, reflects daily settlement, best for end-of-day analysis and position trading, standard choice
HL2 (Median Price): Smooths out closing bias, better represents full daily range in volatile markets, good for swing trading
HLC3 (Typical Price): Gives more weight to close while including full range, popular for intraday applications, slightly more responsive than HL2
OHLC4 (Average Price): Most comprehensive price representation, smoothest option, good for gap-prone markets or highly volatile instruments
Length Parameter:
Controls the lookback period for middle band (basis) calculation:
Short Periods (10-15): Very responsive to price changes, suitable for day trading and scalping, higher false signal rate
Standard Period (20 - Default): Represents approximately one month of trading, good balance between responsiveness and stability, suitable for swing and position trading
Medium Periods (30-50): Smoother trend identification, fewer false signals, better for position trading and longer holding periods
Long Periods (50+): Very smooth, identifies major trends only, minimal false signals but significant lag, suitable for long-term investment
Optimization by Timeframe: 1-15 minute charts use 10-20 period, 30-60 minute charts use 20-30 period, 4-hour to daily charts use 20-40 period, weekly charts use 20-30 weeks.
ATR Length Parameter:
Controls the lookback period for Average True Range calculation, affecting channel width:
Short ATR Periods (5-10): Very responsive to recent volatility changes, standard is 10 (Keltner's original specification), may be too reactive in whipsaw conditions
Standard ATR Period (10 - Default): Chester Keltner's original specification, good balance between responsiveness and stability, most widely used
Medium ATR Periods (14-20): Smoother channel width, ATR 14 aligns with Wilder's original ATR specification, good for position trading
Long ATR Periods (20+): Very smooth channel width, suitable for long-term trend-following
Length vs. ATR Length Relationship: Equal values (20/20) provide balanced responsiveness, longer ATR (20/14) gives more stable channel width, shorter ATR (20/10) is standard configuration, much shorter ATR (20/5) creates very dynamic channels.
Multiplier Parameter:
Controls channel width by setting ATR multiples:
Lower Values (1.0-1.5): Tighter channels with frequent price touches, more trading signals, higher false signal rate, better for range-bound and mean-reversion strategies
Standard Value (2.0 - Default): Chester Keltner's recommended setting, good balance between signal frequency and reliability, suitable for both trending and ranging strategies
Higher Values (2.5-3.0): Wider channels with less frequent touches, fewer but potentially higher-quality signals, better for strong trending markets
Market-Specific Optimization: High volatility markets (crypto, small-caps) use 2.5-3.0 multiplier, medium volatility markets (major forex, large-caps) use 2.0 multiplier, low volatility markets (bonds, utilities) use 1.5-2.0 multiplier.
MA Type Parameter (Middle Band):
Critical selection that determines trend identification characteristics:
EMA (Exponential Moving Average - Default): Standard Keltner Channel choice, Chester Keltner's original specification, emphasizes recent prices, faster response to trend changes, suitable for all timeframes
SMA (Simple Moving Average): Equal weighting of all data points, no directional bias, slower than EMA, better for ranging markets and mean-reversion
HMA (Hull Moving Average): Minimal lag with smooth output, excellent for fast trend identification, best for day trading and scalping
TEMA (Triple Exponential Moving Average): Advanced smoothing with reduced lag, responsive to trends while filtering noise, suitable for volatile markets
T3 (Tillson T3): Very smooth with minimal lag, excellent for established trend identification, suitable for position trading
KAMA (Kaufman Adaptive Moving Average): Automatically adjusts speed based on market efficiency, slow in ranging markets, fast in trends, suitable for markets with varying conditions
ATR MA Type Parameter:
Determines how Average True Range is smoothed, affecting channel width stability:
RMA (Wilder's Smoothing - Default): J. Welles Wilder's original ATR smoothing method, very smooth, slow to adapt to volatility changes, provides stable channel width
SMA (Simple Moving Average): Equal weighting, moderate smoothness, faster response to volatility changes than RMA, more dynamic channel width
EMA (Exponential Moving Average): Emphasizes recent volatility, quick adaptation to new volatility regimes, very responsive channel width changes
TEMA (Triple Exponential Moving Average): Smooth yet responsive, good balance for varying volatility, suitable for most trading styles
Parameter Combination Strategies:
Conservative Trend-Following: Length 30/ATR Length 20/Multiplier 2.5, MA Type EMA or TEMA/ATR MA Type RMA, smooth trend with stable wide channels, suitable for position trading
Standard Balanced Approach: Length 20/ATR Length 10/Multiplier 2.0, MA Type EMA/ATR MA Type RMA, classic Keltner Channel configuration, suitable for general purpose swing trading
Aggressive Day Trading: Length 10-15/ATR Length 5-7/Multiplier 1.5-2.0, MA Type HMA or EMA/ATR MA Type EMA or SMA, fast trend with dynamic channels, suitable for scalping and day trading
Breakout Specialist: Length 20-30/ATR Length 5-10/Multiplier 2.0, MA Type SMA or WMA/ATR MA Type EMA or SMA, stable trend with responsive channel width
Adaptive All-Conditions: Length 20/ATR Length 10/Multiplier 2.0, MA Type KAMA or FRAMA/ATR MA Type KAMA or TEMA, self-adjusting to market conditions
Offset Parameter:
Controls horizontal positioning of channels on chart. Positive values shift channels to the right (future) for visual projection, negative values shift left (past) for historical analysis, zero (default) aligns with current price bars for real-time signal analysis. Offset affects only visual display, not alert conditions or actual calculations.
📈 PERFORMANCE ANALYSIS & COMPETITIVE ADVANTAGES
Keltner Channel Enhanced provides improvements over standard implementations while maintaining proven effectiveness.
Response Characteristics:
Standard EMA/RMA Configuration: Moderate trend lag (approximately 0.4 × length periods), smooth and stable channel width from RMA smoothing, good balance for most market conditions
Fast HMA/EMA Configuration: Approximately 60% reduction in trend lag compared to EMA, responsive channel width from EMA ATR smoothing, suitable for quick trend changes and breakouts
Adaptive KAMA/KAMA Configuration: Variable lag based on market efficiency, automatic adjustment to trending vs. ranging conditions, self-optimizing behavior reduces manual intervention
Comparison with Traditional Keltner Channels:
Enhanced Version Advantages:
Dual Algorithm Flexibility: Independent MA selection for trend and volatility vs. fixed EMA/RMA, separate tuning of trend responsiveness and channel stability
Market Adaptation: Choose configurations optimized for specific instruments and conditions, customize for scalping, swing, or position trading preferences
Comprehensive Alerts: Enhanced alert system including channel expansion detection
Traditional Version Advantages:
Simplicity: Fewer parameters, easier to understand and implement
Standardization: Fixed EMA/RMA combination ensures consistency across users
Research Base: Decades of backtesting and research on standard configuration
When to Use Enhanced Version: Trading multiple instruments with different characteristics, switching between trending and ranging markets, employing different strategies, algorithm-based trading systems requiring customization, seeking optimization for specific trading style and timeframe.
When to Use Standard Version: Beginning traders learning Keltner Channel concepts, following published research or trading systems, preferring simplicity and standardization, wanting to avoid optimization and curve-fitting risks.
Performance Across Market Conditions:
Strong Trending Markets: EMA or HMA basis with RMA or TEMA ATR smoothing provides quicker trend identification, pullbacks to basis offer excellent entry opportunities
Choppy/Ranging Markets: SMA or WMA basis with RMA ATR smoothing and lower multipliers, channel bounce strategies work well, avoid false breakouts
Volatile Markets: KAMA or FRAMA with EMA or TEMA, adaptive algorithms excel by automatic adjustment, wider multipliers (2.5-3.0) accommodate large price swings
Low Volatility/Consolidation: Channels narrow significantly indicating consolidation, algorithm choice less impactful, focus on detecting channel width contraction for breakout preparation
Keltner Channel vs. Bollinger Bands - Usage Comparison:
Favor Keltner Channels When: Trend-following is primary strategy, trading volatile instruments with gaps, want ATR-based volatility measurement, prefer fewer higher-quality channel touches, seeking stable channel width during trends.
Favor Bollinger Bands When: Mean-reversion is primary strategy, trading instruments with limited gaps, want statistical framework based on standard deviation, need squeeze patterns for breakout identification, prefer more frequent trading opportunities.
Use Both Together: Bollinger Band squeeze + Keltner Channel breakout is powerful combination, price outside Bollinger Bands but inside Keltner Channels indicates moderate signal, price outside both indicates very strong signal, Bollinger Bands for entries and Keltner Channels for trend confirmation.
Limitations and Considerations:
General Limitations:
Lagging Indicator: All moving averages lag price, even with reduced-lag algorithms
Trend-Dependent: Works best in trending markets, less effective in choppy conditions
No Direction Prediction: Indicates volatility and deviation, not future direction, requires confirmation
Enhanced Version Specific Considerations:
Optimization Risk: More parameters increase risk of curve-fitting historical data
Complexity: Additional choices may overwhelm beginning traders
Backtesting Challenges: Different algorithms produce different historical results
Mitigation Strategies:
Use Confirmation: Combine with momentum indicators (RSI, MACD), volume, or price action
Test Parameter Robustness: Ensure parameters work across range of values, not just optimized ones
Multi-Timeframe Analysis: Confirm signals across different timeframes
Proper Risk Management: Use appropriate position sizing and stops
Start Simple: Begin with standard EMA/RMA before exploring alternatives
Optimal Usage Recommendations:
For Maximum Effectiveness:
Start with standard EMA/RMA configuration to understand classic behavior
Experiment with alternatives on demo account or paper trading
Match algorithm combination to market condition and trading style
Use channel width analysis to identify market phases
Combine with complementary indicators for confirmation
Implement strict risk management using ATR-based position sizing
Focus on high-quality setups rather than trading every signal
Respect the trend: trade with basis direction for higher probability
Complementary Indicators:
RSI or Stochastic: Confirm momentum at channel extremes
MACD: Confirm trend direction and momentum shifts
Volume: Validate breakouts and trend strength
ADX: Measure trend strength, avoid Keltner signals in weak trends
Support/Resistance: Combine with traditional levels for high-probability setups
Bollinger Bands: Use together for enhanced breakout and volatility analysis
USAGE NOTES
This indicator is designed for technical analysis and educational purposes. Keltner Channel Enhanced has limitations and should not be used as the sole basis for trading decisions. While the flexible moving average selection for both trend and volatility components provides valuable adaptability across different market conditions, algorithm performance varies with market conditions, and past characteristics do not guarantee future results.
Key considerations:
Always use multiple forms of analysis and confirmation before entering trades
Backtest any parameter combination thoroughly before live trading
Be aware that optimization can lead to curve-fitting if not done carefully
Start with standard EMA/RMA settings and adjust only when specific conditions warrant
Understand that no moving average algorithm can eliminate lag entirely
Consider market regime (trending, ranging, volatile) when selecting parameters
Use ATR-based position sizing and risk management on every trade
Keltner Channels work best in trending markets, less effective in choppy conditions
Respect the trend direction indicated by price position relative to basis line
The enhanced flexibility of dual algorithm selection provides powerful tools for adaptation but requires responsible use, thorough understanding of how different algorithms behave under various market conditions, and disciplined risk management.
DM Scalper TrioQuick trade plan
Timeframe: works best on 1–15m for scalps.
Market state filter: only trade with VWAP.
Long setup
Trend: Price above VWAP and EMA9 > EMA32.
Trigger: After a small pullback, a candle closes back above EMA9 (or EMA9 crosses up EMA32).
Entry: Market/limit at the close of the trigger candle.
Invalidation (stop): Below the recent swing low or 1.5×ATR(14) below entry.
Target: 1) Fixed R (e.g., +2R), or 2) scale out at +1R and trail the rest with EMA32 or a chandelier stop, or 3) exit if price closes back under VWAP.
Short setup (mirror)
Price below VWAP, EMA9 < EMA32 → pullback → close back below EMA9 (or EMA9 crosses down EMA32).
Stop above swing high or 1.5×ATR(14); targets as above.
Exit on close back above VWAP or opposite signal.
Risk + management
Risk ≤1% of account per trade.
Position size = Account Risk / (Entry – Stop) (mirror for shorts).
Skip trades around major news and low-liquidity times.
EquiSense AI Signals🇸🇦 العربي
المتنبئ الذكي المتوازن (AI v7)
وصف قصير:
مؤشر تجميعي ذكي يوازن بين الاتجاه والزخم والحجم والتذبذب وأنماط الشموع، ويحوّلها إلى نظام نقاط ونجوم يولّد إشارات شراء/بيع مؤكَّدة بتقاطع MACD. بعد الإشارة، يعرض أهدافًا ذكية (TP1/TP2/TP3) ووقف خسارة مبنيَّيْن على ATR مع رسومات مستقبلية ولوحة معلومات لإدارة الصفقة.
الإعدادات (Inputs)
الحد الأدنى للنقاط (min_score): افتراضي 6.0 — كلما ارتفع قلّت الإشارات وزادت جودتها.
الحد الأدنى للنجوم (min_stars): افتراضي 2 — فلتر لقوة الإشارة.
عدد الشموع المستقبلية (future_bars): افتراضي 15 — مدى رسم الأهداف والوقف للأمام.
استخدام الأهداف الذكية (use_ai_targets): تفعيل/إيقاف مضاعِف الذكاء الاصطناعي للأهداف والوقف.
كيف يعمل؟
يحسب المؤشر buy_score/sell_score من مجموعة عوامل: EMA8/21/50/200، RSI + متوسطه، MACD + Histogram، Stochastic، ADX/DMI، VWAP، الحجم، MTF 15m، ROC/المومنتَم، Heikin Ashi، وأنماط (ابتلاع/مطرقة/شهاب).
يحوّل الدرجات إلى نجوم (⭐⭐ إلى ⭐⭐⭐⭐⭐) حسب القوة.
تولّد الإشارة فقط إذا توفّر: درجة ≥ الحد + نجوم ≥ الحد + تقاطع MACD (صعودًا للشراء، هبوطًا للبيع).
عند الإشارة يبدأ سيناريو صفقة واحدة فقط حتى تنتهي (TP3 أو SL).
الأهداف والوقف (ذكاء اصطناعي)
تُشتق من ATR ثم تُعدَّل عبر مضاعِف AI مبني على: ATR%، الزخم (ROC)، الحجم مقابل متوسطه، قوة الاتجاه (ADX)، وعدد النجوم.
تقريبيًا:
TP1 ≈ 1.5×ATR × AI
TP2 ≈ 2.5×ATR × AI
TP3 ≈ 4.0×ATR × AI
SL ≈ 1.0×ATR ÷ AI
ماذا سترى على الشارت؟
علامات “شراء/بيع”، نجوم قرب الإشارة، خط دخول (أزرق)، وقف (أحمر منقّط)، TP1/TP2 (أخضر)، TP3 (ذهبي) مع صناديق مناطق للأهداف وخط ربط نحو الهدف النهائي.
وسم AI يعرض نسبة المضاعِف والنجوم بصريًا.
لوحة معلومات تعرض الحالة، القوة، AI%، السعر، الدرجات، وأثناء الصفقة: الدخول، TP1/TP2/TP3، والربح اللحظي.
التنبيهات (Alerts)
شرطان جاهزان: شراء وبيع عند تحقق الإشارة.
أضِف تنبيه: Right click → Add alert → اختر المؤشر → الشرط المطلوب.
أفضل الممارسات
استخدم الإطار المناسب للأصل:
سكالبينغ 5–15m: min_score 8 وmin_stars 3–4.
تأرجحي H1–H4: min_score 7 وmin_stars 3.
يومي/أسهم: min_score 6–7 وmin_stars 2–3.
فضّل التداول مع EMA200 واتجاه MTF 15m.
خفّض المخاطرة وقت الأخبار العالية.
التزم بإدارة مخاطر ثابتة (مثلاً 1% لكل صفقة).
حدود مهمة
الأفضل انتظار إغلاق الشمعة لتأكيد التقاطعات وتجنّب تغيّرها.
صفقة واحدة في المرة بفضل حالة in_trade.
يستخدم request.security مع lookahead_off لإطار 15m؛ التزم بالتقييم عند الإغلاق.
أسئلة شائعة
هل يستخدم منفردًا؟ نعم، لكن مع مناطق سعرية/ترند وخطة مخاطر يصبح أقوى.
لماذا تختلف الأهداف؟ لأن مضاعِف AI يكيّف TP/SL مع ظروف السوق.
إخلاء مسؤولية
هذه أداة تحليلية تعليمية وليست نصيحة استثمارية. اختبر الإعدادات تاريخيًا والتزم بالمخاطرة المناسبة.
ملاحظة للمبرمجين
Pine Script v6، متغيرات var لحفظ الحالة، تنظيف الرسومات على الشمعة الأخيرة، مع حدود مرتفعة للرسوم لتجنّب الأخطاء.
🇬🇧 English
Balanced Smart Predictor (AI v7)
Short description:
A smart, ensemble-style indicator that blends trend, momentum, volume, volatility, and candle patterns into a score & star system that produces Buy/Sell signals confirmed by MACD crosses. After a signal, it projects smart targets (TP1/TP2/TP3) and a stop-loss derived from ATR, with forward drawings and a control panel for trade management.
Inputs
Minimum Score (min_score): default 6.0 — higher = fewer but stronger signals.
Minimum Stars (min_stars): default 2 — extra filter for strength.
Future Bars (future_bars): default 15 — how far targets/SL are drawn ahead.
Use AI Targets (use_ai_targets): toggle the AI multiplier for TP/SL.
How it works
Computes buy_score/sell_score from: EMA8/21/50/200, RSI & its MA, MACD & Histogram, Stochastic, ADX/DMI, VWAP, Volume, 15m MTF tilt, ROC/Momentum, Heikin Ashi, and candle patterns (engulfing/hammer/shooting star).
Converts scores into Stars (⭐⭐ to ⭐⭐⭐⭐⭐) via tiered thresholds.
Signals fire only when: Score ≥ minimum + Stars ≥ minimum + MACD cross (up = Buy, down = Sell).
On a signal, one active trade is managed until TP3 or SL is reached.
Targets & Stop (AI-driven)
Targets and SL are ATR-based, then adjusted by an AI multiplier derived from: ATR%, momentum (ROC), relative volume, trend strength (ADX), and star rating.
Approximate formulas:
TP1 ≈ 1.5×ATR × AI
TP2 ≈ 2.5×ATR × AI
TP3 ≈ 4.0×ATR × AI
SL ≈ 1.0×ATR ÷ AI
What you’ll see on chart
“Buy/Sell” markers with small Star labels, an Entry line (blue), SL (red dotted), TP1/TP2 (green), TP3 (gold) with shaded target boxes and a guide line towards the final target.
A central AI badge showing the multiplier % and star rating.
A top-right Panel showing status, strength, AI%, price, scores, and during trades: entry, TP1/TP2/TP3, and live P/L.
Alerts
Two ready-made conditions: Buy and Sell when the respective signal triggers.
Add alert: Right click → Add alert → choose the indicator → select condition.
Best practices
Match timeframe to instrument:
Scalping 5–15m: min_score 8, min_stars 3–4.
Swing H1–H4: min_score 7, min_stars 3.
Daily/Equities: min_score 6–7, min_stars 2–3.
Prefer trades with EMA200 and 15m MTF trend alignment.
De-risk around major news.
Use fixed risk per trade (e.g., 1%).
Important notes
Prefer bar close confirmation to avoid mid-bar MACD flips.
Single trade at a time via the in_trade state.
15m MTF uses request.security with lookahead_off; evaluate at close for consistency.
FAQ
Use it standalone? You can, but it’s stronger when combined with S/R zones/trendlines and solid risk management.
Why do targets vary? The AI multiplier adapts TP/SL to current market conditions.
Disclaimer
This is an analytical/educational tool, not financial advice. Always backtest and use appropriate risk management.
Developer note
Built in Pine Script v6, uses var for trade state, clears drawings on the last bar to keep the chart tidy, and raises drawing limits to avoid runtime errors.
RSI Donchian Channel [DCAUT]█ RSI Donchian Channel
📊 ORIGINALITY & INNOVATION
The RSI Donchian Channel represents an important synthesis of two complementary analytical frameworks: momentum oscillators and breakout detection systems. This indicator addresses a common limitation in traditional RSI analysis by replacing fixed overbought/oversold thresholds with adaptive zones derived from historical RSI extremes.
Key Enhancement:
Traditional RSI analysis relies on static threshold levels (typically 30/70), which may not adequately reflect changing market volatility regimes. This indicator adapts the reference zones dynamically based on the actual RSI behavior over the lookback period, helping traders identify meaningful momentum extremes relative to recent price action rather than arbitrary fixed levels.
The implementation combines the proven momentum measurement capabilities of RSI with Donchian Channel's breakout detection methodology, creating a framework that identifies both momentum exhaustion points and potential continuation signals through the same analytical lens.
📐 MATHEMATICAL FOUNDATION
Core Calculation Process:
Step 1: RSI Calculation
The Relative Strength Index measures momentum by comparing the magnitude of recent gains to recent losses:
Calculate price changes between consecutive periods
Separate positive changes (gains) from negative changes (losses)
Apply selected smoothing method (RMA standard, also supports SMA, EMA, WMA) to both gain and loss series
Compute Relative Strength (RS) as the ratio of smoothed gains to smoothed losses
Transform RS into bounded 0-100 scale using the formula: RSI = 100 - (100 / (1 + RS))
Step 2: Donchian Channel Application
The Donchian Channel identifies the highest and lowest RSI values within the specified lookback period:
Upper Channel: Highest RSI value over the lookback period, represents the recent momentum peak
Lower Channel: Lowest RSI value over the lookback period, represents the recent momentum trough
Middle Channel (Basis): Average of upper and lower channels, serves as equilibrium reference
Channel Width Dynamics:
The distance between upper and lower channels reflects RSI volatility. Wide channels indicate high momentum variability, while narrow channels suggest momentum consolidation and potential breakout preparation. The indicator monitors channel width over a 100-period window to identify squeeze conditions that often precede significant momentum shifts.
📊 COMPREHENSIVE SIGNAL ANALYSIS
Primary Signal Categories:
Breakout Signals:
Upper Breakout: RSI crosses above the upper channel, indicates momentum reaching new relative highs and potential trend continuation, particularly significant when accompanied by price confirmation
Lower Breakout: RSI crosses below the lower channel, suggests momentum reaching new relative lows and potential trend exhaustion or reversal setup
Breakout strength is enhanced when the channel is narrow prior to the breakout, indicating a transition from consolidation to directional movement
Mean Reversion Signals:
Upper Touch Without Breakout: RSI reaches the upper channel but fails to break through, may indicate momentum exhaustion and potential reversal opportunity
Lower Touch Without Breakout: RSI reaches the lower channel without breakdown, suggests potential bounce as momentum reaches oversold extremes
Return to Basis: RSI moving back toward the middle channel after touching extremes signals momentum normalization
Trend Strength Assessment:
Sustained Upper Channel Riding: RSI consistently remains near or above the upper channel during strong uptrends, indicates persistent bullish momentum
Sustained Lower Channel Riding: RSI stays near or below the lower channel during strong downtrends, reflects persistent bearish pressure
Basis Line Position: RSI position relative to the middle channel helps identify the prevailing momentum bias
Channel Compression Patterns:
Squeeze Detection: Channel width narrowing to 100-period lows indicates momentum consolidation, often precedes significant directional moves
Expansion Phase: Channel widening after a squeeze confirms the initiation of a new momentum regime
Persistent Narrow Channels: Extended periods of tight channels suggest market indecision and accumulation/distribution phases
🎯 STRATEGIC APPLICATIONS
Trend Continuation Strategy:
This approach focuses on identifying and trading momentum breakouts that confirm established trends:
Identify the prevailing price trend using higher timeframe analysis or trend-following indicators
Wait for RSI to break above the upper channel in uptrends (or below the lower channel in downtrends)
Enter positions in the direction of the breakout when price action confirms the momentum shift
Place protective stops below the recent swing low (long positions) or above swing high (short positions)
Target profit levels based on prior swing extremes or use trailing stops to capture extended moves
Exit when RSI crosses back through the basis line in the opposite direction
Mean Reversion Strategy:
This method capitalizes on momentum extremes and subsequent corrections toward equilibrium:
Monitor for RSI reaching the upper or lower channel boundaries
Look for rejection signals (price reversal patterns, volume divergence) when RSI touches the channels
Enter counter-trend positions when RSI begins moving back toward the basis line
Use the basis line as the initial profit target for mean reversion trades
Implement tight stops beyond the channel extremes to limit risk on failed reversals
Scale out of positions as RSI approaches the basis line and closes the position when RSI crosses the basis
Breakout Preparation Strategy:
This approach positions traders ahead of potential volatility expansion from consolidation phases:
Identify squeeze conditions when channel width reaches 100-period lows
Monitor price action for consolidation patterns (triangles, rectangles, flags) during the squeeze
Prepare conditional orders for breakouts in both directions from the consolidation
Enter positions when RSI breaks out of the narrow channel with expanding width
Use the channel width expansion as a confirmation signal for the breakout's validity
Manage risk with stops just inside the opposite channel boundary
Multi-Timeframe Confluence Strategy:
Combining RSI Donchian Channel analysis across multiple timeframes can improve signal reliability:
Identify the primary trend direction using a higher timeframe RSI Donchian Channel (e.g., daily or weekly)
Use a lower timeframe (e.g., 4-hour or hourly) to time precise entry points
Enter long positions when both timeframes show RSI above their respective basis lines
Enter short positions when both timeframes show RSI below their respective basis lines
Avoid trades when timeframes provide conflicting signals (e.g., higher timeframe below basis, lower timeframe above)
Exit when the higher timeframe RSI crosses its basis line in the opposite direction
Risk Management Guidelines:
Effective risk management is essential for all RSI Donchian Channel strategies:
Position Sizing: Calculate position sizes based on the distance between entry point and stop loss, limiting risk to 1-2% of capital per trade
Stop Loss Placement: For breakout trades, place stops just inside the opposite channel boundary; for mean reversion trades, use stops beyond the channel extremes
Profit Targets: Use the basis line as a minimum target for mean reversion trades; for trend trades, target prior swing extremes or use trailing stops
Channel Width Context: Increase position sizes during narrow channels (lower volatility) and reduce sizes during wide channels (higher volatility)
Correlation Awareness: Monitor correlations between traded instruments to avoid over-concentration in similar setups
📋 DETAILED PARAMETER CONFIGURATION
RSI Source:
Defines the price data series used for RSI calculation:
Close (Default): Standard choice providing end-of-period momentum assessment, suitable for most trading styles and timeframes
High-Low Average (HL2): Reduces the impact of closing auction dynamics, useful for markets with significant end-of-day volatility
High-Low-Close Average (HLC3): Provides a more balanced view incorporating the entire period's range
Open-High-Low-Close Average (OHLC4): Offers the most comprehensive price representation, helpful for identifying overall period sentiment
Strategy Consideration: Use Close for end-of-period signals, HL2 or HLC3 for intraday volatility reduction, OHLC4 for capturing full period dynamics
RSI Length:
Controls the number of periods used for RSI calculation:
Short Periods (5-9): Highly responsive to recent price changes, produces more frequent signals with increased false signal risk, suitable for short-term trading and volatile markets
Standard Period (14): Widely accepted default balancing responsiveness with stability, appropriate for swing trading and intermediate-term analysis
Long Periods (21-28): Produces smoother RSI with fewer signals but more reliable trend identification, better for position trading and reducing noise in choppy markets
Optimization Approach: Test different lengths against historical data for your specific market and timeframe, consider using longer periods in ranging markets and shorter periods in trending markets
RSI MA Type:
Determines the smoothing method applied to price changes in RSI calculation:
RMA (Relative Moving Average - Default): Wilder's original smoothing method providing stable momentum measurement with gradual response to changes, maintains consistency with classical RSI interpretation
SMA (Simple Moving Average): Treats all periods equally, responds more quickly to changes than RMA but may produce more whipsaws in volatile conditions
EMA (Exponential Moving Average): Weights recent periods more heavily, increases responsiveness at the cost of potential noise, suitable for traders prioritizing early signal generation
WMA (Weighted Moving Average): Applies linear weighting favoring recent data, offers a middle ground between SMA and EMA responsiveness
Selection Guidance: Maintain RMA for consistency with traditional RSI analysis, use EMA or WMA for more responsive signals in fast-moving markets, apply SMA for maximum simplicity and transparency
DC Length:
Specifies the lookback period for Donchian Channel calculation on RSI values:
Short Periods (10-14): Creates tight channels that adapt quickly to changing momentum conditions, generates more frequent trading signals but increases sensitivity to short-term RSI fluctuations
Standard Period (20): Balances channel responsiveness with stability, aligns with traditional Bollinger Bands and moving average periods, suitable for most trading styles
Long Periods (30-50): Produces wider, more stable channels that better represent sustained momentum extremes, reduces signal frequency while improving reliability, appropriate for position traders and higher timeframes
Calibration Strategy: Match DC length to your trading timeframe (shorter for day trading, longer for swing trading), test channel width behavior during different market regimes, consider using adaptive periods that adjust to volatility conditions
Market Adaptation: Use shorter DC lengths in trending markets to capture momentum shifts earlier, apply longer periods in ranging markets to filter noise and focus on significant extremes
Parameter Combination Recommendations:
Scalping/Day Trading: RSI Length 5-9, DC Length 10-14, EMA or WMA smoothing for maximum responsiveness
Swing Trading: RSI Length 14, DC Length 20, RMA smoothing for balanced analysis (default configuration)
Position Trading: RSI Length 21-28, DC Length 30-50, RMA or SMA smoothing for stable signals
High Volatility Markets: Longer RSI periods (21+) with standard DC length (20) to reduce noise
Low Volatility Markets: Standard RSI length (14) with shorter DC length (10-14) to capture subtle momentum shifts
📈 PERFORMANCE ANALYSIS & COMPETITIVE ADVANTAGES
Adaptive Threshold Mechanism:
Unlike traditional RSI analysis with fixed 30/70 thresholds, this indicator's Donchian Channel approach provides several improvements:
Context-Aware Extremes: Overbought/oversold levels adjust automatically based on recent momentum behavior rather than arbitrary fixed values
Volatility Adaptation: In low volatility periods, channels narrow to reflect tighter momentum ranges; in high volatility, channels widen appropriately
Market Regime Recognition: The indicator implicitly adapts to different market conditions without manual threshold adjustments
False Signal Reduction: Adaptive channels help reduce premature reversal signals that often occur with fixed thresholds during strong trends
Signal Quality Characteristics:
The indicator's dual-purpose design provides distinct advantages for different trading objectives:
Breakout Trading: Channel boundaries offer clear, objective breakout levels that update dynamically, eliminating the ambiguity of when momentum becomes "too high" or "too low"
Mean Reversion: The basis line provides a natural profit target for reversion trades, representing the midpoint of recent momentum extremes
Trend Strength: Persistent channel boundary riding offers an objective measure of trend strength without additional indicators
Consolidation Detection: Channel width analysis provides early warning of potential volatility expansion from compression phases
Comparative Analysis:
When compared to traditional RSI implementations and other momentum frameworks:
vs. Fixed Threshold RSI: Provides market-adaptive reference levels rather than static values, helping to reduce false signals during trending markets where RSI can remain "overbought" or "oversold" for extended periods
vs. RSI Bollinger Bands: Offers clearer breakout signals and more intuitive extreme identification through actual high/low boundaries rather than statistical standard deviations
vs. Stochastic Oscillator: Maintains RSI's momentum measurement advantages (unbounded calculation avoiding scale compression) while adding the breakout detection capabilities of Donchian Channels
vs. Standard Donchian Channels: Applies breakout methodology to momentum space rather than price, providing earlier signals of potential trend changes before price breakouts occur
Performance Characteristics:
The indicator exhibits specific behavioral patterns across different market conditions:
Trending Markets: Excels at identifying momentum continuation through channel breakouts, RSI tends to ride one channel boundary during strong trends, providing trend confirmation
Ranging Markets: Channel width narrows during consolidation, offering early preparation signals for potential breakout trading opportunities
High Volatility: Channels widen to reflect increased momentum variability, automatically adjusting signal sensitivity to match market conditions
Low Volatility: Channels contract, making the indicator more sensitive to subtle momentum shifts that may be significant in calm market environments
Transition Periods: Channel squeezes often precede major trend changes, offering advance warning of potential regime shifts
Limitations and Considerations:
Users should be aware of certain operational characteristics:
Lookback Dependency: Channel boundaries depend entirely on the lookback period, meaning the indicator has no predictive element beyond identifying current momentum relative to recent history
Lag Characteristics: As with all moving average-based indicators, RSI calculation introduces lag, and channel boundaries update only as new extremes occur within the lookback window
Range-Bound Sensitivity: In extremely tight ranges, channels may become very narrow, potentially generating excessive signals from minor momentum fluctuations
Trending Persistence: During very strong trends, RSI may remain at channel extremes for extended periods, requiring patience for mean reversion setups or commitment to trend-following approaches
No Absolute Levels: Unlike traditional RSI, this indicator provides no fixed reference points (like 50), making it less suitable for strategies that depend on absolute momentum readings
USAGE NOTES
This indicator is designed for technical analysis and educational purposes to help traders understand momentum dynamics and identify potential trading opportunities. The RSI Donchian Channel has limitations and should not be used as the sole basis for trading decisions.
Important considerations:
Performance varies significantly across different market conditions, timeframes, and instruments
Historical signal patterns do not guarantee future results, as market behavior continuously evolves
Effective use requires understanding of both RSI momentum principles and Donchian Channel breakout concepts
Risk management practices (stop losses, position sizing, diversification) are essential for any trading application
Consider combining with additional analytical tools such as volume analysis, price action patterns, or trend indicators for confirmation
Backtest thoroughly on your specific instruments and timeframes before live trading implementation
Be aware that optimization on historical data may lead to curve-fitting and poor forward performance
The indicator performs best when used as part of a comprehensive trading methodology that incorporates multiple forms of market analysis, sound risk management, and realistic expectations about win rates and drawdowns.
EquiSense AI Signals🇸🇦 العربي
المتنبئ الذكي المتوازن (AI v7)
وصف قصير:
مؤشر تجميعي ذكي يوازن بين الاتجاه والزخم والحجم والتذبذب وأنماط الشموع، ويحوّلها إلى نظام نقاط ونجوم يولّد إشارات شراء/بيع مؤكَّدة بتقاطع MACD. بعد الإشارة، يعرض أهدافًا ذكية (TP1/TP2/TP3) ووقف خسارة مبنيَّيْن على ATR مع رسومات مستقبلية ولوحة معلومات لإدارة الصفقة.
الإعدادات (Inputs)
الحد الأدنى للنقاط (min_score): افتراضي 6.0 — كلما ارتفع قلّت الإشارات وزادت جودتها.
الحد الأدنى للنجوم (min_stars): افتراضي 2 — فلتر لقوة الإشارة.
عدد الشموع المستقبلية (future_bars): افتراضي 15 — مدى رسم الأهداف والوقف للأمام.
استخدام الأهداف الذكية (use_ai_targets): تفعيل/إيقاف مضاعِف الذكاء الاصطناعي للأهداف والوقف.
كيف يعمل؟
يحسب المؤشر buy_score/sell_score من مجموعة عوامل: EMA8/21/50/200، RSI + متوسطه، MACD + Histogram، Stochastic، ADX/DMI، VWAP، الحجم، MTF 15m، ROC/المومنتَم، Heikin Ashi، وأنماط (ابتلاع/مطرقة/شهاب).
يحوّل الدرجات إلى نجوم (⭐⭐ إلى ⭐⭐⭐⭐⭐) حسب القوة.
تولّد الإشارة فقط إذا توفّر: درجة ≥ الحد + نجوم ≥ الحد + تقاطع MACD (صعودًا للشراء، هبوطًا للبيع).
عند الإشارة يبدأ سيناريو صفقة واحدة فقط حتى تنتهي (TP3 أو SL).
الأهداف والوقف (ذكاء اصطناعي)
تُشتق من ATR ثم تُعدَّل عبر مضاعِف AI مبني على: ATR%، الزخم (ROC)، الحجم مقابل متوسطه، قوة الاتجاه (ADX)، وعدد النجوم.
تقريبيًا:
TP1 ≈ 1.5×ATR × AI
TP2 ≈ 2.5×ATR × AI
TP3 ≈ 4.0×ATR × AI
SL ≈ 1.0×ATR ÷ AI
ماذا سترى على الشارت؟
علامات “شراء/بيع”، نجوم قرب الإشارة، خط دخول (أزرق)، وقف (أحمر منقّط)، TP1/TP2 (أخضر)، TP3 (ذهبي) مع صناديق مناطق للأهداف وخط ربط نحو الهدف النهائي.
وسم AI يعرض نسبة المضاعِف والنجوم بصريًا.
لوحة معلومات تعرض الحالة، القوة، AI%، السعر، الدرجات، وأثناء الصفقة: الدخول، TP1/TP2/TP3، والربح اللحظي.
التنبيهات (Alerts)
شرطان جاهزان: شراء وبيع عند تحقق الإشارة.
أضِف تنبيه: Right click → Add alert → اختر المؤشر → الشرط المطلوب.
أفضل الممارسات
استخدم الإطار المناسب للأصل:
سكالبينغ 5–15m: min_score 8 وmin_stars 3–4.
تأرجحي H1–H4: min_score 7 وmin_stars 3.
يومي/أسهم: min_score 6–7 وmin_stars 2–3.
فضّل التداول مع EMA200 واتجاه MTF 15m.
خفّض المخاطرة وقت الأخبار العالية.
التزم بإدارة مخاطر ثابتة (مثلاً 1% لكل صفقة).
حدود مهمة
الأفضل انتظار إغلاق الشمعة لتأكيد التقاطعات وتجنّب تغيّرها.
صفقة واحدة في المرة بفضل حالة in_trade.
يستخدم request.security مع lookahead_off لإطار 15m؛ التزم بالتقييم عند الإغلاق.
أسئلة شائعة
هل يستخدم منفردًا؟ نعم، لكن مع مناطق سعرية/ترند وخطة مخاطر يصبح أقوى.
لماذا تختلف الأهداف؟ لأن مضاعِف AI يكيّف TP/SL مع ظروف السوق.
إخلاء مسؤولية
هذه أداة تحليلية تعليمية وليست نصيحة استثمارية. اختبر الإعدادات تاريخيًا والتزم بالمخاطرة المناسبة.
ملاحظة للمبرمجين
Pine Script v6، متغيرات var لحفظ الحالة، تنظيف الرسومات على الشمعة الأخيرة، مع حدود مرتفعة للرسوم لتجنّب الأخطاء.
🇬🇧 English
Balanced Smart Predictor (AI v7)
Short description:
A smart, ensemble-style indicator that blends trend, momentum, volume, volatility, and candle patterns into a score & star system that produces Buy/Sell signals confirmed by MACD crosses. After a signal, it projects smart targets (TP1/TP2/TP3) and a stop-loss derived from ATR, with forward drawings and a control panel for trade management.
Inputs
Minimum Score (min_score): default 6.0 — higher = fewer but stronger signals.
Minimum Stars (min_stars): default 2 — extra filter for strength.
Future Bars (future_bars): default 15 — how far targets/SL are drawn ahead.
Use AI Targets (use_ai_targets): toggle the AI multiplier for TP/SL.
How it works
Computes buy_score/sell_score from: EMA8/21/50/200, RSI & its MA, MACD & Histogram, Stochastic, ADX/DMI, VWAP, Volume, 15m MTF tilt, ROC/Momentum, Heikin Ashi, and candle patterns (engulfing/hammer/shooting star).
Converts scores into Stars (⭐⭐ to ⭐⭐⭐⭐⭐) via tiered thresholds.
Signals fire only when: Score ≥ minimum + Stars ≥ minimum + MACD cross (up = Buy, down = Sell).
On a signal, one active trade is managed until TP3 or SL is reached.
Targets & Stop (AI-driven)
Targets and SL are ATR-based, then adjusted by an AI multiplier derived from: ATR%, momentum (ROC), relative volume, trend strength (ADX), and star rating.
Approximate formulas:
TP1 ≈ 1.5×ATR × AI
TP2 ≈ 2.5×ATR × AI
TP3 ≈ 4.0×ATR × AI
SL ≈ 1.0×ATR ÷ AI
What you’ll see on chart
“Buy/Sell” markers with small Star labels, an Entry line (blue), SL (red dotted), TP1/TP2 (green), TP3 (gold) with shaded target boxes and a guide line towards the final target.
A central AI badge showing the multiplier % and star rating.
A top-right Panel showing status, strength, AI%, price, scores, and during trades: entry, TP1/TP2/TP3, and live P/L.
Alerts
Two ready-made conditions: Buy and Sell when the respective signal triggers.
Add alert: Right click → Add alert → choose the indicator → select condition.
Best practices
Match timeframe to instrument:
Scalping 5–15m: min_score 8, min_stars 3–4.
Swing H1–H4: min_score 7, min_stars 3.
Daily/Equities: min_score 6–7, min_stars 2–3.
Prefer trades with EMA200 and 15m MTF trend alignment.
De-risk around major news.
Use fixed risk per trade (e.g., 1%).
Important notes
Prefer bar close confirmation to avoid mid-bar MACD flips.
Single trade at a time via the in_trade state.
15m MTF uses request.security with lookahead_off; evaluate at close for consistency.
FAQ
Use it standalone? You can, but it’s stronger when combined with S/R zones/trendlines and solid risk management.
Why do targets vary? The AI multiplier adapts TP/SL to current market conditions.
Disclaimer
This is an analytical/educational tool, not financial advice. Always backtest and use appropriate risk management.
Developer note
Built in Pine Script v6, uses var for trade state, clears drawings on the last bar to keep the chart tidy, and raises drawing limits to avoid runtime errors.
Bollinger Bands %b Trend | DextraOverview
The Bollinger Bands %b Trend | Dextra is a custom technical indicator designed to enhance trend identification using the Bollinger Bands %b concept. This indicator calculates the percentage position of the price relative to the Bollinger Bands and uses customizable thresholds to determine bullish or bearish trends. It integrates dynamic candle coloring and a clear visual representation to assist traders in making informed decisions.
Key Features
- Bollinger Bands %b Calculation: Measures the price's position between the upper and lower Bollinger Bands as a percentage, providing a normalized view of overbought or oversold conditions.
- Trend Detection: Identifies uptrends and downtrends based on user-defined thresholds, offering a straightforward trend-following approach.
- Dynamic Candle Coloring: Colors candles according to the detected trend (green for uptrend, magenta for downtrend, gray for neutral), enhancing visual trend analysis.
- Customizable Parameters: Allows adjustment of length, standard deviation multiplier, and trend thresholds to suit various market conditions and trading styles.
How It Works
1. Bollinger Bands Calculation:
- The indicator uses an Exponential Moving Average (EMA) as the basis, calculated with a user-defined `length` (default 34).
- Upper and lower bands are derived by adding and subtracting a multiple of the standard deviation (`mult`, default 2.0) from the EMA.
- The %b value is computed as `(src - lower) / (upper - lower)`, where `src` is the price source (default `close`).
2. Trend Identification:
- An uptrend is detected when %b exceeds the `upperthreshold` (default 0.75).
- A downtrend is detected when %b falls below the `lowerthreshold` (default 0.26).
- The trend state is maintained until a new threshold condition is met.
3. Visualization:
- The %b line is plotted with a color reflecting the trend (green for uptrend, magenta for downtrend, gray for neutral).
- Horizontal dashed lines mark the uptrend and downtrend thresholds for reference.
- Candles are colored to match the trend, providing an overlay visualization on the price chart.
Customization Options
- Length: Adjust the EMA and standard deviation period (default 34, min 1).
- Source: Select the price data source for calculations (default `close`).
- StdDev: Set the standard deviation multiplier for band width (default 2.0, range 0.001 to 50).
- Uptrend Threshold: Define the %b level for uptrend detection (default 0.75, step 0.01).
- Downtrend Threshold: Define the %b level for downtrend detection (default 0.26, step 0.01).
Ideal Use Cases
- Trend Following: Perfect for traders seeking to capitalize on sustained price movements with clear entry and exit signals.
- Volatility Analysis: Useful for identifying periods of high or low volatility when combined with the %b positioning.
- Complementary Tool: Works well alongside momentum indicators (e.g., RSI) or volume-based tools to confirm trend strength.
#### Disclaimer
This indicator is provided for educational and informational purposes only. It is not intended to serve as financial advice or a guaranteed method for trading success. Trading involves significant risks, including the potential loss of capital. Users are solely responsible for their trading decisions and should conduct their own analysis and apply appropriate risk management strategies.
Notes
- Ensure your chart has sufficient historical data to reflect accurate Bollinger Bands calculations.
- Test the indicator on a demo account before using it in live trading to validate its performance with your preferred assets and timeframes.
This indicator is a versatile addition to any trader's toolkit, offering a blend of trend detection and visual clarity tailored to modern trading needs.
DM Scalper FlowHow to enter trades manually
You can use this workflow:
For LONG entries
Wait for the “LONG ▲” bias to appear on the table.
Confirm the candle is bullish (close > open) and above VWAP.
Enter at or near the close of that bar or on a small pullback.
Set stop loss at Bull SL, target at Bull TP from the table.
For SHORT (PUT) entries
Wait for the “PUT ▼” bias.
Confirm the candle is bearish (close < open) and below VWAP.
Enter near the close or next small retracement.
Use Bear SL and Bear TP from the table.
How to interpret the table
Row Meaning Usage
Bull SL / TP ATR-based Stop-Loss and Take-Profit levels for a long Use as your entry plan if you take a long
Bear SL / TP ATR-based levels for a short Use for short entries
Bias “LONG” or “PUT” signal + arrow Follow only when it’s active
FibLevel Size CalculatorThis skript calculates position sizes and new take profits for sizing into an long or short position with 3 entrys defined at custom fibonacci retracement levels.
TP: -0,272
Entry1: 0.382
Entry2: 0.618
Entry3: 0.83
SL: 1.05
Expected RR per trade is 0.2 with a High Win rate definitly profitable.
Search for an established trend on the higher timeframe, drop to the smaller ones and look for correction waves. Once they break to the trenddirection of the higher timeframe take the fib from lowest to highes point. Draw a fib level on the chart and use the Indicator to define these Levels above. The calculator gives you the Margin to use in each position, and will check that you will not get liquidated an that you have enough margin. It tells you the new TP for Limit2 and Limit3 if they get hit so you can get out of the trade full TP with a small bounce.
Inputs:
Account Balance, Risk Percentage, and Leverage: These inputs are used to calculate the position size and risk.
Entry 1, Entry 2, Entry 3, Take Profit (TP), and Stop Loss (SL): These prices are used for calculating position sizes, risk, and profit for up to three entry points.
Calculations:
Risk Amount: Calculated based on the account balance and risk percentage.
Position Sizes (Qty): For each entry point, the position size is determined. The second and third entries have a multiplier (3x for Entry 2, 5x for Entry 3) compared to the first.
Stop Loss and Profit Calculation: The script calculates the potential profit and adjusts the TP levels based on the average entries for Limit 2 and Limit 3.
Margin Calculation: Margin requirements for each position are calculated based on leverage.
Output:
Table Display: A table shows key values like entry prices, position sizes, TP levels, potential profit, and margin requirements for each limit.
Warnings: It includes a liquidation warning and a check for whether the account is at risk of liquidation based on leverage.
Position Type: It automatically detects if the trade is a long or short based on the relationship between TP and SL.
Visualization:
Lines: It draws horizontal lines on the chart to visually represent the entry, TP, and SL levels.
Overall, this script is designed to help traders manage risk and calculate position sizes for multi-level entries using leverage.
Pls drop feedback in the comments.
Nef33 Forex & Crypto Trading Signals PRO
1. Understanding the Indicator's Context
The indicator generates signals based on confluence (trend, volume, key zones, etc.), but it does not include predefined SL or TP levels. To establish them, we must:
Use dynamic or static support/resistance levels already present in the script.
Incorporate volatility (such as ATR) to adjust the levels based on market conditions.
Define a risk/reward ratio (e.g., 1:2).
2. Options for Determining SL and TP
Below, I provide several ideas based on the tools available in the script:
Stop Loss (SL)
The SL should protect you from adverse movements. You can base it on:
ATR (Volatility): Use the smoothed ATR (atr_smooth) multiplied by a factor (e.g., 1.5 or 2) to set a dynamic SL.
Buy: SL = Entry Price - (atr_smooth * atr_mult).
Sell: SL = Entry Price + (atr_smooth * atr_mult).
Key Zones: Place the SL below a support (for buys) or above a resistance (for sells), using Order Blocks, Fair Value Gaps, or Liquidity Zones.
Buy: SL below the nearest ob_lows or fvg_lows.
Sell: SL above the nearest ob_highs or fvg_highs.
VWAP: Use the daily VWAP (vwap_day) as a critical level.
Buy: SL below vwap_day.
Sell: SL above vwap_day.
Take Profit (TP)
The TP should maximize profits. You can base it on:
Risk/Reward Ratio: Multiply the SL distance by a factor (e.g., 2 or 3).
Buy: TP = Entry Price + (SL Distance * 2).
Sell: TP = Entry Price - (SL Distance * 2).
Key Zones: Target the next resistance (for buys) or support (for sells).
Buy: TP at the next ob_highs, fvg_highs, or liq_zone_high.
Sell: TP at the next ob_lows, fvg_lows, or liq_zone_low.
Ichimoku: Use the cloud levels (Senkou Span A/B) as targets.
Buy: TP at senkou_span_a or senkou_span_b (whichever is higher).
Sell: TP at senkou_span_a or senkou_span_b (whichever is lower).
3. Practical Implementation
Since the script does not automatically draw SL/TP, you can:
Calculate them manually: Observe the chart and use the levels mentioned.
Modify the code: Add SL/TP as labels (label.new) at the moment of the signal.
Here’s an example of how to modify the code to display SL and TP based on ATR with a 1:2 risk/reward ratio:
Modified Code (Signals Section)
Find the lines where the signals (trade_buy and trade_sell) are generated and add the following:
pinescript
// Calculate SL and TP based on ATR
atr_sl_mult = 1.5 // Multiplier for SL
atr_tp_mult = 3.0 // Multiplier for TP (1:2 ratio)
sl_distance = atr_smooth * atr_sl_mult
tp_distance = atr_smooth * atr_tp_mult
if trade_buy
entry_price = close
sl_price = entry_price - sl_distance
tp_price = entry_price + tp_distance
label.new(bar_index, low, "Buy: " + str.tostring(math.round(bull_conditions, 1)), color=color.green, textcolor=color.white, style=label.style_label_up, size=size.tiny)
label.new(bar_index, sl_price, "SL: " + str.tostring(math.round(sl_price, 2)), color=color.red, textcolor=color.white, style=label.style_label_down, size=size.tiny)
label.new(bar_index, tp_price, "TP: " + str.tostring(math.round(tp_price, 2)), color=color.blue, textcolor=color.white, style=label.style_label_up, size=size.tiny)
if trade_sell
entry_price = close
sl_price = entry_price + sl_distance
tp_price = entry_price - tp_distance
label.new(bar_index, high, "Sell: " + str.tostring(math.round(bear_conditions, 1)), color=color.red, textcolor=color.white, style=label.style_label_down, size=size.tiny)
label.new(bar_index, sl_price, "SL: " + str.tostring(math.round(sl_price, 2)), color=color.red, textcolor=color.white, style=label.style_label_up, size=size.tiny)
label.new(bar_index, tp_price, "TP: " + str.tostring(math.round(tp_price, 2)), color=color.blue, textcolor=color.white, style=label.style_label_down, size=size.tiny)
Code Explanation
SL: Calculated by subtracting/adding sl_distance to the entry price (close) depending on whether it’s a buy or sell.
TP: Calculated with a double distance (tp_distance) for a 1:2 risk/reward ratio.
Visualization: Labels are added to the chart to display SL (red) and TP (blue).
4. Practical Strategy Without Modifying the Code
If you don’t want to modify the script, follow these steps manually:
Entry: Take the trade_buy or trade_sell signal.
SL: Check the smoothed ATR (atr_smooth) on the chart or calculate a fixed level (e.g., 1.5 times the ATR). Also, review nearby key zones (OB, FVG, VWAP).
TP: Define a target based on the next key zone or multiply the SL distance by 2 or 3.
Example:
Buy at 100, ATR = 2.
SL = 100 - (2 * 1.5) = 97.
TP = 100 + (2 * 3) = 106.
5. Recommendations
Test in Demo: Apply this logic in a demo account to adjust the multipliers (atr_sl_mult, atr_tp_mult) based on the market (forex or crypto).
Combine with Zones: If the ATR-based SL is too wide, use the nearest OB or FVG as a reference.
Risk/Reward Ratio: Adjust the TP based on your tolerance (1:1, 1:2, 1:3)
AI Strat ATR Dinamico + ADX + Trend Adaptivo (No Repaint)Below is a fully self-contained, English-language description of every input, function, and logical block inside the “AI Strat ATR Dinamico + ADX + Trend Adaptivo (No Repaint)” indicator. You can copy and paste this into TradingView’s “Description” field when you publish, without exposing any Pine code.
---
## Indicator Name and Purpose
**Name (Short Title):**
AI Strat Adaptive v3 (NoRepaint)
**Overview:**
This indicator combines multiple technical tools—RSI, EMA, ATR (with a dynamic multiplier), ADX/DI, and an “AI‐style” scoring mechanism—to generate trend-filtered and reversal signals. It also optionally confirms signals on a higher timeframe, dynamically adjusts its sensitivity based on volatility, and plots intrabar stop‐loss (SL) and take‐profit (TP) levels derived from ATR. Special care has been taken to ensure that no signals “repaint” (i.e., once drawn on a closed bar, they never disappear or shift).
---
## 1. Main Inputs
All of the inputs appear in the Settings dialog for the published indicator. Below is a detailed explanation of each input, grouped by logical category.
### A. RSI & EMA Base Parameters
1. **RSI Length (Base)**
* **Input type:** Integer (default 14)
* **Description:** Number of bars used to calculate the Relative Strength Index (RSI). A shorter RSI reacts more quickly to price changes; a longer RSI is smoother.
2. **RSI Overbought Threshold**
* **Input type:** Integer (default 60)
* **Description:** If the RSI value rises above this level, it contributes a “sell” signal component. You can adjust this (e.g., 70) to make your system more conservative.
3. **RSI Oversold Threshold**
* **Input type:** Integer (default 40)
* **Description:** If the RSI falls below this level, it contributes a “buy” signal component. Raising this threshold (e.g., 50) makes the strategy more aggressive in seeking reversals.
4. **EMA Length (Base)**
* **Input type:** Integer (default 20)
* **Description:** Number of bars for the Exponential Moving Average (EMA). A shorter EMA will produce more frequent crossovers, a longer EMA is smoother.
### B. ATR & Volatility Filter Parameters
5. **ATR Length (Base)**
* **Input type:** Integer (default 14)
* **Description:** Number of bars to calculate Average True Range (ATR). The ATR is used both for measuring volatility and for dynamic SL/TP levels.
6. **ATR SMA Length**
* **Input type:** Integer (default 50)
* **Description:** Number of bars to compute a Simple Moving Average of the ATR itself. This gives a baseline of “normal” volatility. If ATR rises significantly above this SMA, the indicator treats the market as “high volatility.”
7. **ATR Multiplier Base**
* **Input type:** Float (default 1.2, step 0.1)
* **Description:** Base multiplier for ATR when filtering for volatility. The actual threshold is computed as `ATR_SMA × (ATR_Multiplier Base) × sqrt(current_ATR / ATR_SMA)`. In other words, the multiplier becomes larger if volatility is rising, and smaller if volatility is falling.
8. **Disable Volatility Filter**
* **Input type:** Boolean (default false)
* **Description:** If enabled (true), the indicator will ignore any volatility‐based filtering, using signals regardless of ATR behavior. If disabled (false), signals only fire when ATR > (ATR\_SMA × dynamic multiplier).
### C. Price-Change & “AI Score” Parameters
9. **Price Change Period (bars)**
* **Input type:** Integer (default 3)
* **Description:** The number of bars back to measure percentage price change. Used to ensure that a “trend” signal is accompanied by a sufficiently positive (for longs) or negative (for shorts) price movement over this many bars.
10. **Base AI Score Threshold**
* **Input type:** Float (default 0.1)
* **Description:** The indicator computes a composite “AI-style” score by combining the RSI signal (overbought/oversold) and an EMA crossover signal. Only if the absolute value of that composite score exceeds this threshold will a trend signal be eligible. Raising it makes signals rarer but (potentially) higher-conviction.
### D. SMA “ICT” Trend Filter Parameters
11. **ICT SMA Long Length (Base)**
* **Input type:** Integer (default 50)
* **Description:** Number of bars for the “long” Simple Moving Average (SMA) used in the internal trend filter. Typically, price must be above this SMA (and ADX must be strong) to confirm an uptrend, or below it (and ADX strong) to confirm a downtrend.
12. **ICT SMA Short1 Length (Base)**
* **Input type:** Integer (default 10)
* **Description:** Secondary “fast” SMA used both for reversal logic (e.g., price crossing above it can count as a bullish reversal) and part of the internal trend confirmation.
13. **ICT SMA Short2 Length (Base)**
* **Input type:** Integer (default 20)
* **Description:** A second “medium” SMA used for reversal triggers (e.g., crossovers or crossunders alongside RSI conditions).
### E. ADX & DI Parameters
14. **Base ADX Length**
* **Input type:** Integer (default 14)
* **Description:** Number of bars for the ADX (Average Directional Index) moving averages, which measure trend strength. The same length is used for +DI and –DI smoothing.
15. **Base ADX Threshold**
* **Input type:** Float (default 25.0, step 0.5)
* **Description:** If ADX > this threshold and +DI > –DI, we consider an uptrend; if ADX > this threshold and –DI > +DI, we consider a downtrend. Raising this value demands stronger trends to qualify.
### F. Sensitivity & Cooldown
16. **Sensitivity (0–1)**
* **Input type:** Float between 0.0 and 1.0 (default 0.5)
* **Description:** A general “mixture” parameter used internally to weight how aggressively the indicator leans into trend versus reversal. In practice, the code uses it to fine-tune exact thresholds for switching between trend and reversal conditions. You can leave it at 0.5 unless you want to bias more heavily toward either regime.
17. **Base Cooldown Bars Between Signals**
* **Input type:** Integer (default 5, min 0)
* **Description:** Once a long or short signal fires, the indicator will wait at least this many bars before allowing a new signal in the same direction. Prevents “signal flipping” on each bar. A higher number forces fewer, more spaced-out entries.
18. **Trend Confirmation Bars**
* **Input type:** Integer (default 3, min 1)
* **Description:** After the directional filters (+DI/–DI cross, price vs. SMA), the indicator still requires that price remains on the same side of the long SMA for at least this many consecutive bars before confirming “trend up” or “trend down.” Larger values smooth out false breakouts but may lag signals.
### G. Higher Timeframe Confirmation
19. **Use Higher Timeframe Confirmation**
* **Input type:** Boolean (default true)
* **Description:** If true, the indicator will request a block of values (SMA, +DI, –DI, ADX) from a higher timeframe (default 60 minutes) and require that the higher timeframe is also in agreement (strong uptrend or strong downtrend) before confirming your current-timeframe trend. This helps filter out lower-timeframe noise.
20. **Higher Timeframe (TF) for Confirmation**
* **Input type:** Timeframe (default “60”)
* **Description:** The chart timeframe (e.g., 5, 15, 60 minutes) whose trend conditions must also be true. It’s sent through a `request.security(..., lookahead=barmerge.lookahead_off)` call so that it never “paints ahead.”
### H. Dynamic TP/SL Parameters
21. **TP as ATR Multiple**
* **Input type:** Float (default 2.0, step 0.1)
* **Description:** When a trade is open, the “take-profit” price is determined by looking at the highest high (for longs) or lowest low (for shorts) observed since entry, and then plotting a cross (“X”) at that level when the trend finally flips. This is purely for display. However, separate from that, this parameter can be adapted if you want a strictly ATR–based TP. In the “Minimal” version, TP is ≈ (highest high) once trend inverts, but you could rewrite it to use `entry_price + ATR×TP_Multiplier`.
22. **SL as ATR Multiple**
* **Input type:** Float (default 1.0, step 0.1)
* **Description:** While in a trade, a trailing SL line is plotted each bar. Its value is always `entry_price ± (ATR × SL_Multiplier)`. When the trend inverts, the SL no longer updates, and you see it on the chart.
### I. Display and Mode Options
23. **Show Debug Lines**
* **Input type:** Boolean (default true)
* **Description:** When enabled, the indicator will plot all intermediate lines—ATR SMA, ATR Threshold, +DI, –DI, ADX (current and HTF), HTF SMA, etc.—so that you can diagnose exactly what’s happening. Turn this off to hide all debug information and only see entry/exit shapes.
24. **Enable Scalping Mode**
* **Input type:** Boolean (default false)
* **Description:** If true, many of the “base” parameters are halved (e.g., RSI length becomes 7 instead of 14, ATR length becomes 7 instead of 14, ADX length becomes 7, etc.), and the ADX threshold is multiplied by 0.8. This makes all oscillators and moving averages more reactive, suited for very short-term (scalping) setups.
---
## 2. Core Calculation Blocks
Below is a high-level description of each logical block (in code order), translated from Pine into conceptual steps.
### A. Adjust Inputs if “Scalping Mode” Is On
If **Scalping Mode** = true, then:
* `RSI_Length` becomes `max(1, round(Base_RSI_Length / 2))`
* `EMA_Length` becomes `max(1, round(Base_EMA_Length / 2))`
* `ATR_Length` becomes `max(1, round(Base_ATR_Length / 2))`
* `Price_Change_Period` becomes `max(1, round(Base_Price_Change_Period / 2))`
* `SMA_Long_Length`, `SMA_Short1_Length`, and `SMA_Short2_Length` are each halved (minimum 1).
* `ADX_Length` = `max(1, round(Base_ADX_Length / 2))`
* `ADX_Threshold` = `Base_ADX_Threshold × 0.8`
* `Cooldown_Bars` = `max(0, round(Base_Cooldown_Bars / 2))`
Otherwise, all adjusted lengths = their base values.
### B. RSI, EMA & “AI Score” on Current Timeframe
1. **Compute RSI:**
* Uses the (possibly adjusted) `RSI_Length`.
* Denote this as `RSI_Value`.
2. **Compute ATR & Its SMA:**
* `ATR_Value` = `ta.atr(ATR_Length)`.
* `ATR_SMA` = `ta.sma(ATR_Value, ATR_SMA_Length)`.
* Then define `Volatility_Increase` = (`ATR_Value > ATR_SMA`).
* If the volatility has increased, the weighting of RSI vs. EMA changes.
3. **Compute Weights:**
* If `Volatility_Increase == true`, then:
* `RSI_Weight = 0.7`
* `EMA_Weight = 0.3`
* Otherwise:
* `RSI_Weight = 0.3`
* `EMA_Weight = 0.7`
4. **RSI Signal Component (`RSI_Sig`):**
* If `RSI_Value > RSI_Overbought`, then `RSI_Sig = –1`.
* Else if `RSI_Value < RSI_Oversold`, then `RSI_Sig = +1`.
* Otherwise, `RSI_Sig = 0`.
5. **EMA Value & Signal Component (`EMA_Sig`):**
* `EMA_Value` = `ta.ema(close, EMA_Length)`.
* `EMA_Sig = +1` if the current close crosses **above** the EMA; `EMA_Sig = –1` if the current close crosses **below** the EMA; else `0`.
6. **Compute Raw “AI Score”:**
$$
Raw\_AI = (RSI\_Sig \times RSI\_Weight)\;+\;(EMA\_Sig \times EMA\_Weight)
$$
Then,
$$
AI\_Score = \frac{Raw\_AI}{(RSI\_Weight + EMA\_Weight)}
$$
(This normalization ensures the score always ranges between –1 and +1 if both weights sum to 1.)
### C. Dynamic ATR Multiplier & Volatility Filter
1. **Volatility Factor:**
$$
Volatility\_Factor = \frac{ATR\_Value}{ATR\_SMA}
$$
2. **Dynamic ATR Multiplier:**
$$
ATR\_Multiplier = ATR\_Multiplier\_Base \times \sqrt{Volatility\_Factor}
$$
3. **High Volatility Condition (`High_Volatility`):**
* If `Disable_Volatility_Filter == true`, then treat `High_Volatility = true` always.
* Else, `High_Volatility = (ATR_Value > ATR_SMA × ATR_Multiplier)`.
### D. Price Change Percentage
* **Compute Price Change:**
$$
Price\_Change = \frac{(Close - Close )}{Close } \times 100
$$
* This is the percent return from `Price_Change_Period` bars ago to now.
* For a valid long‐trend signal, we require `Price_Change > 0`; for a short trend, `Price_Change < 0`.
### E. Local SMAs for Trend/Reversal Filters
* `SMA_Close_Long` = `ta.sma(close, SMA_Long_Length)`.
* `SMA_Close_Short1` = `ta.sma(close, SMA_Short1_Length)`.
* `SMA_Close_Short2` = `ta.sma(close, SMA_Short2_Length)`.
These three SMAs help define the “local trend” and reversal breakout points:
* **Primary Trend Filter:**
* Price must be above `SMA_Close_Long` for an uptrend filter, or below `SMA_Close_Long` for a downtrend filter.
* **Reversal Filter:**
* A bullish reversal is detected if **(RSI < Oversold AND close crosses above EMA)** OR **(RSI < Oversold AND close crosses above SMA\_Close\_Short1)**.
* A bearish reversal is detected if **(RSI > Overbought AND close crosses below EMA)** OR **(RSI > Overbought AND close crosses below SMA\_Close\_Short1)**.
### F. Manual +DI, –DI & ADX on Current Timeframe
Instead of relying on the built-in `ta.adx`, the script calculates DI and ADX manually. This makes it easier to replicate the exact logic on a higher timeframe via `request.security`. The steps are:
1. **Directional Movement (DM) Components:**
* `Up_Move` = `high – high `
* `Down_Move` = `low – low`
* `Plus_DM` = `Up_Move` if (`Up_Move > Down_Move` AND `Up_Move > 0`), else `0`
* `Minus_DM` = `Down_Move` if (`Down_Move > Up_Move` AND `Down_Move > 0`), else `0`
2. **True Range (TR) Components:**
* `TR1` = `high – low`
* `TR2` = `abs(high – close )`
* `TR3` = `abs(low – close )`
* `True_Range` = `max(TR1, TR2, TR3)`
3. **Smoothed Averages (RMA):**
* `Sm_TR` = `ta.rma(True_Range, ADX_Length)`
* `Sm_Plus` = `ta.rma(Plus_DM, ADX_Length)`
* `Sm_Minus`= `ta.rma(Minus_DM, ADX_Length)`
4. **Compute DI%:**
$$
Plus\_DI = \frac{Sm\_Plus}{Sm\_TR} \times 100,\quad
Minus\_DI = \frac{Sm\_Minus}{Sm\_TR} \times 100
$$
5. **DX and ADX:**
$$
DX = \frac{|Plus\_DI - Minus\_DI|}{Plus\_DI + Minus\_DI} \times 100,\quad
ADX = ta.rma(DX, ADX_Length)
$$
These values are referred to as `(plus_di, minus_di, adx_val)` for the current timeframe.
---
## 3. Higher Timeframe (HTF) Confirmation Function
If **Use Higher Timeframe Confirmation** is enabled, the script calls a single helper (Pine) function `f_htf` with two parameters: the ADX length and the SMA length (both taken from the “base” or “scaled” values). Internally, `f_htf` simply reruns the manual DI/ADX logic (same as above) on the higher timeframe’s bar data, and also includes that timeframe’s closing price and its SMA for trend comparison.
* **Request.Security Call:**
```
= request.security(
syminfo.tickerid,
higher_tf,
f_htf(adx_length, sma_long_len),
lookahead=barmerge.lookahead_off
)
```
* `lookahead=barmerge.lookahead_off` ensures that no HTF value “paints” early; you always see only confirmed HTF bars.
* The returned tuple provides:
1. `ht_close` = HTF closing price
2. `ht_sma` = HTF SMA of length `sma_long_len`
3. `ht_pdi` = HTF +DI percentage
4. `ht_mdi` = HTF –DI percentage
5. `ht_adx` = HTF ADX value
---
## 4. Trend & Reversal Filters (Current & HTF)
### A. Current-Timeframe Trend Filter
1. **Uptrend\_Basic (Current TF)**
$$
(plus\_di > minus\_di)\;\land\;(adx\_val > ADX\_Threshold)\;\land\;(close > SMA\_Close\_Long)
$$
2. **Downtrend\_Basic (Current TF)**
$$
(minus\_di > plus\_di)\;\land\;(adx\_val > ADX\_Threshold)\;\land\;(close < SMA\_Close\_Long)
$$
3. **Trend Confirmation by Bars:**
* `Bars_Since_Below` = number of bars since `close <= SMA_Close_Long`.
* `Bars_Since_Above` = number of bars since `close >= SMA_Close_Long`.
* If `Uptrend_Basic == true` AND `Bars_Since_Below ≥ Trend_Confirmation_Bars` → mark `Uptrend_Confirm = true`.
* If `Downtrend_Basic == true` AND `Bars_Since_Above ≥ Trend_Confirmation_Bars` → mark `Downtrend_Confirm = true`.
### B. Reversal Filters (Current TF)
1. **Bullish Reversal (`Rev_Bullish`):**
* If `(RSI < RSI_Oversold AND close crosses above EMA_Value)` OR
`(RSI < RSI_Oversold AND close crosses above SMA_Close_Short1)`
→ then `Rev_Bullish = true`.
2. **Bearish Reversal (`Rev_Bearish`):**
* If `(RSI > RSI_Overbought AND close crosses below EMA_Value)` OR
`(RSI > RSI_Overbought AND close crosses below SMA_Close_Short1)`
→ then `Rev_Bearish = true`.
### C. Higher-Timeframe Trend Filter (HTF)
1. **HTF Uptrend (`HT_Uptrend`):**
$$
(ht\_pdi > ht\_mdi)\;\land\;(ht\_adx > ADX\_Threshold)\;\land\;(ht\_close > ht\_sma)
$$
2. **HTF Downtrend (`HT_Downtrend`):**
$$
(ht\_mdi > ht\_pdi)\;\land\;(ht\_adx > ADX\_Threshold)\;\land\;(ht\_close < ht\_sma)
$$
3. **Combine Current & HTF:**
* If **Use\_HTF\_Confirmation == true**, then:
* `Uptrend_Confirm := Uptrend_Confirm AND HT_Uptrend`
* `Downtrend_Confirm := Downtrend_Confirm AND HT_Downtrend`
* Otherwise, just use the current timeframe’s `Uptrend_Confirm` and `Downtrend_Confirm`.
4. **Define `CurrentTrend` (Integer):**
* `CurrentTrend = +1` if `Uptrend_Confirm == true`.
* `CurrentTrend = –1` if `Downtrend_Confirm == true`.
* Otherwise, `CurrentTrend = 0`.
5. **Reset “One Trade Per Trend”:**
* There is a persistent variable `LastTradeTrend`.
* Every time `CurrentTrend` flips (i.e., `CurrentTrend != CurrentTrend `), the code sets `LastTradeTrend := 0`.
* That allows one new entry once the detected trend has changed.
---
## 5. One‐Time “Cooldown” Logic
* **`LastSignalBar`**
* A persistent integer (initially undefined).
* After each confirmed long or short entry, `LastSignalBar` is set to the bar index where that signal fired.
* **`Bars_Since_Signal`**
* If `LastSignalBar` is undefined, treat as a very large number (so that initial signals are always allowed).
* Otherwise, `Bars_Since_Signal = bar_index – LastSignalBar`.
* **Cooldown Check:**
* A new long (or short) can only be generated if `(Bars_Since_Signal > Signal_Cooldown)`.
* This prevents multiple signals in rapid succession.
---
## 6. Entry Conditions (No Repaint)
All of the conditions below are calculated “intrabar,” but the script only actually registers a **signal** on **bar close** (`barstate.isconfirmed`) so that signals never repaint.
### A. Trend‐Based “Raw” Conditions
1. **Trend\_Long\_Raw:**
$$
(AI\_Score > AI\_Score\_Threshold)\;\land\;Uptrend\_Confirm\;\land\;High\_Volatility\;\land\;(Price\_Change > 0)
$$
2. **Trend\_Short\_Raw:**
$$
(AI\_Score < -AI\_Score\_Threshold)\;\land\;Downtrend\_Confirm\;\land\;High\_Volatility\;\land\;(Price\_Change < 0)
$$
### B. Reversal “Raw” Conditions
1. **Rev\_Long\_Raw:**
$$
Rev\_Bullish\;\land\;(CurrentTrend \neq +1)
$$
2. **Rev\_Short\_Raw:**
$$
Rev\_Bearish\;\land\;(CurrentTrend \neq -1)
$$
### C. Combine Raw Signals
* `Raw_Long = Trend_Long_Raw OR Rev_Long_Raw`.
* `Raw_Short = Trend_Short_Raw OR Rev_Short_Raw`.
### D. Confirmed Long/Short Signal Flags
On each new bar **close** (`barstate.isconfirmed == true`):
* **Long\_Signal\_Confirmed** can fire if:
1. `Raw_Long == true`
2. `LastTradeTrend != +1` (we haven’t already taken a long in this same trend)
3. `Bars_Since_Signal > Signal_Cooldown`
If all three hold, then on this bar close the code sets:
* `Long_Signal = true`
* `LastTradeTrend := +1`
* `LastSignalBar := bar_index`
Otherwise, `Long_Signal := false` on this bar.
* **Short\_Signal\_Confirmed** works the same way but with `Raw_Short`, `LastTradeTrend != -1`, etc.
If triggered, it sets `Short_Signal = true`, `LastTradeTrend := -1`, and `LastSignalBar := bar_index`. Otherwise `Short_Signal := false`.
* **Important:** If the bar is still forming (`else` branch of `barstate.isconfirmed`), then both `Long_Signal` and `Short_Signal` are forced to `false`. This guarantees that no shape or alert appears until the bar actually closes.
---
## 7. Plotting Entry/Exit Shapes
1. **Trend Long Signal (Triangle Up)**
* Condition: `Long_Signal == true` **AND** `Trend_Long_Raw == true`.
* Appearance: A small, semi-transparent lime green triangle drawn **below** the bar.
2. **Trend Short Signal (Triangle Down)**
* Condition: `Short_Signal == true` **AND** `Trend_Short_Raw == true`.
* Appearance: A small, semi-transparent maroon triangle drawn **above** the bar.
3. **Reversal Long Signal (Circle)**
* Condition: `Long_Signal == true` **AND** `Rev_Long_Raw == true`.
* Appearance: A tiny, more transparent green circle drawn **below** the bar.
4. **Reversal Short Signal (Circle)**
* Condition: `Short_Signal == true` **AND** `Rev_Short_Raw == true`.
* Appearance: A tiny, more transparent red circle drawn **above** the bar.
Since `Long_Signal` and `Short_Signal` only ever become true at bar close, these shapes are never repainted or removed once drawn.
---
## 8. Unified Alert Message
* As soon as a new bar closes with either `Long_Signal` or `Short_Signal == true`, an alert message is sent:
* If `Long_Signal`, then `alert_msg = "action=BUY"`.
* If `Short_Signal`, then `alert_msg = "action=SELL"`.
* If neither, `alert_msg = ""` (no alert).
* The code calls `alert(alert_msg, freq=alert.freq_once_per_bar)` only if `barstate.isconfirmed` and `alert_msg` is non‐empty. This ensures exactly one alert per confirmed bar, no intrabar pops.
---
## 9. Dynamic TP/SL Logic (Minimal Implementation)
Once a long or short position is “open,” the script tracks these variables:
1. **Persistent Flags and Prices** (all persist between bars until reset):
* `InLong` (Boolean)
* `InShort` (Boolean)
* `Long_Max` (Float)
* `Short_Min` (Float)
* `Entry_Price` (Float)
2. **On Bar Close:**
* If `Long_Signal == true` →
* Set `InLong := true`,
* `Entry_Price := close` of that bar,
* `Long_Max := high ` (last bar’s high, so that we’re not using “future” data).
* If `Short_Signal == true` →
* Set `InShort := true`,
* `Entry_Price := close`,
* `Short_Min := low `.
3. **While `InLong == true`:**
* Continuously update `Long_Max = max(Long_Max, current high)` on each bar (intrabar, but finalized each close).
* Compute a dynamic SL:
$$
SL_{Long} = Entry\_Price - (ATR \times SL\_ATR\_Multiplier).
$$
* If **current trend** flips to non-uptrend (`CurrentTrend != +1`), mark `ExitLong = true`.
* Then the routine plots `TP_Long = Long_Max` as a cross (“X”) at that level.
* Set `InLong := false` so that no further changes to `Long_Max` or `Entry_Price` happen on future bars.
4. **While `InShort == true`:**
* Continuously update `Short_Min = min(Short_Min, current low)`.
* Compute a dynamic SL:
$$
SL_{Short} = Entry\_Price + (ATR \times SL\_ATR\_Multiplier).
$$
* If trend flips to non-downtrend (`CurrentTrend != –1`), mark `ExitShort = true`.
* Then the routine plots `TP_Short = Short_Min`.
* Set `InShort := false` to freeze those values.
5. **Plotting TP/SL if “Show Debug” is On:**
* **TP Shapes:**
* When `ExitLong == true`, plot a solid lime “X” at `TP_Long` (highest high).
* When `ExitShort == true`, plot a solid maroon “X” at `TP_Short` (lowest low).
* **SL Lines:**
* If still `InLong`, draw a thin red line at `SL_Long` on each bar.
* If still `InShort`, draw a thin green line at `SL_Short`.
Thus, your charts visually show the highest‐high take-profit cross for longs, the lowest-low take-profit cross for shorts, and a continuously updating trailing SL until the trend flips. Because all of this is triggered on confirmed bars, nothing “jumps around” after the fact.
---
## 10. Debug‐Only Plot Lines (When Enabled)
When **Show Debug Lines** = true, the indicator will also plot:
1. **ATR SMA (Orange):**
* The simple moving average of ATR over `ATR_SMA_Length`.
2. **ATR Threshold (Yellow):**
* `ATR_SMA × ATR_Multiplier` (the dynamically scaled threshold).
3. **+DI & –DI (Current TF):**
* +DI plotted as a green line, –DI plotted as a red line (opacity \~70%).
4. **ADX (Current TF, Blue):**
* A blue line for the present timeframe’s ADX.
5. **ADX Threshold (Gray):**
* A horizontal gray line showing `ADX_Threshold`.
6. **+DI & –DI (HTF, Darker Colors):**
* If HTF confirmation is on, “HTF +DI” is a greener but more transparent line; “HTF –DI” is a redder but more transparent line.
7. **ADX (HTF, Blue but Transparent):**
* HTF ADX plotted in blue (high transparency).
8. **HTF SMA (Orange, Transparent):**
* The higher timeframe’s SMA (same length as `SMA_Long_Length`), drawn in fainter orange.
9. **Volatility Zone Fill (Yellow Tinted Area):**
* Fills the area between `ATR_SMA` and `ATR_SMA × ATR_Multiplier`.
* Indicates “normal” versus “high‐volatility” regimes.
These debug lines are purely visual aids. Disable them if you want a cleaner chart.
---
## 11. Putting It All Together — Step-By-Step Flow
1. **Read Inputs** (RSI lengths, EMA length, ATR settings, etc.).
2. **Optionally Halve All Lengths** if “Scalping Mode” is checked.
3. **Calculate Current TF Indicators:**
* RSI, ATR, ATR\_SMA, EMA, price change, various SMAs, DI/ADX.
4. **Compute “AI Score”** (weighted sum of RSI and EMA signals).
5. **Compute Dynamic ATR Multiplier** and decide if “High Volatility” is true.
6. **Compute Raw Trend/Reversal Conditions** on the current timeframe (without triggering yet).
7. **Fetch HTF Values** in one `request.security` call (SMAs, DI/ADX).
8. **Combine Current & HTF Trend Filters** to confirm `Uptrend_Confirm` or `Downtrend_Confirm`.
9. **Check Reversal Conditions** (price crossing EMA or SMA short, in overbought/oversold zones).
10. **Enforce “One Trade Per Trend”** (clear `LastTradeTrend` whenever `CurrentTrend` flips).
11. **Enforce Cooldown** (must wait at least `Signal_Cooldown` bars since the prior signal).
12. **On Bar Close:**
* If `Raw_Long` AND not already in a long trend AND cooldown met, then fire `Long_Signal`.
* Else if `Raw_Short` AND not already in a short trend AND cooldown met, then fire `Short_Signal`.
* Otherwise, no new signal on this bar.
13. **Plot Long/Short Entry Shapes** according to whether it was a Trend signal or a Reversal signal.
14. **Send Alert** (“action=BUY” or “action=SELL”) exactly once per confirmed bar.
15. **If New Long/Short Signal, Set `InLong`/`InShort`, Record Entry Price, Initialize `Long_Max`/`Short_Min`.**
16. **While `InLong` is true:** Update `Long_Max = max(previous Long_Max, current high)`. Compute `SL_Long`. If the current trend flips (no longer uptrend), set `ExitLong = true`, plot a “TP X,” and close the position logic.
17. **While `InShort` is true:** Similarly update `Short_Min`, compute `SL_Short`, and if trend flips, set `ExitShort = true`, plot a “TP X,” and close the position logic.
18. **Optionally Display Debug Lines** (ATR SMA, ATR threshold, DI/ADX, HTF DI/ADX, etc.).
---
## 12. How to Use in TradingView Community
When you publish this indicator to the TradingView community—choosing “Protected” or “Invite-only” visibility—you can paste the above description into the “Description” field. Users will see exactly what each input does, how signals are generated, and what the various plotted lines represent, **without ever seeing the script source**. In this way, the code itself remains hidden but the logic is fully documented.
1. **Go to “Create New Indicator”** on TradingView.
2. **Paste Your Pine Code** (the full indicator script) in the Pine editor and save it.
3. **Set Visibility = Protected** (or Invite-only).
4. **In the “Description” Text Box, paste the entirety of this document** (steps 1–11).
5. **Click “Publish Script.”**
Users who view your indicator will see its name (“AI Strat Adaptive v3 (NoRepaint)”), a list of all inputs (with default values), and the detailed English description above. They can then load it on any chart, adjust inputs, and see the plotted signals, TP/SL lines, and optional debug overlays—without accessing the underlying Pine code.
---
### Summary of Key Points
* **RSI, EMA, ATR, DI/ADX, and “AI Score”** work together to define “trend vs. reversal.”
* **Dynamic volatility filter** uses ATR and ATR\_SMA to adapt the weighting of RSI vs. EMA and decide whether “volatility is high enough” to permit a trend trade.
* **One trade per detected trend** and a **cooldown period** prevent over‐trading.
* **Higher timeframe confirmation** (optional) further filters out noise.
* **No-repaint logic**:
* All signals only appear at bar close (`barstate.isconfirmed`).
* HTF values are fetched with `lookahead=barmerge.lookahead_off`.
* **Entry shapes** (triangles and circles) clearly mark trend vs. reversal entries.
* **Dynamic TP/SL**: highest‐high (or lowest‐low) since entry is used as TP, ATR×multiplier as SL.
* **Debug mode** (optional) shows every intermediate line for full transparency.
Use this description verbatim (or adapt it slightly for your personal style) when publishing. That way, your community sees exactly how each component works—inputs, functions, filters—while the Pine source code remains private.
ORB Dashboard for the TFLX Strategy# ORB Range/ATR Dashboard - Technical Indicator Description
## Main Function
This indicator analyzes Opening Range Breakout (ORB) patterns by calculating a defined time period and its relation to historical volatility. The indicator combines multiple technical analysis methods and presents results in a configurable dashboard format.
**Purpose:** This indicator automates the manual calculation steps of the TFLX analysis methodology, providing real-time computation of volatility ratios, trend filters, and risk management parameters that would otherwise require manual calculation and monitoring.
## Requirements and Limitations
**Additional Indicator Required:** This dashboard indicator works in conjunction with a separate ORB range visualization indicator that displays the actual high/low range levels on the chart. The dashboard provides analysis and calculations, while the range indicator provides visual reference points.
**Important Notice:** This indicator serves as an analytical tool and calculation assistant for the TFLX methodology. It does not execute trades automatically but provides data analysis to support manual decision-making processes.
## TFLX Analysis Methodology Framework
### Core Analysis Rules (Discretionary Implementation)
**Primary Conditions:**
- Market position relative to neutral zones (BB analysis)
- Volatility range between 15-60% of ATR(3)
- News event screening (high-impact economic releases)
- Market session timing constraints (before calculated session end)
- US Bank Holiday considerations
**Exception Conditions:**
- High-impact news with rebreak patterns
- Reversal patterns during neutral market conditions
### Technical Specifications of the Methodology
**Range Definition:**
- Time Period: First 15 minutes after market open
- Measurement: High-Low range calculation
- Breakout Trigger: 5-minute close outside established range
**Volatility Analysis:**
- Formula: (Range Points / ATR(3) Previous Day) × 100
- Threshold Ranges:
- <15%: Below minimum threshold
- 15-20%: Low volatility range
- 25-30%: Moderate volatility range
- 30-40%: Good volatility range
- 40-50%: High volatility range
- 50-60%: Very high volatility range
- >60%: Above maximum threshold
**News Event Categories:**
- Major Events: NFP, CPI, PPI, FOMC releases
- Minor Events: All significant economic releases during market hours
- Impact Assessment: Market reaction analysis framework
**Trend Analysis Framework (1H Bollinger Bands):**
- Base Calculation: EMA(200) with standard deviation bands
- Reference Points: Market Open, ORB Close, Trigger Bar
- Decision Logic: 2 out of 3 reference points determine bias
- Zone Classifications:
- Within 0.5 multiplier: Neutral zone
- Within 1.5 multiplier: Directional bias zone
- Outside 1.5 multiplier: Strong directional zone
**Timing Constraints:**
- Session Window: Market open to calculated session end (typically 4.5 hours)
- Retracement Analysis: Maximum adverse movement before breakeven or stop loss
**Manual Calculation Process (Automated by Indicator):**
1. Measure range in points using chart measurement tools
2. Switch to daily timeframe
3. Set ATR period to 3
4. Extract previous day's ATR value
5. Calculate: (Range Points ÷ ATR Value) × 100
6. Apply percentage thresholds for analysis
## Core Components and Calculation Methods
### 1. Opening Range Calculation
**Data Source:** High/Low/Close prices of current timeframe
**Calculation:**
- Defines a configurable time period (default: 15 minutes)
- Collects during this period: `range_high = max(high)` and `range_low = min(low)`
- Calculates Range Size: `range_size = range_high - range_low`
- Stores the last close price of the period: `final_orb_close`
### 2. ATR (Average True Range) Integration
**Data Source:** Daily True Range values
**Calculation:**
```
daily_atr = ta.atr(length) // Default 3 periods
atr_yesterday = daily_atr // Previous trading day
```
**Available Methods:** RMA (default), SMA, EMA, WMA
### 3. Volatility Ratio Calculation
**Formula:**
```
ratio = (range_size / atr_yesterday) * 100
```
**Purpose:** Normalization of current range against historical volatility
**Configurable Parameters:** Min/Max thresholds (default: 15-60%)
### 4. Bollinger Bands Integration (1H Timeframe)
**Data Source:** 1-hour chart data via `request.security()`
**Calculation:**
```
bb_ema = ta.ema(close, 200) // 1H timeframe
bb_std = ta.stdev(close, 200) // 1H timeframe
bb_upper = bb_ema + (bb_std * multiplier)
bb_lower = bb_ema - (bb_std * multiplier)
```
**Configurable Multipliers:**
- Neutral Zone: 0.5x standard deviation
- Strong Zone: 1.5x standard deviation
### 5. Trend Filter System (2/3 Method)
**Components:**
1. **NY Open Signal:** Compares 1H open price with BB levels
2. **ORB Close Signal:** Compares final ORB close with BB levels
3. **Trigger Signal:** Compares breakout price with BB levels
**Logic:**
```
if (bullish_signals >= 2) → "BULLISH"
if (bearish_signals >= 2) → "BEARISH"
else → "MIXED" or "NO TREND"
```
## Component Interaction
### Trade Signal Generation
**Algorithm:**
```
trade_allowed = (orb_ratio >= min_threshold AND orb_ratio <= max_threshold)
AND (bb_signal != "NEUTRAL")
AND (trend_filter_result contains "BULLISH" OR "BEARISH")
```
### Risk Management Calculation
**Entry Points:**
- Long Entry: `range_high`
- Short Entry: `range_low`
**Stop Loss Calculation:**
```
sl_level = range_low + (range_size * sl_position_percent / 100)
```
**Take Profit Calculation:**
```
tp_distance = range_size * tp_factor_percent / 100
long_tp = long_entry + tp_distance
short_tp = short_entry - tp_distance
```
**Position Sizing (CFD-optimized):**
```
risk_per_contract = avg_risk_points * contract_value * lot_size
max_contracts = max_risk_amount / risk_per_contract
```
**Margin Calculation (CFDs):**
```
position_value = total_units * entry_price
margin_required = position_value / leverage
```
## Dashboard Elements
### 1. Volatility Filter Section
- **ORB Range:** Current range in points
- **ATR Previous:** Yesterday's ATR values
- **ORB Ratio:** Calculated ratio with color coding
### 2. Trend Filter Section
- **NY Open vs BB:** Position of 1H open relative to BB
- **ORB Close vs BB:** Position of ORB close relative to BB
- **Trigger Bar vs BB:** Position of breakout price relative to BB
- **Trend Result:** Summary of 2/3 filter
### 3. Risk Management Section (optional)
- **R/R Ratio:** Calculated from TP/SL distances
- **Risk per Lot:** Based on instrument type
- **Max Lot Packages:** Automatic position sizing calculation
- **Margin Required:** For CFD instruments
### 4. Journal Section (optional)
- **Breakout Timing:** Categorization by bars (1-3, 4-6, 7-9, 10-12, 13+)
- **Direction Tracking:** Bullish/Bearish breakout direction
- **Position Analysis:** Distance of breakout to ORB range
## Automatic Instrument Detection
**CFD/Index Treatment:**
```
if (syminfo.type == "cfd" OR syminfo.type == "index")
contract_value = 1.0 * cfd_lot_size
```
**Forex Treatment:**
```
if (syminfo.type == "forex")
contract_value = syminfo.pointvalue * cfd_lot_size
```
**Futures/Stocks:**
```
contract_value = syminfo.pointvalue
```
## Timezone Handling
- All time calculations based on configurable timezone
- Session End Time: ORB Start + 4.5 hours
- Automatic overflow handling for 24h format
## Alert System
**ORB Formation Alert:**
- Triggered upon completion of ORB period
- Includes: Range size, high/low values
**Breakout Alert:**
- Triggered on close price outside ORB range
- Includes: Direction, trade status based on filters
## Configuration Options
- **ORB Period:** Start/end time in hours/minutes
- **ATR Parameters:** Period and calculation method
- **Volatility Thresholds:** Min/max percentage limits
- **BB Parameters:** Period and multipliers
- **Risk Management:** Risk amount, SL/TP positions
- **Dashboard Layout:** Position, size, colors, visibility
## Data Integrity
- State variables with `var` declaration for persistence
- Daily reset of all relevant variables
- Lookahead bias prevention through `barmerge.lookahead_off`
- Multi-timeframe safety through `request.security()` functions
This technical implementation provides a comprehensive analysis framework for Opening Range Breakout patterns with integrated volatility, trend, and risk management components.
Katz Exploding PowerBand FilterUnderstanding the Katz Exploding PowerBand Filter (EPBF) v2.4
1. Indicator Overview
The Katz Exploding PowerBand Filter (EPBF) is an advanced technical indicator designed to identify moments of expanding bullish or bearish momentum, often referred to as "power." It operates as a standalone oscillator in a separate pane below the main price chart.
Its primary goal is to measure underlying market strength by calculating custom "Bull" and "Bear" power components. These components are then filtered through a versatile moving average and a dual signal line system to generate clear entry and exit signals. This indicator is not a simple momentum oscillator; it uses a unique calculation based on exponential envelopes of both price and squared price to derive its values.
2. On-Chart Lines and Components
The indicator pane consists of five main lines:
Bullish Component (Thick Green/Blue/Yellow/Gray Line): This is the core of the indicator. It represents the calculated bullish "power" or momentum in the market.
Bright Green: Indicates a strong, active long signal condition.
Blue: Shows the bull component is above the MA filter, but the filter itself is still pointing down—a potential sign of a reversal or weakening downtrend.
Yellow: A warning sign that bullish power is weakening and has fallen below the primary signal lines.
Gray: Represents neutral or insignificant bullish power.
Bearish Component (Thick Red/Purple/Yellow/Gray Line): This line represents the calculated bearish "power" or downward momentum.
Bright Red: Indicates a strong, active short signal condition.
Purple: Shows the bear component is above the MA filter, but the filter itself is still pointing down—a sign of potential trend continuation.
Yellow: A warning sign that bearish power is weakening.
Gray: Represents neutral or insignificant bearish power.
MA Filter (Purple Line): This is the main filter, calculated using the moving average type and length you select in the settings (e.g., HullMA, EMA). The Bull and Bear components are compared against this line to determine the underlying trend bias.
Signal Line 1 (Orange Line): A fast Exponential Moving Average (EMA) of the stronger power component. It acts as the first level of dynamic support or resistance for the power lines.
Signal Line 2 (Lime/Gray Line): A slower EMA that acts as a confirmation filter.
Lime Green: The line turns lime when it is rising and the faster Signal Line 1 is above it, indicating a confirmed bullish trend in momentum.
Gray: Indicates a neutral or bearish momentum trend.
3. On-Chart Symbols and Their Meanings
Various characters are plotted at the bottom of the indicator pane to provide clear, actionable signals.
L (Pre-Long Signal): The first sign of a potential long entry. It appears when the Bullish Component rises and crosses above both signal lines for the first time.
S (Pre-Short Signal): The first sign of a potential short entry. It appears when the Bearish Component rises and crosses above both signal lines for the first time.
▲ (Post-Long Signal): A stronger confirmation for a long entry. It appears with the 'L' signal only if the momentum trend is also confirmed bullish (i.e., the slower Signal Line 2 is lime green).
▼ (Post-Short Signal): A stronger confirmation for a short entry. It appears with the 'S' signal only if the momentum trend is confirmed bullish.
Exit / Take-Profit Symbols:
These symbols appear when a power component crosses below a line, suggesting that momentum is fading and it may be time to take profit.
⚠️ (Exit Signal 1): The Bull/Bear component has crossed below the main MA Filter. This is the first and most sensitive take-profit signal.
☣️ (Exit Signal 2): The Bull/Bear component has crossed below the faster Signal Line 1. This is a moderate take-profit signal.
🚼 (Exit Signal 3): The Bull/Bear component has crossed below the slower Signal Line 2. This is the slowest take-profit signal, suggesting the trend is more definitively exhausted.
4. Trading Strategy and Rules
Long Entry Rules:
Initial Signal: Wait for an L to appear at the bottom of the indicator. This confirms that bullish power is expanding.
Confirmation (Recommended): For a higher-probability trade, wait for a green ▲ symbol to appear. This confirms the underlying momentum trend aligns with the signal.
Entry: Enter a long (buy) position on the opening of the next candle after the signal appears.
Short Entry Rules:
Initial Signal: Wait for an S to appear at the bottom of the indicator. This confirms that bearish power is expanding.
Confirmation (Recommended): For a higher-probability trade, wait for a maroon ▼ symbol to appear. This confirms the underlying momentum trend aligns with the signal.
Entry: Enter a short (sell) position on the opening of the next candle after the signal appears.
Take Profit (TP) Rules:
The indicator provides three levels of take-profit signals. You can choose to exit your entire position or scale out at each level.
For a long trade, exit when you see ⚠️, ☣️, or 🚼 appear below the Bullish Component.
For a short trade, exit when you see ⚠️, ☣️, or 🚼 appear below the Bearish Component.
Stop Loss (SL) Rules:
The indicator does not provide an explicit stop loss. You must use your own risk management rules. Common methods include:
Swing High/Low: For a long position, place your stop loss below the most recent significant swing low on the price chart. For a short position, place it above the most recent swing high.
ATR-Based: Use an Average True Range (ATR) indicator to set a volatility-based stop loss.
Fixed Percentage: Risk a fixed percentage (e.g., 1-2%) of your account on the trade.
5. Disclaimer
This indicator is a tool for technical analysis and should not be considered financial advice. All trading involves significant risk, and past performance is not indicative of future results. The signals generated by this indicator are probabilistic and can result in losing trades. Always use proper risk management, such as setting a stop loss, and never risk more than you are willing to lose. It is recommended to backtest this indicator and use it in conjunction with other forms of analysis before trading with real capital. The indicator should only be used for educational purposes.
EAOBS by MIGVersion 1
1. Strategy Overview Objective: Capitalize on breakout movements in Ethereum (ETH) price after the Asian open pre-market session (7:00 PM–7:59 PM EST) by identifying high and low prices during the session and trading breakouts above the high or below the low.
Timeframe: Any (script is timeframe-agnostic, but align with session timing).
Session: Pre-market session (7:00 PM–7:59 PM EST, adjustable for other time zones, e.g., 12:00 AM–12:59 AM GMT).
Risk-Reward Ratios (R:R): Targets range from 1.2:1 to 5.2:1, with a fixed stop loss.
Instrument: Ethereum (ETH/USD or ETH-based pairs).
2. Market Setup Session Monitoring: Monitor ETH price action during the pre-market session (7:00 PM–7:59 PM EST), which aligns with the Asian market open (e.g., 9:00 AM–9:59 AM JST).
The script tracks the highest high and lowest low during this session.
Breakout Triggers: Buy Signal: Price breaks above the session’s high after the session ends (7:59 PM EST).
Sell Signal: Price breaks below the session’s low after the session ends.
Visualization: The session is highlighted on the chart with a white background.
Horizontal lines are drawn at the session’s high and low, extended for 30 bars, along with take-profit (TP) and stop-loss (SL) levels.
3. Entry Rules Long (Buy) Entry: Enter a long position when the price breaks above the session’s high price after 7:59 PM EST.
Entry price: Just above the session high (e.g., add a small buffer, like 0.1–0.5%, to avoid false breakouts, depending on volatility).
Short (Sell) Entry: Enter a short position when the price breaks below the session’s low price after 7:59 PM EST.
Entry price: Just below the session low (e.g., subtract a small buffer, like 0.1–0.5%).
Confirmation: Use a candlestick close above/below the breakout level to confirm the entry.
Optionally, add volume confirmation or a momentum indicator (e.g., RSI or MACD) to filter out weak breakouts.
Position Size: Calculate position size based on risk tolerance (e.g., 1–2% of account per trade).
Risk is determined by the stop-loss distance (10 points, as defined in the script).
4. Exit Rules Take-Profit Levels (in points, based on script inputs):TP1: 12 points (1.2:1 R:R).
TP2: 22 points (2.2:1 R:R).
TP3: 32 points (3.2:1 R:R).
TP4: 42 points (4.2:1 R:R).
TP5: 52 points (5.2:1 R:R).
Example for Long: If session high is 3000, TP levels are 3012, 3022, 3032, 3042, 3052.
Example for Short: If session low is 2950, TP levels are 2938, 2928, 2918, 2908, 2898.
Strategy: Scale out of the position (e.g., close 20% at TP1, 20% at TP2, etc.) or take full profit at a preferred TP level based on market conditions.
Stop-Loss: Fixed at 10 points from the entry.
Long SL: Session high - 10 points (e.g., entry at 3000, SL at 2990).
Short SL: Session low + 10 points (e.g., entry at 2950, SL at 2960).
Trailing Stop (Optional):After reaching TP2 or TP3, consider trailing the stop to lock in profits (e.g., trail by 10–15 points below the current price).
5. Risk Management per Trade: Limit risk to 1–2% of your trading account per trade.
Calculate position size: Account Size × Risk % ÷ (Stop-Loss Distance × ETH Price per Point).
Example: $10,000 account, 1% risk = $100. If SL = 10 points and 1 point = $1, position size = $100 ÷ 10 = 0.1 ETH.
Daily Risk Limit: Cap daily losses at 3–5% of the account to avoid overtrading.
Maximum Exposure: Avoid taking both long and short positions simultaneously unless using separate accounts or strategies.
Volatility Consideration: Adjust position size during high-volatility periods (e.g., major news events like Ethereum upgrades or macroeconomic announcements).
6. Trade Management Monitoring :Watch for breakouts after 7:59 PM EST.
Monitor price action near TP and SL levels using alerts or manual checks.
Trade Duration: Breakout lines extend for 30 bars (script parameter). Close trades if no TP or SL is hit within this period, or reassess based on market conditions.
Adjustments: If the market shows strong momentum, consider holding beyond TP5 with a trailing stop.
If the breakout fails (e.g., price reverses before TP1), exit early to minimize losses.
7. Additional Considerations Market Conditions: The 7:00 PM–7:59 PM EST session aligns with the Asian market open (e.g., Tokyo Stock Exchange open at 9:00 AM JST), which may introduce higher volatility due to Asian trading activity.
Avoid trading during low-liquidity periods or extreme volatility (e.g., major crypto news).
Check for upcoming events (e.g., Ethereum network upgrades, ETF decisions) that could impact price.
Backtesting: Test the strategy on historical ETH data using the session high/low breakouts for the 7:00 PM–7:59 PM EST window to validate performance.
Adjust TP/SL levels based on backtest results if needed.
Broker and Fees: Use a low-fee crypto exchange (e.g., Binance, Kraken, Coinbase Pro) to maximize R:R.
Account for trading fees and slippage in your position sizing.
Time zone Adjustment: Adjust session time input for your time zone (e.g., "0000-0059" for GMT).
Ensure your trading platform’s clock aligns with the script’s time zone (default: America/New_York).
8. Example Trade Scenario: Session (7:00 PM–7:59 PM EST) records a high of 3050 and a low of 3000.
Long Trade: Entry: Price breaks above 3050 (e.g., enter at 3051).
TP Levels: 3063 (TP1), 3073 (TP2), 3083 (TP3), 3093 (TP4), 3103 (TP5).
SL: 3040 (3050 - 10).
Position Size: For a $10,000 account, 1% risk = $100. SL = 11 points ($11). Size = $100 ÷ 11 = ~0.09 ETH.
Short Trade: Entry: Price breaks below 3000 (e.g., enter at 2999).
TP Levels: 2987 (TP1), 2977 (TP2), 2967 (TP3), 2957 (TP4), 2947 (TP5).
SL: 3010 (3000 + 10).
Position Size: Same as above, ~0.09 ETH.
Execution: Set alerts for breakouts, enter with limit orders, and monitor TPs/SL.
9. Tools and Setup Platform: Use TradingView to implement the Pine Script and visualize breakout levels.
Alerts: Set price alerts for breakouts above the session high or below the session low after 7:59 PM EST.
Set alerts for TP and SL levels.
Chart Settings: Use a 1-minute or 5-minute chart for precise session tracking.
Overlay the script to see high/low lines, TP levels, and SL levels.
Optional Indicators: Add RSI (e.g., avoid overbought/oversold breakouts) or volume to confirm breakouts.
10. Risk Warnings Crypto Volatility: ETH is highly volatile; unexpected news can cause rapid price swings.
False Breakouts: Breakouts may fail, especially in low-volume sessions. Use confirmation signals.
Leverage: Avoid high leverage (e.g., >5x) to prevent liquidation during volatile moves.
Session Accuracy: Ensure correct session timing for your time zone to avoid misaligned entries.
11. Performance Tracking Journaling :Record each trade’s entry, exit, R:R, and outcome.
Note market conditions (e.g., trending, ranging, news-driven).
Review: Weekly: Assess win rate, average R:R, and adherence to the plan.
Monthly: Adjust TP/SL or session timing based on performance.
ai quant oculusAI QUANT OCULUS
Version 1.0 | Pine Script v6
Purpose & Innovation
AI QUANT OCULUS integrates four distinct technical concepts—exponential trend filtering, adaptive smoothing, momentum oscillation, and Gaussian smoothing—into a single, cohesive system that delivers clear, objective buy and sell signals along with automatically plotted stop-loss and three profit-target levels. This mash-up goes beyond a simple EMA crossover or standalone TRIX oscillator by requiring confluence across trend, adaptive moving averages, momentum direction, and smoothed price action, reducing false triggers and focusing on high‐probability turning points.
How It Works & Why Its Components Matter
Trend Filter: EMA vs. Adaptive MA
EMA (20) measures the prevailing trend with fixed sensitivity.
Adaptive MA (also EMA-based, length 10) approximates a faster-responding moving average, standing in for a KAMA-style filter.
Bullish bias requires AMA > EMA; bearish bias requires AMA < EMA. This ensures signals align with both the underlying trend and a more nimble view of recent price action.
Momentum Confirmation: TRIX
Calculates a triple-smoothed EMA of price over TRIX Length (15), then converts it to a percentage rate-of-change oscillator.
Positive TRIX reinforces bullish entries; negative TRIX reinforces bearish entries. Using TRIX helps filter whipsaws by focusing on sustained momentum shifts.
Gaussian Price Smoother
Applies two back-to-back 5-period EMAs to the price (“gaussian” smoothing) to remove short-term noise.
Price above the smoothed line confirms strength for longs; below confirms weakness for shorts. This layer avoids entries on erratic spikes.
Confluence Signals
Buy Signal (isBull) fires only when:
AMA > EMA (trend alignment)
TRIX > 0 (momentum support)
Close > Gaussian (price strength)
Sell Signal (isBear) fires under the inverse conditions.
Requiring all three conditions simultaneously sharply reduces false triggers common to single-indicator systems.
Automatic Risk & Reward Plotting
On each new buy or sell signal (edge detection via not isBull or not isBear ), the script:
Stores entryPrice at the signal bar’s close.
Draws a stop-loss line at entry minus ATR(14) × Stop Multiplier (1.5) by default.
Plots three profit-target lines at entry plus ATR × Target Multiplier (1×, 1.5×, and 2×).
All previous labels and lines are deleted on each new signal, keeping the chart uncluttered and focusing only on the current trade.
Inputs & Customization
Input Description Default
EMA Length Period for the main trend EMA 20
Adaptive MA Length Period for the faster adaptive EM A substitute 10
TRIX Length Period for the triple-smoothed momentum oscillator 15
Dominant Cycle Length (Reserved) 40
Stop Multiplier ATR multiple for stop-loss distance 1.5
Target Multiplier ATR multiple for first profit target 1.5
Show Buy/Sell Signals Toggle on-chart labels for entry signals On
How to Use
Apply to Chart: Best on 15 m–1 h timeframes for swing entries or 5 m for agile scalps.
Wait for Full Confluence:
Look for the AMA to cross above/below the EMA and verify TRIX and Gaussian conditions on the same bar.
A bright “LONG” or “SHORT” label marks your entry.
Manage the Trade:
Place your stop where the red or green SL line appears.
Scale or exit at the three yellow TP1/TP2/TP3 lines, automatically drawn by volatility.
Repeat Cleanly: Each new signal clears prior annotations, ensuring you only track the active setup.
Why This Script Stands Out
Multi-Layer Confluence: Trend, momentum, and noise-reduction must all align, addressing the weaknesses of single-indicator strategies.
Automated Trade Management: No manual plotting—stop and target lines appear seamlessly with each signal.
Transparent & Customizable: All logic is open, adjustable, and clearly documented, allowing traders to tweak lengths and multipliers to suit different instruments.
Disclaimer
No indicator guarantees profit. Always backtest AI QUANT OCULUS extensively, combine its signals with your own analysis and risk controls, and practice sound money management before trading live.