Tìm kiếm tập lệnh với "daily"
Daily SMAThis pine script on intraday chart is exactly the same SMA as built-in MovingAverage on a 1Day chart (with the same lengths)
Seasonality Table: % Move by Day x Month (Open vs Prev Close)Short description
A compact seasonality heatmap that shows the average daily open vs previous session close move for each calendar day (1–31) across months (Jan–Dec).
What it does
This indicator builds a Day × Month table where each cell displays the historical average of:
(Open/Close-1) -1 x 100
In other words: how the market typically “opened” relative to the prior day’s close, grouped by day of month and month.
How to read it
Rows = Day of month (1–31)
Columns = Months (Jan–Dec)
Cell value = average percentage move (signed format like +0.23% or -0.33%)
Heatmap = stronger color intensity indicates larger absolute average moves
Today highlight = the current calendar day cell is visually highlighted for fast context
Key settings
Reference timeframe (Daily): uses daily session data as the source of truth
Decimals / Signed formatting: control numeric display
Theme controls: fully customizable colors for positive/negative/neutral cells, headers, labels, and text
Font sizes: independently adjust header/labels/values
Heatmap scaling: set “max abs (%)” to match the volatility of the instrument
Notes / limitations
The indicator depends on the historical data available on TradingView for the selected
symbol and timeframe.
This is a statistical visualization tool. It does not predict future returns and does not generate trade signals.
Disclaimer
This script is for educational and informational purposes only and is not financial advice. Trading involves risk. Always do your own research and use proper risk management.
CVD Oscillator - Alphaomega18ORDER FLOW DASHBOARD OSCILLATOR - TRADINGVIEW PUBLICATION (ENGLISH)
Created by Alphaomega18
═══════════════════════════════════════════════════════════════════════════════
📌 PUBLICATION TITLE
═══════════════════════════════════════════════════════════════════════════════
Order Flow Dashboard - CVD Oscillator & Pressures - Alphaomega18
📝 COMPLETE DESCRIPTION
═══════════════════════════════════════════════════════════════════════════════
🎯 TRACK INSTITUTIONAL FLOW IN REAL-TIME
Order Flow Dashboard Oscillator is an advanced indicator that displays CVD (Cumulative Volume Delta) as a percentage oscillator, combined with real-time buy/sell pressures.
Unlike traditional CVD indicators where raw CVD reaches millions and crushes other data, this oscillator displays CVD deviation from its average in %, allowing clear reading on the SAME scale as pressures.
🔥 THE PROBLEM SOLVED
Classic CVD indicator problem:
✗ Raw CVD climbs to 1,000,000+ → Unreadable
✗ Pressures stay small (0-500) → Invisible
✗ Impossible to see both simultaneously
✗ Cluttered and confusing chart
Solution with CVD Oscillator:
✅ CVD displayed as % deviation (oscillates around 0)
✅ Pressures normalized on same scale
✅ EVERYTHING visible simultaneously
✅ Clear and intuitive reading
📊 INDICATOR COMPONENTS
🔷 CVD OSCILLATOR (Thick white line)
Traditional CVD accumulates infinitely:
→ Raw CVD = 50,000 ... 100,000 ... 500,000 ... 1,000,000+
→ Hard to interpret
CVD Oscillator shows DEVIATION:
→ CVD Oscillator = +5% ... +12% ... -3% ... -8%
→ Easy to interpret!
**How it works:**
• Calculates distance between CVD and its moving average (20 periods default)
• Converts to percentage
• Oscillates around 0 (gray center line)
**Interpretation:**
• **Above 0** → CVD > Average = BULLISH trend
• **Below 0** → CVD < Average = BEARISH trend
• **+10% zone** (green dotted line) → Buyer strength
• **-10% zone** (red dotted line) → Seller strength
🔷 BUY/SELL PRESSURES (Green/Red zones)
**Buy Pressure (Green zone)**
→ Calculated on bullish candles
→ Proportional to candle size
→ Normalized for optimal visibility
**Sell Pressure (Red zone)**
→ Calculated on bearish candles
→ Proportional to candle size
→ Normalized for optimal visibility
**Extreme Pressures** (Background)
→ 🟢 Light green background = EXTREME buy pressure (delta > 2x average)
→ 🔴 Light red background = EXTREME sell pressure (delta < -2x average)
🔷 REAL-TIME DASHBOARD (Top right corner)
Displays 6 key metrics:
1. **CVD Osc**: Oscillator value in %
2. **CVD Raw**: Raw CVD value (reference)
3. **Trend**: 🟢 Bullish or 🔴 Bearish
4. **Delta**: Current candle delta
5. **Volume**: HIGH (spike) or Normal
6. **Pressure**: 🚀 BUY / 💥 SELL / Neutral
🎯 HOW TO USE IT
📌 CASE 1: HOLD TRADES LONGER
**Classic problem:**
→ You're in a LONG
→ Price pulls back slightly, you panic
→ You exit... then price resumes up
→ Frustration: "I was right but exited too early!"
**Solution with CVD Oscillator:**
Example LONG trade:
1. You enter LONG on breakout
2. You watch CVD Oscillator
3. **As long as it stays ABOVE 0** → Keep the trade
4. Institutions continue accumulating
5. Trend remains intact
Exit:
→ CVD Oscillator **crosses below 0**
→ Signal: Institutions now selling
→ You exit or take profits
**Result:**
✅ You maximize your gains
✅ You exit at right time (when flow changes)
✅ You don't panic on small corrections
📌 CASE 2: CONFIRM TREND STRENGTH
**Setup:**
→ Price in uptrend
→ But is it real trend or just noise?
**Check CVD Oscillator:**
STRONG trend:
→ CVD Oscillator **stays positive** (+5%, +8%, +12%)
→ Dominant buy pressures (green zones)
→ Few or no red backgrounds
WEAK trend:
→ CVD Oscillator **oscillates around 0** (+2%, -1%, +3%)
→ Mixed pressures (green and red alternate)
→ Lack of conviction
**Action:**
✅ Strong trend → Trade with confidence
⚠️ Weak trend → Be cautious or avoid
📌 CASE 3: DETECT TREND CHANGE
**CVD Oscillator Divergence:**
Price makes higher highs BUT:
→ CVD Oscillator makes lower highs
→ +15% ... +12% ... +8% (progressive decline)
→ Sell pressures increasing
Signal: Distribution in progress
→ Institutions selling into rally
→ Reversal likely
→ Prepare SHORT or exit LONG
📌 CASE 4: OPTIMAL ENTRY TIMING
**Situation:**
→ Price consolidating
→ You wait for signal to enter
**LONG entry signal:**
→ CVD Oscillator **crosses above 0**
→ Green background (extreme buy pressure) appears
→ Dashboard: 🚀 BUY
Action: Enter LONG immediately
**SHORT entry signal:**
→ CVD Oscillator **crosses below 0**
→ Red background (extreme sell pressure) appears
→ Dashboard: 💥 SELL
Action: Enter SHORT immediately
⚙️ CUSTOMIZABLE PARAMETERS
🔧 **CVD Moving Average Length** (default: 20)
→ Moving average period for oscillator
→ Shorter (10-15) = More reactive, more signals
→ Longer (30-50) = Smoother, fewer false signals
👁️ **Show CVD Oscillator** (On/Off)
→ Show/hide CVD Oscillator line
👁️ **Show Buy/Sell Pressure** (On/Off)
→ Show/hide pressure zones
👁️ **Show Info Dashboard** (On/Off)
→ Show/hide information table
📊 RECOMMENDED CONFIGURATIONS
**For Day Trading (15min-1H):**
```
CVD MA Length: 20
Show CVD Oscillator: ✅ ON
Show Buy/Sell Pressure: ✅ ON
Show Info Dashboard: ✅ ON
```
**For Scalping (1-5min):**
```
CVD MA Length: 10 (more reactive)
Show CVD Oscillator: ✅ ON
Show Buy/Sell Pressure: ✅ ON
Show Info Dashboard: ✅ ON
```
**For Swing Trading (4H-Daily):**
```
CVD MA Length: 30 (smoother)
Show CVD Oscillator: ✅ ON
Show Buy/Sell Pressure: ✅ ON
Show Info Dashboard: ✅ ON
```
💡 MARKETS AND TIMEFRAMES
✅ **ALL markets compatible:**
• Futures (ES, NQ, YM, RTY, MNQ, MES, etc.)
• Forex (EUR/USD, GBP/USD, USD/JPY, etc.)
• Crypto (BTC, ETH, altcoins)
• Stocks (Tesla, Apple, Nvidia, etc.)
• Indices (S&P 500, Nasdaq, Dow Jones)
✅ **All timeframes:**
• Scalping: 1min, 5min
• Day Trading: 15min, 30min, 1H ⭐ (optimal!)
• Swing Trading: 4H, Daily
Note: More reliable with real volume data
→ TradingView Premium recommended
🏆 UNIQUE ADVANTAGES
✅ **CVD Oscillator**: % deviation instead of raw value
✅ **Same scale**: CVD and pressures visible together
✅ **Intuitive reading**: Above/below 0
✅ **Normalized pressures**: Always visible
✅ **Real-time dashboard**: 6 key metrics
✅ **Strength zones**: +10% and -10% marked
✅ **Background alerts**: Visual extreme pressures
✅ **Optimized code**: Light and fast
✅ **No repaint**: Reliable signals
🔗 PERFECT COMPLEMENT
Use with **Order Flow Signals** for complete system:
• **Order Flow Signals** (overlay=true) → Signals on chart
→ 💎 Absorptions, ▲ Divergences, 🚀 Pressures
• **Order Flow Dashboard** (overlay=false) → CVD and metrics
→ CVD Oscillator, Pressures, Live dashboard
**Complete system = 360° order flow vision!**
🎓 QUICK INTERPRETATION
**CVD Oscillator:**
• +5% to +10% = Moderate bullish
• +10% and above = STRONG bullish
• -5% to -10% = Moderate bearish
• -10% and below = STRONG bearish
• Near 0 = Neutral / Consolidation
**Pressures:**
• Large green zones = Dominant buying
• Large red zones = Dominant selling
• Balanced = Indecision
**Dashboard:**
• 🟢 Bullish + 🚀 BUY = Strong LONG signal
• 🔴 Bearish + 💥 SELL = Strong SHORT signal
• Massive positive delta = Bullish momentum
• Massive negative delta = Bearish momentum
⚠️ DISCLAIMER
Technical indicators are decision support tools. No indicator guarantees profits. Always use:
• Appropriate risk management
• Stop loss on every trade
• Proper position sizing
• Demo account testing first
Order Flow Dashboard improves your analysis but doesn't replace a complete strategy.
🚀 INSTALLATION
1. Copy the Pine Script code
2. Open Pine Editor in TradingView
3. Paste the code
4. Click "Add to Chart"
5. Indicator displays in separate pane (below)
6. Configure parameters to your preferences
7. Combine with Order Flow Signals for complete system!
💡 USAGE TIPS
**Golden Rule for Holding Trades:**
→ LONG: Keep as long as CVD Osc > 0
→ SHORT: Keep as long as CVD Osc < 0
**Strength Signals:**
→ CVD Osc > +10% = Very bullish
→ CVD Osc < -10% = Very bearish
**Trend Change:**
→ CVD Osc crosses 0 = Potential change
→ + Extreme background = Strong confirmation
📞 CONTACT AND SUPPORT
Created by Alphaomega18
For questions, bugs or suggestions:
Find my other indicators:
• Order Flow Signals (signals on chart)
• VWAP Multi-Timeframe Pro
• Fair Value Gap Detector
• Volume & Volatility Crisis Detector
KORVEX TRADING - S&PKORVEX Keylevel Must-Move Trading is a precise approach focused on identifying Must-Move-Levels to generate high-quality trades at clearly defined Keylevels. The strategy targets reversals and pullbacks at prominent Keylevels, resulting in a high hit rate with fewer, but highly qualitative signals.
Core Idea & Market Logic
KORVEX is not a classic continuous-signal indicator, but a targeted Must-Move finder for GOLD, DAX, S&P500, and EURUSD.
The strategy aims to trade reversals and pullbacks at clearly identifiable Keylevels (Daily High/Low, Previous High/Low, Daily Pivot, relevant Fibonacci zones such as 0.5, 0.618, 0.786).
Trading primarily takes place on the M15 timeframe, optionally also on M30 or H1, to find the best combination of signal quality and trading time.
Advantages of the Strategy
Fewer, but high-quality trades instead of continuous trading, which strengthens discipline and focus.
The use of clear Keylevels increases the probability of sustainable moves and reduces the risk of erroneous trades.
Combining technical levels with Fibonacci zones provides an objective decision basis and prevents subjective interpretations.
This approach creates a clear market logic based on quality and precise entries – ideal for traders aiming for sustainable results with fewer, but targeted trades.
DX Supply and Demand Pro💎 DX Supply and Demand Pro: Adaptive Line and Zone Mastery
The DX Supply and Demand Pro indicator is an advanced, hybrid trading tool engineered for precision and context. It seamlessly integrates the proprietary Arbitor Line with dynamic, volume-weighted Supply and Demand Zones. This unique combination provides traders with a clear, adaptive view of both the current trend bias and critical structural price levels.
⚠️ Critical Trading Disclaimer 🛑
Trading is highly speculative and carries a substantial risk of loss. The use of this indicator does not guarantee profits, and you may lose more than your initial capital. Before using this tool in a live trading environment, you must test its performance thoroughly using paper trading or a simulated account.
Why Traders Need the DX S&D Pro 🎯
Proprietary Adaptive Intelligence: The Arbitor Line is a calculated price anchor derived from a complex, undisclosed combination of multiple market factors and proprietary equations. It automatically adjusts its sensitivity based on the chart's timeframe, effectively filtering out market noise to present an accurate, weighted average of the prevailing market bias.
Structural Clarity: It detects high-probability Supply and Demand Zones using pivot points, filtering them for strength based on volume, ATR (volatility), and High Volume Node (HVN) confirmation from a higher timeframe.
Actionable Confluence: The indicator combines dynamic trend bias (the Arbitor Line) with static structural levels (S&D Zones). This allows traders to identify high-conviction setups where the structural turning point is confirmed by the real-time bias of the Arbitor Line.
📚 How to Use DX Supply and Demand Pro
This indicator is best used as a confluence tool, where the Arbitor Line confirms the strength and direction of the setup identified by the Supply/Demand Zones.
Trading Confluence with the Arbitor Line:
Scenario: Buy Zone Rejection 🟢
Condition: Price touches a Demand Zone.
Confluence: The Arbitor Line is Above the zone.
Interpretation: Indicates a Bullish Bias is confirming the structural support. Focus on long entries.
Scenario: Sell Zone Rejection 🔴
Condition: Price touches a Supply Zone.
Confluence: The Arbitor Line is Below the zone.
Interpretation: Indicates a Bearish Bias is confirming the structural resistance. Focus on short entries.
Scenario: Momentum Break ⚡
Condition: Price Closes strongly beyond a zone.
Confluence: The Arbitor Line is Aligned with the Break.
Interpretation: Confirms market momentum and suggests the structural break is valid for directional continuation.
⚙️ Key Settings and Optimization Guide 🔧
Arbitor Line Settings (Trend Bias):
VWAP Weight: (Default: 0.33) — The weight applied to a key volume component within the proprietary Arbitor calculation.
Suggestion for High Volatility/Volume: Increase to 0.40 to emphasize volume's influence.
Suggestion for Clean Trends: Decrease to 0.25 to allow momentum components to dictate the line's position.
Supply & Demand Zone Settings (Structural Levels)
HVN Volume TF: (Default: D - Daily) — Crucial Context Setter. The higher timeframe used to look for High Volume Nodes (HVNs) to confirm zone strength.
For Scalping (1m-15m): Use 1H or 4H for validation.
For Day Trading (30m-1H): Use 4H or D. D is the recommended default.
For Swing Trading (4H-Daily): Use W (Weekly).
HVN Bonus %: (Default: 20) — The strength boost applied to a zone if it aligns with an HVN.
Max Supply/Demand Zones: (Default: 2) — Limits the number of active, displayed zones to keep the chart clean.
Retest Bonus %: (Default: 10) — Boosts a zone's strength score each time it is retested (up to max retests).
Time Decay Rate %: (Default: 1) — Reduces a zone's strength for every 10 bars it remains unbroken (stale zones weaken).
Flip Zone on Break: (Default: True) — Turns a broken Demand Zone into a Supply Zone (and vice versa), reflecting structural flip concepts.
💡 Suggestions for Power Users 🚀
Look for Flipped Zones: Pay attention to zones that have been broken and flipped (indicated by yellow text in the labels). Flipped zones that confirm the Arbitor direction often lead to high-momentum continuation moves.
Confirm HVN Strength: Always prioritize trading zones with a high strength score (e.g., 90% or higher), as this indicates maximum confluence of Volume, Volatility, and the HVN Bonus.
Adaptive Timeframes: Use the indicator on multiple timeframes to ensure the Arbitor bias aligns with your trade direction. If the Arbitor is bullish on both the 5-minute and the 1-hour chart, the conviction is exceptionally high.
Final Note: The DX S&D Pro combines the best of trend following with the best of structural trading. It's so good, we call it the Arbitor because it settles the arguments between buyers and sellers... until the next bar, of course! 😉
....................................................................................
💎 مؤشر DX Supply and Demand Pro: خط التكيّف وإتقان المناطق ✨
مؤشر DX Supply and Demand Pro هو أداة تداول هجينة ومتقدمة مصممة للدقة والسياق. إنه يدمج بسلاسة خط Arbitor الخاص بنا مع مناطق العرض والطلب الديناميكية المرجحة بالحجم. يوفر هذا المزيج الفريد للمتداولين رؤية واضحة ومتكيفة لكل من انحياز الاتجاه الحالي ومستويات الأسعار الهيكلية (Structural Price Levels) الحرجة.
⚠️ إخلاء مسؤولية حاسم بشأن التداول 🛑
التداول ينطوي على مخاطرة عالية للغاية ويحمل مخاطر خسارة كبيرة. استخدام هذا المؤشر لا يضمن الأرباح، وقد تخسر أكثر من رأس مالك الأولي. قبل استخدام هذه الأداة في بيئة تداول حقيقية، يجب عليك اختبار أدائها بشكل شامل باستخدام التداول الورقي (Paper Trading) أو حساب محاكاة.
لماذا يحتاج المتداولون إلى مؤشر DX S&D Pro 🎯
ذكاء تكيّفي خاص (Proprietary Adaptive Intelligence): خط Arbitor هو مرساة سعر محسوبة مشتقة من تركيبة معقدة وغير معلنة من عوامل سوق متعددة ومعادلات خاصة. يقوم بضبط حساسيته تلقائيًا بناءً على الإطار الزمني للرسم البياني، مما يزيل ضوضاء السوق بشكل فعال لتقديم متوسط مرجح ودقيق للانحياز السائد في السوق.
وضوح هيكلي (Structural Clarity): يكتشف مناطق العرض والطلب ذات الاحتمالية العالية باستخدام نقاط التحول (Pivot Points)، ويقوم بترشيحها وتحديد قوتها بناءً على الحجم، ATR (التقلب)، وتأكيد من عقدة الحجم العالية (HVN) من إطار زمني أعلى.
تضافر قابل للتطبيق (Actionable Confluence): يجمع المؤشر بين انحياز الاتجاه الديناميكي (خط Arbitor) ومستويات الهيكل الثابتة (مناطق العرض والطلب). يتيح ذلك للمتداولين تحديد إعدادات ذات قناعة عالية حيث يتم تأكيد نقطة التحول الهيكلية من خلال انحياز خط Arbitor في الوقت الفعلي.
📚 كيفية استخدام مؤشر DX Supply and Demand Pro
يُفضل استخدام هذا المؤشر كأداة تضافر، حيث يؤكد خط Arbitor قوة واتجاه الإعداد المحدد بواسطة مناطق العرض والطلب.
تضافر التداول مع خط Arbitor:
السيناريو: ارتداد منطقة الشراء 🟢
الحالة: يلامس السعر منطقة الطلب (Demand Zone).
التضافر: يقع خط Arbitor فوق المنطقة.
التفسير: يشير إلى أن انحياز صعودي (Bullish Bias) يؤكد الدعم الهيكلي. التركيز على صفقات الشراء (Long Entries).
السيناريو: ارتداد منطقة البيع 🔴
الحالة: يلامس السعر منطقة العرض (Supply Zone).
التضافر: يقع خط Arbitor أسفل المنطقة.
التفسير: يشير إلى أن انحياز هبوطي (Bearish Bias) يؤكد المقاومة الهيكلية. التركيز على صفقات البيع (Short Entries).
السيناريو: كسر الزخم ⚡
الحالة: يُغلق السعر بقوة خارج المنطقة.
التضافر: يتماشى خط Arbitor مع الكسر.
التفسير: يؤكد زخم السوق ويشير إلى أن الكسر الهيكلي صالح للاستمرار الاتجاهي.
⚙️ الإعدادات الرئيسية ودليل التحسين 🔧
إعدادات خط Arbitor (انحياز الاتجاه)
VWAP Weight (وزن VWAP): (افتراضي: 0.33) — الوزن المطبق على مكون حجم رئيسي ضمن حساب Arbitor الخاص بنا.
اقتراح للتقلب/الحجم العالي: زيادة إلى 0.40 للتأكيد على تأثير الحجم.
اقتراح للاتجاهات النظيفة: تقليل إلى 0.25 للسماح لمكونات الزخم بتحديد موقع الخط بشكل أقوى.
إعدادات مناطق العرض والطلب (المستويات الهيكلية)
HVN Volume TF (الإطار الزمني لحجم HVN): (افتراضي: D - يومي) — مُحدِد السياق الحاسم. الإطار الزمني الأعلى المستخدم للبحث عن عقد الحجم العالية (HVNs) لتأكيد قوة المنطقة.
للمضاربة اللحظية (1د-15د): استخدم 1س أو 4س للتحقق.
للتداول اليومي (30د-1س): استخدم 4س أو D. D هو الإعداد الافتراضي الموصى به.
للتداول المتأرجح (4س-يومي): استخدم W (أسبوعي).
HVN Bonus % (مكافأة HVN %): (افتراضي: 20) — تعزيز القوة المطبق على المنطقة إذا كانت تتماشى مع عقدة HVN.
Max Supply/Demand Zones (الحد الأقصى لمناطق العرض/الطلب): (افتراضي: 2) — يحد من عدد المناطق النشطة المعروضة للحفاظ على نظافة الرسم البياني.
Retest Bonus % (مكافأة إعادة الاختبار %): (افتراضي: 10) — يعزز درجة قوة المنطقة في كل مرة يتم فيها إعادة اختبارها (حتى الحد الأقصى لإعادة الاختبارات).
Time Decay Rate % (معدل الاضمحلال الزمني %): (افتراضي: 1) — يقلل من قوة المنطقة لكل 10 شمعات تبقى فيها دون كسر (المناطق القديمة تضعف).
Flip Zone on Break (قلب المنطقة عند الكسر): (افتراضي: True - صحيح) — يحول منطقة الطلب المكسورة إلى منطقة عرض (والعكس صحيح)، مما يعكس مفاهيم التحول الهيكلي.
💡 اقتراحات للمستخدمين المتقدمين 🚀
ابحث عن المناطق المقلوبة (Flipped Zones): انتبه بشكل خاص إلى المناطق التي تم كسرها وقلبها (يشار إليها بنص أصفر في التسميات). غالبًا ما تؤدي المناطق المقلوبة التي تؤكد اتجاه Arbitor إلى تحركات استمرارية ذات زخم عالٍ.
تأكيد قوة HVN: أعطِ الأولوية دائمًا لتداول المناطق ذات درجة القوة العالية (على سبيل المثال، 90% أو أعلى)، حيث يشير هذا إلى أقصى درجات التضافر بين الحجم والتقلب ومكافأة HVN.
الأطر الزمنية التكيفية: استخدم المؤشر على أطر زمنية متعددة للتأكد من توافق انحياز Arbitor مع اتجاه تداولك. إذا كان Arbitor صعوديًا على كل من الرسم البياني 5 دقائق والساعة الواحدة، تكون القناعة عالية بشكل استثنائي.
ملاحظة أخيرة: يجمع مؤشر DX S&D Pro أفضل ما في تتبع الاتجاه مع أفضل ما في التداول الهيكلي. إنه جيد جدًا، لدرجة أننا نطلق عليه اسم Arbitor لأنه يحسم الجدل بين المشترين والبائعين... حتى الشمعة التالية بالطبع! 😉
دعواتكم 🙏.
Order Flow Signals - Alphaomega18═══════════════════════════════════════════════════════════════════════════════
ORDER FLOW SIGNALS - TRADINGVIEW PUBLICATION (ENGLISH)
Created by Alphaomega18
═══════════════════════════════════════════════════════════════════════════════
📌 PUBLICATION TITLE
═══════════════════════════════════════════════════════════════════════════════
Order Flow Signals - Absorptions & CVD Divergences - Alphaomega18
📝 COMPLETE DESCRIPTION
═══════════════════════════════════════════════════════════════════════════════
🎯 DETECT INSTITUTIONAL MOVES IN REAL-TIME
Order Flow Signals is an advanced order flow analysis indicator that displays institutional absorption signals, hidden CVD divergences, and extreme buy/sell pressure directly on your chart.
Fully customizable with 9 configurable colors, adjustable label sizes, and extreme absorption detection (300%+), this indicator allows you to trade WITH institutions, not against them.
🔥 THE PROBLEM IT SOLVES
Have you ever:
✗ Taken a technically perfect setup but got stopped out?
✗ Seen price reject a support/resistance but go the other way?
✗ Entered counter-trend without knowing institutions were accumulating?
✗ Missed big moves due to lack of confirmation?
Order Flow Signals solves these problems by revealing what smart money is REALLY doing behind each candle.
📊 SIGNALS DISPLAYED ON CHART
🔷 ABSORPTIONS (💎 Diamonds)
Institutions absorb order flow when volume is high BUT price doesn't move in the expected direction.
💎 BULLISH ABSORPTION (Cyan)
→ Volume spike + bearish candle + positive delta
→ Institutions are BUYING despite selling pressure
→ Strong accumulation signal
💎 BEARISH ABSORPTION (Orange)
→ Volume spike + bullish candle + negative delta
→ Institutions are SELLING despite buying pressure
→ Strong distribution signal
🔥 EXTREME ABSORPTIONS (Fuchsia Fire)
→ Volume > 300% of average (customizable)
→ MASSIVE institutional activity
→ Ultra-rare and ultra-strong signals
→ Indicates major moves in preparation
🔺 DIVERGENCES (▲ Green Triangles)
Price makes lower lows BUT CVD makes higher lows
→ Hidden accumulation in progress
→ Bullish reversal signal likely
→ Confirms your BUY entries
🔻 DIVERGENCES (▼ Red Triangles)
Price makes higher highs BUT CVD makes lower highs
→ Hidden distribution in progress
→ Bearish reversal signal likely
→ Confirms your SELL entries
🚀 EXTREME BUY PRESSURE (Rockets)
Delta > 2x average
→ Massive aggressive buying
→ Strong bullish momentum
→ Continuation likely
💥 EXTREME SELL PRESSURE (Explosions)
Delta < -2x average
→ Massive aggressive selling
→ Strong bearish momentum
→ Capitulation or panic
📈 DELTA PER CANDLE DISPLAY (NEW)
Option to display numerical delta on each candle:
• ✅ GREEN when delta positive (+250, +180, etc.)
• ❌ RED when delta negative (-320, -150, etc.)
• Tiny size to avoid clutter
• Perfect for tracking flow in real-time
🎯 REAL USE CASES
📌 Example 1: Avoid the Classic Trap
Technical setup:
→ Price rejects VWAP Weekly (resistance)
→ FVG below attracting
→ Single Prints above
→ You think: "Perfect SELL setup!"
WITHOUT Order Flow Signals:
❌ You enter SELL
❌ Price goes up and stops you out
❌ Frustration and loss
WITH Order Flow Signals:
✅ You see 💎 CYAN DIAMOND (Bullish absorption)
✅ Institutions are BUYING despite rejection
✅ You DON'T ENTER SELL
✅ Trade saved, loss avoided!
📌 Example 2: Confirm a Breakout
Setup:
→ Price breaks major resistance
→ But is it a real breakout or fakeout?
Check Order Flow Signals:
→ 🚀 ROCKET appears (extreme buy pressure)
→ 💎 CYAN DIAMOND (bullish absorption)
→ Massive positive delta visible
Clear signal: It's a REAL breakout!
→ Enter BUY with confidence
→ Institutions pushing price
📌 Example 3: Detect Hidden Accumulation
Situation:
→ Price consolidating in range
→ Apparently neutral
→ No clear technical signal
Order Flow Signals reveals:
→ ▲ GREEN TRIANGLE (bullish divergence)
→ Price flat BUT CVD rising progressively
→ Institutional accumulation in progress
Action: Prepare LONG position
→ When price breaks, it will be violent!
⚙️ COMPLETE CUSTOMIZATION
🎨 COLORS (9 configurable colors)
• Bullish Absorption (default: cyan)
• Bearish Absorption (default: orange)
• EXTREME Absorption (default: fuchsia)
• Bullish Divergence (default: green)
• Bearish Divergence (default: red)
• Buy Pressure (default: lime)
• Sell Pressure (default: fuchsia)
• Positive Delta (default: green)
• Negative Delta (default: red)
Adapt the indicator to your chart style!
📏 LABEL SIZES
5 sizes available: Tiny / Small / Normal / Large / Huge
→ Perfect for all screen types
→ Large 4K screen? → Large or Huge
→ Small laptop? → Small or Normal
🔍 CUSTOMIZABLE DETECTION
• Normal Absorption Threshold: 1.5x (default)
• EXTREME Absorption Threshold: 3.0x (default)
• Divergence Periods: 14 (default)
• All thresholds adjustable to your style
👁️ ON/OFF DISPLAY
• Absorptions 💎 (On/Off)
• Divergences ▲▼ (On/Off)
• Extreme Pressure 🚀💥 (On/Off)
• Delta per Candle (On/Off)
Display only what you need!
🔔 COMPLETE ALERT SYSTEM
8 independently configurable alert types:
1. 🔵 Bullish Absorption
2. 🔴 Bearish Absorption
3. 🔥🔵 EXTREME Bullish Absorption
4. 🔥🔴 EXTREME Bearish Absorption
5. 📈 Bullish Divergence
6. 📉 Bearish Divergence
7. 🚀 Extreme Buy Pressure
8. 💥 Extreme Sell Pressure
Receive push, email or SMS notifications when institutions act!
💡 MARKETS AND TIMEFRAMES
✅ ALL markets compatible:
• Futures (ES, NQ, YM, RTY, MNQ, MES, etc.)
• Forex (EUR/USD, GBP/USD, USD/JPY, etc.)
• Crypto (BTC, ETH, altcoins)
• Stocks (Tesla, Apple, Nvidia, etc.)
• Indices (S&P 500, Nasdaq, Dow Jones)
• Commodities (Gold, Oil, etc.)
✅ All timeframes:
• Scalping: 1min, 5min
• Day Trading: 15min, 30min, 1H ⭐ (optimal!)
• Swing Trading: 4H, Daily
Note: More reliable signals with real volume data
→ TradingView Premium recommended for tick data
🏆 UNIQUE ADVANTAGES
✅ Automatic institutional absorption detection
✅ EXTREME absorptions (300%+) for ultra-strong signals
✅ Integrated CVD (Cumulative Volume Delta)
✅ Optional per-candle delta display (green/red)
✅ 9 customizable colors - adapt to your style
✅ 5 label sizes - perfect for all screens
✅ Clear visual signals directly on chart
✅ Detailed tooltips on each signal
✅ 8 independent configurable alerts
✅ Clean, optimized code, no repaint
✅ Compatible all markets and timeframes
📊 RECOMMENDED CONFIGURATION
For MNQ / ES / NQ (15min):
```
Detection:
├─ Normal Absorption Threshold: 1.5x
└─ EXTREME Absorption Threshold: 3.0x
Display:
├─ Absorptions: ✅ ON
├─ Divergences: ✅ ON
├─ Extreme Pressure: ✅ ON
└─ Delta per Candle: ❌ OFF (or ON if preferred)
Customization:
└─ Label Size: Normal (or Large for big screen)
Colors:
└─ Default (or customize!)
Alerts:
└─ All ✅ ON
```
For Scalping (1-5min):
```
└─ Label Size: Small
└─ Delta per Candle: ✅ ON (useful in scalping)
└─ Absorption Threshold: 2.0x (stricter)
```
🎓 SUPPORT AND TOOLTIPS
Each signal includes detailed tooltip on hover:
• Exact volume and multiplier (e.g. 2.3x)
• Precise delta
• Signal explanation
• Suggested action
Hover over 💎▲🚀 to understand each signal!
🔗 PERFECT COMPLEMENT
This indicator works perfectly with:
• Order Flow Dashboard (to see CVD and pressures)
• VWAP Multi-Timeframe
• Fair Value Gaps (FVG)
• Market Profile (POC/VPOC)
• Support/Resistance
Combine Order Flow signals with your technical analysis!
⚠️ DISCLAIMER
Technical indicators are decision support tools. No indicator guarantees profits. Always use:
• Appropriate risk management
• Stop loss on every trade
• Proper position sizing
• Demo account testing first
Order Flow Signals improves your analysis but doesn't replace a complete strategy.
📞 CONTACT AND SUPPORT
Created by Alphaomega18
For questions, bugs or suggestions:
Find my other indicators:
• Order Flow Dashboard (CVD and pressures)
• VWAP Multi-Timeframe Pro
• Fair Value Gap Detector
• Volume & Volatility Crisis Detector
Mawhoob (OBs & FVGs) - v1.1Mawhoob (OBs & FVGs) - v1.1
Professional Market Structure Indicator
----------------------------------------------------
🎯 Overview
----------------------------------------------------
Mawhoob (OBs & FVGs) - v1.1 is a comprehensive technical analysis indicator designed to identify and track two of the most powerful concepts in modern price action trading: Order Blocks (OBs) and Fair Value Gaps (FVGs). This indicator provides traders with automated detection, visualization, and real-time alerts for these key market structure elements, helping you identify high-probability trading zones and potential reversal areas.
----------------------------------------------------
🔍 What Are Order Blocks and Fair Value Gaps?
----------------------------------------------------
✅ Order Blocks (OBs)
Order Blocks represent areas where institutional players have placed significant orders, creating imbalances in supply and demand. These zones often act as strong support or resistance levels where price tends to react when revisited.
* Bullish Order Block (OB+): Forms when a bearish candle is immediately followed by a strong bullish candle that closes above the previous candle's high, indicating institutional buying interest.
* Bearish Order Block (OB-): Forms when a bullish candle is immediately followed by a strong bearish candle that closes below the previous candle's low, indicating institutional selling pressure.
✅ Fair Value Gaps (FVGs)
Fair Value Gaps are price inefficiencies that occur when the market moves too quickly, leaving unfilled price ranges. These gaps often get "filled" or "mitigated" as price returns to seek liquidity and balance.
* Bullish Fair Value Gap (FVG+): Forms when there's a gap between the high of two candles ago and the low of the current candle in an upward move.
* Bearish Fair Value Gap (FVG-): Forms when there's a gap between the low of two candles ago and the high of the current candle in a downward move.
----------------------------------------------------
✨ Key Features ✨
----------------------------------------------------
✅ Order Blocks (OBs) Module:
Detection & Visualization
Automatic OB Detection: Identifies both bullish and bearish order blocks in real-time.
Customizable Display: Show up to 50 order blocks simultaneously.
Visual Distinction: Separate color schemes for bullish and bearish order blocks.
Smart Labeling: Optional OB+/OB- labels for easy identification.
Advanced Filtering Options
Strong OBs Filter: Option to display only "super/strong" order blocks.
FVG Confirmation Filter: Show only order blocks that are immediately followed by fair value gaps for higher confluence.
Flexible Filtering: Use filters independently or combine them for maximum selectivity
Mitigation Tracking
Real-time Monitoring: Automatically tracks when order blocks are "filled" or mitigated by price.
Display Control: Choose whether to show or hide filled order blocks.
Customization Options
Color Settings: Fully customizable colors for bullish/bearish order block zones.
Transparency Control: Adjustable box background transparency.
Border Styles: Choose between Solid, Dashed, or Dotted borders.
Extension Options: Extend boxes to the right or stop at mitigation point.
Label Size: Select from Auto, Tiny, Small, Normal, or Large label sizes.
✅ Fair Value Gaps (FVGs) Module:
Detection & Visualization
Automatic FVG Detection: Identifies both bullish and bearish fair value gaps.
Customizable Display: Show up to 50 FVGs simultaneously.
Visual Distinction: Separate color schemes for bullish and bearish gaps.
Smart Labeling: Optional FVG+/FVG- labels for clarity.
Advanced Filtering Options
Strong FVGs Filter: Display only significant gaps formed by strong candles.
OB Confirmation Filter: Show only FVGs that follow order blocks for enhanced reliability.
Independent Settings: Completely separate filtering from order block module.
Mitigation Tracking
Gap Fill Detection: Automatically detects when price fills the fair value gap.
Visual Updates: Filled gaps change appearance to indicate completion.
Display Options: Control visibility of filled versus unfilled gaps.
Customization Options
Full Color Control: Independent color settings for bullish/bearish FVGs.
Transparency Management: Adjustable transparency levels.
Border Customization: Multiple border style options.
Extension Control: Choose how gaps extend on the chart.
Label Customization: Adjustable label sizes and colors.
----------------------------------------------------
🔔 Alerts & Signals
----------------------------------------------------
Alerts System
Real-time Notifications: Receive instant alerts when new OBs or FVGs are detected.
Separate Alert Channels: Independent alerts for order blocks and fair value gaps.
Price Information: Each alert includes the current price level.
Frequency Control: Alerts trigger once per bar to avoid spam.
Visual Signals
On-Chart Markers: Optional visual signals (circles/diamonds) at detection points.
Color-Coded: Bullish signals below bars, bearish signals above bars.
Toggle Control: Enable/disable signals independently from alerts.
----------------------------------------------------
📋 How to Use This Indicator?
----------------------------------------------------
For Trend Following
Look for Bullish OBs and FVGs in uptrends as potential entry zones.
Look for Bearish OBs and FVGs in downtrends as potential entry zones.
Use unmitigated zones as key support/resistance levels.
For Reversal Trading
Watch for price reactions when approaching order blocks.
Combine multiple timeframe analysis for higher probability setups.
Use the "Strong" filters to focus on the most significant zones.
For Confluence Trading
Enable "Show Only (OBs) that Followed by (FVGs)" filter.
Enable "Show Only (FVGs) that Follow (OBs)" filter.
Trade only when both structures align for maximum confluence.
Risk Management
Monitor when zones become mitigated (filled).
Use multiple timeframes to identify nested zones.
Combine with your existing trading strategy for confirmation.
----------------------------------------------------
⚙️ Recommended Settings
----------------------------------------------------
For Scalping (1m - 5m timeframes)
Display: 15-20 boxes.
Enable: Strong filters.
Disable: Show mitigated zones.
For Day Trading (15m - 1H timeframes)
Display: 20-30 boxes.
Enable: Confluence filters when needed.
Enable: Show mitigated zones for context.
For Swing Trading (4H - Daily timeframes)
Display: 30-50 boxes.
Enable: All zones for comprehensive analysis.
Enable: Confluence filters when needed.
Enable: Show mitigated zones for context.
----------------------------------------------------
💡 Pro Tips
----------------------------------------------------
Multiple Timeframe Analysis: Use the indicator on multiple timeframes to identify nested order blocks and FVGs for stronger setups.
Confluence Zones: Areas where OBs and FVGs overlap often provide the highest probability trades.
Mitigation Matters: Pay attention to how quickly and cleanly zones are mitigated - clean mitigations often indicate institutional interest.
Filter Combinations: Experiment with different filter combinations to find what works best for your trading style.
Alert Management: Set up alerts for both OBs and FVGs to never miss potential setups.
----------------------------------------------------
⚠️ Important Notes
----------------------------------------------------
This indicator is for educational and informational purposes only.
Always confirm signals with your own analysis before trading.
Use proper risk management and position sizing.
The indicator works on all timeframes and instruments.
Past performance does not guarantee future results.
----------------------------------------------------
🔄 Updates & Support
----------------------------------------------------
Current Version: v1.1
This indicator is actively maintained and updated. Future versions may include additional features and improvements based on user feedback.
----------------------------------------------------
🙏 Acknowledgments
----------------------------------------------------
Created by @mawhoobx - Designed to help traders identify institutional footprints and market inefficiencies for better trading decisions.
ADR % RangesThis indicator is designed to visually represent percentage lines from the open of the day. The % amount is determined by X amount of the last days to create an average...or Average Daily Range (ADR).
1. ADR Percentage Lines: The core function of the script is to apply lines to the chart that represent specific percentage changes from the daily open. It first calculates the average over X amount of days and then displays two lines that are 1/3rd of that average. One line goes above the other line goes below. The other two lines are the full "range" of the average. These lines can act as boundaries or targets to know how an asset has moved recently. *Past performance is not indicative of current or future results.
The calculation for ADR is:
Step 1. Calculate Today's Range = DailyHigh - DailyLow
Step 2. Store this average after the day has completed
Step 3. Sum all day's ranges
Step 4. Divide by total number of days
Step 5. Draw on chart
2. Customizable Inputs: Users have the flexibility to customize the script through various inputs. This includes the option to display lines only for the current trading day (`todayonly`), and to select which lines are displayed. The user can also opt to show a table the displays the total range of previous days and the average range of those previous days.
3. No Secondary Timeframe: The ADR is computed based on whatever timeframe the chart is and does not reference secondary periods. Therefore the script cannot be used on charts greater than daily.
This script is can be used by all traders for any market. The trader might have to adjust the "X" number of days back to compute a historical average. Maybe they only want to know the average over the past week (5 days) or maybe the past month (20 days).
D_H_L_OIndicator Name: D_H_L_O
Primary Function:
This indicator is designed to display buying pressure, selling pressure, and other key metrics derived from the daily candle on a TradingView chart. It helps you analyze market momentum, buying and selling forces, and price spreads.
Features Overview:
Basic Calculations from Daily Candle:
dailyHigh, dailyLow, dailyOpen, dailyClose: Represent the high, low, open, and close prices of the daily candle.
dailySpread: The difference between the high and low prices of the daily candle.
Buying and Selling Pressure:
Buying Pressure (high_open): The difference between the daily high and the open price.
Selling Pressure (low_open): The absolute difference between the daily low and the open price (displayed as a negative value).
deltaVolume: The net difference between buying and selling pressure.
Color and Visuals:
Blue (buyingColor): Indicates buying pressure for green (bullish) days.
Orange (sellingColor): Indicates selling pressure for red (bearish) days.
Displays bars with transparency to distinguish buying and selling forces.
Neutral Reference Line:
A horizontal line at 0 for quick visual comparison of buying and selling forces.
Labels for Key Information:
Displays values of buying pressure, selling pressure, and daily candle spread directly on the chart at corresponding bar positions.
Includes the weekday name (currentWeekday) for additional time context.
Historical Statistics:
Highest and lowest values of buying and selling pressure across the dataset.
Average buying and selling pressure.
Displays statistical summaries (like maximum pressure values) as labels on the last bar of the chart.
Benefits:
Detailed Market Pressure Visualization: Provides a clear view of the forces driving market movement each day.
Historical Context: Helps analyze historical trends in buying and selling pressures over time.
Decision-Making Support: Use pressure metrics to gauge market momentum and assess potential trends.
How to Use:
Copy and paste the script into TradingView (create a new indicator using Pine Script v5).
Add the indicator to your chart on any timeframe to observe daily candle metrics.
Customize colors, transparency, or other parameters to suit your trading style.
This indicator is ideal for traders who want to analyze price momentum and make decisions based on daily market behavior.
Humble Student OB/OS Trifecta indicatorAfter reading Cam Hui's blog post about his "Trifecta" bottom spotting model I thought I'd try my hand at scripting it as an indicator. The results are pretty close to what he describes. Though the data TradingView feeds me doesn't seem to be identical to what he's using on StockCharts.com the results are close enough that I will call the effort a success worth publishing.
Lorentzian Harmonic Flow - Adaptive ML⚡ LORENTZIAN HARMONIC FLOW — ADAPTIVE ML COMPLETE SYSTEM
THEORETICAL FOUNDATION: TEMPORAL RELATIVITY MEETS MACHINE LEARNING
The Lorentzian Harmonic Flow Adaptive ML system represents a paradigm shift in technical analysis by addressing a fundamental limitation that plagues traditional indicators: they assume time flows uniformly across all market conditions. In reality, markets experience time compression during volatile breakouts and time dilation during consolidation. A 50-period moving average calculated during a quiet overnight session captures vastly different market information than the same calculation during a high-volume news event.
This indicator solves this problem through Lorentzian spacetime modeling , borrowed directly from Einstein's special relativity. By calculating a dynamic gamma factor (γ) that measures market velocity relative to a volatility-based "speed of light," every calculation adapts its effective lookback period to the market's intrinsic clock. Combined with a dual-memory architecture, multi-regime detection, and Bayesian strategy selection, this creates a system that genuinely learns which approaches work in which market conditions.
CRITICAL DISTINCTION: TRUE ADAPTIVE LEARNING VS STATIC CLASSIFICATION
Before diving into the system architecture, it's essential to understand how this indicator fundamentally differs from traditional "Lorentzian" implementations, particularly the well-known Lorentzian Classification indicator.
THE ORIGINAL LORENTZIAN CLASSIFICATION APPROACH:
The pioneering Lorentzian Classification indicator (Jdehorty, 2022) introduced the financial community to Lorentzian distance metrics for pattern matching. However, it used offline training methodology :
• External Training: Required Python scripts or external ML tools to train the model on historical data
• Static Model: Once trained, the model parameters remained fixed
• No Real-Time Learning: The indicator classified patterns but didn't learn from outcomes
• Look-Ahead Bias Risk: Offline training could inadvertently use future data
• Manual Retraining: To adapt to new market conditions, users had to retrain externally and reload parameters
This was groundbreaking for bringing ML concepts to Pine Script, but it wasn't truly adaptive. The model was a snapshot—trained once, deployed, static.
THIS SYSTEM: TRUE ONLINE LEARNING
The Lorentzian Harmonic Flow Adaptive ML system represents a complete architectural departure :
✅ FULLY SELF-CONTAINED:
• Zero External Dependencies: No Python scripts, no external training tools, no data exports
• 100% Pine Script: Entire learning pipeline executes within TradingView
• One-Click Deployment: Load indicator, it begins learning immediately
• No Manual Configuration: System builds its own training data in real-time
✅ GENUINE FORWARD-WALK LEARNING:
• Real-Time Adaptation: Every trade outcome updates the model
• Forward-Only Logic: System uses only past confirmed data—zero look-ahead bias
• Continuous Evolution: Parameters adapt bar-by-bar based on rolling performance
• Regime-Specific Memory: Learns which patterns work in which conditions independently
✅ GETS BETTER WITH TIME:
• Week 1: Bootstrap mode—gathering initial data across regimes
• Month 2-3: Statistical significance emerges, parameter adaptation begins
• Month 4+: Mature learning, regime-specific optimization, confident selection
• Year 2+: Deep pattern library, proven parameter sets, robust to regime shifts
✅ NO RETRAINING REQUIRED:
• Automatic Adaptation: When market structure changes, system detects via performance degradation
• Memory Refresh: Old patterns naturally decay, new patterns replace them
• Parameter Evolution: Thresholds and multipliers adjust to current conditions
• Regime Awareness: If new regime emerges, enters bootstrap mode automatically
THE FUNDAMENTAL DIFFERENCE:
Traditional Lorentzian Classification:
"Here are patterns from the past. Current state matches pattern X, which historically preceded move Y. Signal fired."
→ Static knowledge, fixed rules, periodic retraining required
LHF Adaptive ML:
"In Trending Bull regime, Strategy B has 58% win rate and 1.4 Sharpe over last 30 trades. In High Vol Range, Strategy C performs better with 61% win rate and 1.8 Sharpe. Current state is Trending Bull, so I select Strategy B. If Strategy B starts failing, I'll adapt parameters or switch strategies. I'm learning which patterns matter in which contexts, and I improve every trade."
→ Dynamic learning, contextual adaptation, self-improving system
WHY THIS MATTERS:
Markets are non-stationary. A model trained on 2023 data may fail in 2024 when Fed policy shifts, volatility regime changes, or market structure evolves. Static models require constant human intervention—retraining, re-optimization, parameter updates.
This system learns continuously . It doesn't need you to tell it when markets changed. It discovers regime shifts through performance feedback, adapts parameters accordingly, and rebuilds its pattern library organically. The system running in Month 12 is fundamentally smarter than the system in Month 1—not because you retrained it, but because it learned from 1,000+ real outcomes.
This is the difference between pattern recognition (static ML) and reinforcement learning (adaptive ML). One classifies, the other learns and improves.
PART 1: LORENTZIAN TEMPORAL DYNAMICS
Markets don't experience time uniformly. During explosive volatility, price can compress weeks of movement into minutes. During consolidation, time dilates. Traditional indicators ignore this, using fixed periods regardless of market state.
The Lorentzian approach models market time using the Lorentz factor from special relativity:
γ = 1 / √(1 - v²/c²)
Where:
• v (velocity): Trend momentum normalized by ATR, calculated as (close - close ) / (N × ATR)
• c (speed limit): Realized volatility + volatility bursts, multiplied by c_multiplier parameter
• γ (gamma): Time dilation factor that compresses or expands effective lookback periods
When trend velocity approaches the volatility "speed limit," gamma spikes above 1.0, compressing time. Every calculation length becomes: base_period / γ. This creates shorter, more responsive periods during explosive moves and longer, more stable periods during quiet consolidation.
The system raises gamma to an optional power (gamma_power parameter) for fine control over compression strength, then applies this temporal scaling to every calculation in the indicator. This isn't metaphor—it's quantitative adaptation to the market's intrinsic clock.
PART 2: LORENTZIAN KERNEL SMOOTHING
Traditional moving averages use uniform weights (SMA) or exponential decay (EMA). The Lorentzian kernel uses heavy-tailed weighting:
K(distance, γ) = 1 / (1 + (distance/γ)²)
This Cauchy-like distribution gives more influence to recent extremes than Gaussian assumptions suggest, capturing the fat-tailed nature of financial returns. For any calculation requiring smoothing, the system loops through historical bars, computes Lorentzian kernel weights based on temporal distance and current gamma, then produces weighted averages.
This creates adaptive smoothing that responds to local volatility structure rather than imposing rigid assumptions about price distribution.
PART 3: HARMONIC FLOW (Multi-Timeframe Momentum)
The core directional signal comes from Harmonic Flow (HFL) , which blends three gamma-compressed Lorentzian smooths:
• Short Horizon: base_period × short_ratio / γ (default: 34 × 0.5 / γ ≈ 17 bars, faster with high γ)
• Mid Horizon: base_period × mid_ratio / γ (default: 34 × 1.0 / γ ≈ 34 bars, anchor timeframe)
• Long Horizon: base_period × long_ratio / γ (default: 34 × 2.5 / γ ≈ 85 bars, structural trend)
Each produces a Lorentzian-weighted smooth, converted to a z-score (distance from smooth normalized by ATR). These z-scores are then weighted-averaged:
HFL = (w_short × z_short + w_mid × z_mid + w_long × z_long) / (w_short + w_mid + w_long)
Default weights (0.45, 0.35, 0.20) favor recent momentum while respecting longer structure. Scalpers can increase short weight; swing traders can emphasize long weight. The result is a directional momentum indicator that captures multi-timeframe flow in compressed time.
From HFL, the system derives:
• Flow Velocity: HFL - HFL (momentum acceleration)
• Flow Acceleration: Second derivative (turning points)
• Temporal Compression Index (TCI): base_period / compressed_length (shows how much time is compressed)
PART 4: DUAL MEMORY ARCHITECTURE
Markets have memory—current conditions resonate with past regimes. But memory operates on two timescales, inspiring this indicator's dual-memory design:
SHORT-TERM MEMORY (STM):
• Capacity: 100 patterns (configurable 50-200)
• Decay Rate: 0.980 (50% weight after ~35 bars)
• Update Frequency: Every 10 bars
• Purpose: Capture current regime's tactical patterns
• Storage: Recent market states with 10-bar forward outcomes
• Analogy: Hippocampus (rapid encoding, fast fade)
LONG-TERM MEMORY (LTM):
• Capacity: 512 patterns (configurable 256-1024)
• Decay Rate: 0.997 (50% weight after ~230 bars)
• Quality Gate: Only high-quality patterns admitted (adaptive threshold per regime)
• Purpose: Strategic pattern library validated across regimes
• Storage: Validated patterns from weeks/months of history
• Analogy: Neocortex (slow consolidation, persistent storage)
Each memory stores 6-dimensional feature vectors:
1. HFL (harmonic flow strength)
2. Flow Velocity (momentum)
3. Flow Acceleration (turning points)
4. Volatility (realized vol EMA)
5. Entropy (market uncertainty)
6. Gamma (time compression state)
Plus the actual outcome (10-bar forward return).
K-NEAREST NEIGHBORS (KNN) PATTERN MATCHING:
When evaluating current market state, the system queries both memories using Lorentzian distance :
distance = Σ (1 - K(|feature_current - feature_memory|, γ))
This calculates similarity across all 6 dimensions using the same Lorentzian kernel, weighted by current gamma. The system finds K nearest neighbors (default: 8), weights each by:
• Similarity: Lorentzian kernel distance
• Age: Exponential decay based on bars since pattern
• Regime: Only patterns from similar regimes count
The weighted average of these neighbors' outcomes becomes the prediction. High-confidence predictions require both high similarity and agreement between multiple neighbors.
REGIME-AWARE BLENDING:
STM and LTM predictions are blended adaptively:
• High Vol Range regime: Trust STM 70% (recent matters in chaos)
• Trending regimes: Trust LTM 70% (structure matters in trends)
• Normal regimes: 50/50 blend
Agreement metric: When STM and LTM strongly disagree, the system flags low confidence—often indicating regime transition or novel market conditions requiring caution.
PART 5: FIVE-REGIME MARKET CLASSIFICATION
Traditional regime detection stops at "trending vs ranging." This system detects five distinct market states using linear regression slope and volatility analysis:
REGIME 0: TRENDING BULL ↗
• Detection: LR slope > trend_threshold (default: 0.3)
• Characteristics: Sustained positive HFL, elevated gamma, low entropy
• Best Strategy: B (Flow Momentum)
• Trading Behavior: Follow momentum, trail stops, pyramid winners
REGIME 1: TRENDING BEAR ↘
• Detection: LR slope < -trend_threshold
• Characteristics: Sustained negative HFL, elevated gamma, low entropy
• Best Strategy: B (Flow Momentum)
• Trading Behavior: Follow momentum short, aggressive exits on reversal
REGIME 2: HIGH VOL RANGE ↔
• Detection: |slope| < threshold AND vol_ratio > vol_expansion_threshold (default: 1.5)
• Characteristics: Oscillating HFL, high gamma spikes, high entropy
• Best Strategies: A (Squeeze Breakout) or C (Memory Pattern)
• Trading Behavior: Fade extremes, tight stops, quick profits
REGIME 3: LOW VOL RANGE —
• Detection: |slope| < threshold AND vol_ratio < vol_expansion_threshold
• Characteristics: Low HFL magnitude, gamma ≈ 1, squeeze conditions
• Best Strategy: A (Squeeze Breakout)
• Trading Behavior: Wait for breakout, wide stops on breakout entry
REGIME 4: TRANSITION ⚡
• Detection: Trend reversal OR volatility spike > 1.5× threshold
• Characteristics: Erratic gamma, high entropy, conflicting signals
• Best Strategy: None (often unfavorable)
• Trading Behavior: Stand aside, wait for clarity
Each regime gets a confidence score (0-1) measuring how clearly defined it is. Low confidence indicates messy, ambiguous conditions.
PART 6: THREE INDEPENDENT TRADING STRATEGIES
Rather than one signal logic, the system implements three distinct approaches:
STRATEGY A: SQUEEZE BREAKOUT
• Logic: Bollinger Bands squeeze release + HFL direction + flow velocity confirmation
• Calculation: Compares BB width to Keltner Channel width; fires when BB expands beyond KC
• Strength Score: 70 + compression_strength × 0.3 (tighter squeeze = higher score)
• Best Regimes: Low Vol Range (3), Transition exit (4→0 or 4→1)
• Pattern: Volatility contraction → directional expansion
• Philosophy: Calm before the storm; compression precedes explosion
STRATEGY B: LORENTZIAN FLOW MOMENTUM
• Logic: Strong HFL (×flow_mult) + positive velocity + gamma > 1.1 + NOT squeezing
• Calculation: |HFL × flow_mult| > 0.12, velocity confirms direction, gamma shows acceleration
• Strength Score: |HFL × flow_mult| × 80 + gamma × 10
• Best Regimes: Trending Bull (0), Trending Bear (1)
• Pattern: Established momentum → acceleration in compressed time
• Philosophy: Trend is friend when spacetime curves
STRATEGY C: MEMORY PATTERN MATCHING
• Logic: Dual KNN prediction > threshold + high confidence + agreement + HFL confirms
• Calculation: |memory_pred| > 0.005, memory_conf > 1.0, agreement > 0.5, HFL direction matches
• Strength Score: |prediction| × 800 × agreement
• Best Regimes: High Vol Range (2), sometimes others with sufficient pattern library
• Pattern: Historical similarity → outcome resonance
• Philosophy: Markets rhyme; learn from validated patterns
Each strategy generates independent strength scores. In multi-strategy mode (enabled by default), the system selects one strategy per regime based on risk-adjusted performance. In weighted mode (multi-strategy disabled), all three fire simultaneously with configurable weights.
PART 7: ADAPTIVE LEARNING & BAYESIAN SELECTION
This is where machine learning meets trading. The system maintains 15 independent performance matrices :
3 strategies × 5 regimes = 15 tracking systems
For each combination, it tracks:
• Trade Count: Number of completed trades
• Win Count: Profitable outcomes
• Total Return: Sum of percentage returns
• Squared Returns: For variance/Sharpe calculation
• Equity Curve: Virtual P&L assuming 10% risk per trade
• Peak Equity: All-time high for drawdown calculation
• Max Drawdown: Peak-to-trough decline
RISK-ADJUSTED SCORING:
For current regime, the system scores each strategy:
Sharpe Ratio: (mean_return / std_dev) × √252
Calmar Ratio: total_return / max_drawdown
Win Rate: wins / trades
Combined Score = 0.6 × Sharpe + 0.3 × Calmar + 0.1 × Win_Rate
The strategy with highest score is selected. This is similar to Thompson Sampling (multi-armed bandits) but uses deterministic selection rather than probabilistic sampling due to Pine Script limitations.
BOOTSTRAP MODE (Critical for Understanding):
For the first min_regime_samples trades (default: 10) in each regime:
• Status: "🔥 BOOTSTRAP (X/10)" displayed in dashboard
• Behavior: All signals allowed (gathering data)
• Regime Filter: Disabled (can't judge with insufficient data)
• Purpose: Avoid cold-start problem, build statistical foundation
After reaching threshold:
• Status: "✅ FAVORABLE" (score > 0.5) or "⚠️ UNFAVORABLE" (score ≤ 0.5)
• Behavior: Only trade favorable regimes (if enable_regime_filter = true)
• Learning: Parameters adapt based on outcomes
This solves a critical problem: you can't know which strategy works in a regime without data, but you can't get data without trading. Bootstrap mode gathers initial data safely, then switches to selective mode once statistical confidence emerges.
PARAMETER ADAPTATION (Per Regime):
Three parameters adapt independently for each regime based on outcomes:
1. SIGNAL QUALITY THRESHOLD (30-90):
• Starts: base_quality_threshold (default: 60)
• Adaptation:
Win Rate < 45% → RAISE threshold by learning_rate × 10 (be pickier)
Win Rate > 55% → LOWER threshold by learning_rate × 5 (take more)
• Effect: System becomes more selective in losing regimes, more aggressive in winning regimes
2. LTM QUALITY GATE (0.2-0.8):
• Starts: 0.4 (if adaptive gate enabled)
• Adaptation:
Sharpe < 0.5 → RAISE gate by learning_rate (demand better patterns)
Sharpe > 1.5 → LOWER gate by learning_rate × 0.5 (accept more patterns)
• Effect: LTM fills with high-quality patterns from winning regimes
3. FLOW MULTIPLIER (0.5-2.0):
• Starts: 1.0
• Adaptation:
Strong win (+2%+) → MULTIPLY by (1 + learning_rate × 0.1)
Strong loss (-2%+) → MULTIPLY by (1 - learning_rate × 0.1)
• Effect: Amplifies signal strength in profitable regimes, dampens in unprofitable
Each regime evolves independently. Trending Bull might develop threshold=55, gate=0.35, mult=1.3 while High Vol Range develops threshold=70, gate=0.50, mult=0.9.
PART 8: SHADOW PORTFOLIO VALIDATION
To validate learning objectively, the system runs three virtual portfolios :
Shadow Portfolio A: Trades only Strategy A signals
Shadow Portfolio B: Trades only Strategy B signals
Shadow Portfolio C: Trades only Strategy C signals
When any signal fires:
1. Open virtual position for corresponding strategy
2. On exit, calculate P&L (10% risk per trade)
3. Update equity, win count, profit factor
Dashboard displays:
• Equity: Current virtual balance (starts $10,000)
• Win%: Overall win rate across all regimes
• PF: Profit Factor (gross_profit / gross_loss)
This transparency shows which strategies actually perform, validates the selection logic, and prevents overfitting. If Shadow C shows $12,500 equity while A and B show $9,800, it confirms Strategy C's edge.
PART 9: HISTORICAL PRE-TRAINING
The system includes historical pre-training to avoid cold-start:
On Chart Load (if enabled):
1. Scan past pretrain_bars (default: 200)
2. Calculate historical HFL, gamma, velocity, acceleration, volatility, entropy
3. Compute 10-bar forward returns as outcomes
4. Populate STM with recent patterns
5. Populate LTM with high-quality patterns (quality > 0.4)
Effect:
• Without pre-training: Memories empty, no predictions for weeks, pure bootstrap
• With pre-training: System starts with pattern library, predictions from day one
Pre-training uses only past data (no future peeking) and fills memories with validated outcomes. This dramatically accelerates learning without compromising integrity.
PART 10: COMPREHENSIVE INPUT SYSTEM
The indicator provides 50+ inputs organized into logical groups. Here are the key parameters and their market-specific guidance:
🧠 ADAPTIVE LEARNING SYSTEM:
Enable Adaptive Learning (true/false):
• Function: Master switch for regime-specific strategy selection and parameter adaptation
• Enabled: System learns which strategies work in which regimes (recommended)
• Disabled: All strategies fire simultaneously with fixed weights (simpler, less adaptive)
• Recommendation: Keep enabled for all markets; system needs 2-3 months to mature
Learning Rate (0.01-0.20):
• Function: Speed of parameter adaptation based on outcomes
• Stocks/ETFs: 0.03-0.05 (slower, more stable)
• Crypto: 0.05-0.08 (faster, adapts to volatility)
• Forex: 0.04-0.06 (moderate)
• Timeframes:
1-5min scalping: 0.08-0.10 (rapid adaptation)
15min-1H day trading: 0.05-0.07 (balanced)
4H-Daily swing: 0.03-0.05 (conservative)
• Tradeoff: Higher = responsive but may overfit; Lower = stable but slower to adapt
Min Samples Per Regime (5-30):
• Function: Trades required before exiting bootstrap mode
• Active trading (>5 signals/day): 8-10 trades
• Moderate (1-5 signals/day): 10-15 trades
• Swing (few signals/week): 5-8 trades
• Logic: Bootstrap mode until this threshold; then uses Sharpe/Calmar for regime filtering
• Tradeoff: Lower = faster exit (risky, less data); Higher = more validation (safer, slower)
🌍 REGIME DETECTION:
Regime Lookback Period (20-200):
• Function: Bars used for linear regression to classify regime
• By Timeframe:
1-5min: 30-50 bars (~2-4 hour context)
15min: 40-60 bars (daily context)
1H: 50-100 bars (weekly context)
4H: 100-150 bars (monthly context)
Daily: 50-75 bars (quarterly context)
• By Market:
Crypto: 40-60 (faster regime changes)
Forex: 50-75 (moderate stability)
Stocks: 60-100 (slower structural trends)
• Tradeoff: Shorter = more regime switches (reactive); Longer = fewer switches (stable)
Trend Strength Threshold (0.1-0.8):
• Function: Minimum normalized LR slope to classify as trending vs ranging
• Lower (0.1-0.2): More markets classified as trending
• Higher (0.4-0.6): Only strong trends qualify
• Recommendations:
Choppy markets (BTC, small caps): 0.25-0.35
Smooth trends (major FX pairs): 0.30-0.40
Strong trends (indices during bull): 0.20-0.30
• Effect: Controls sensitivity of trending vs ranging classification
Vol Expansion Factor (1.2-3.0):
• Function: Volatility ratio to classify high-vol regimes (current_vol / avg_vol)
• By Asset:
Bitcoin: 1.4-1.6 (frequent vol spikes)
Altcoins: 1.3-1.5 (very volatile)
Major FX (EUR/USD): 1.6-2.0 (stable baseline)
Stocks (SPY): 1.5-1.8 (moderate)
Penny stocks: 1.3-1.4 (always volatile)
• Impact: Higher = fewer "High Vol Range" classifications; Lower = more sensitive to volatility spikes
🎯 SIGNAL GENERATION:
Base Quality Threshold (30-90):
• Function: Starting signal strength requirement (adapts per regime)
• THIS IS YOUR MAIN SIGNAL FREQUENCY CONTROL
• Conservative (70-80): Fewer, higher-quality signals
• Balanced (55-65): Moderate signal flow
• Aggressive (40-50): More signals, more noise
• By Trading Style:
Scalping (1-5min): 50-60
Day trading (15min-1H): 60-70
Swing (4H-Daily): 65-75
• Adaptive Behavior: System raises this in losing regimes (pickier), lowers in winning regimes (take more)
Min Confidence (0.1-0.9):
• Function: Minimum confidence score to fire signal
• Calculation: (Signal_Strength / 100) × Regime_Confidence
• Recommendations:
High-frequency (scalping): 0.2-0.3 (permissive)
Day trading: 0.3-0.4 (balanced)
Swing/position: 0.4-0.6 (selective)
• Interaction: During Transition regime (low regime confidence), even strong signals may fail confidence check; creates natural regime filtering
Only Trade Favorable Regimes (true/false):
• Function: Block signals in unfavorable regimes (where all strategies have negative risk-adjusted scores)
• Enabled (Recommended): Only trades when best strategy has positive Sharpe in current regime; auto-disables during bootstrap; protects capital
• Disabled: Always allows signals regardless of historical performance; use for manual regime assessment
• Bootstrap: Auto-allows trading until min_regime_samples reached, then switches to performance-based filtering
Min Bars Between Signals (1-20):
• Function: Prevents signal spam by enforcing minimum spacing
• By Timeframe:
1min: 3-5 bars (3-5 minutes)
5min: 3-6 bars (15-30 minutes)
15min: 4-8 bars (1-2 hours)
1H: 5-10 bars (5-10 hours)
4H: 3-6 bars (12-24 hours)
Daily: 2-5 bars (2-5 days)
• Logic: After signal fires, no new signals for X bars
• Tradeoff: Lower = more reactive (may overtrade); Higher = more patient (may miss reversals)
🌀 LORENTZIAN CORE:
Base Period (10-100):
• Function: Core time period for flow calculation (gets compressed by gamma)
• THIS IS YOUR PRIMARY TIMEFRAME KNOB
• By Timeframe:
1-5min scalping: 20-30 (fast response)
15min-1H day: 30-40 (balanced)
4H swing: 40-55 (smooth)
Daily position: 50-75 (very smooth)
• By Market Character:
Choppy (crypto, small caps): 25-35 (faster)
Smooth (major FX, indices): 35-50 (moderate)
Slow (bonds, utilities): 45-65 (slower)
• Gamma Effect: Actual length = base_period / gamma; High gamma compresses to ~20 bars, low gamma expands to ~50 bars
• Default 34 (Fibonacci) works well across most assets
Velocity Period (5-50):
• Function: Window for trend velocity calculation: (price_now - price ) / (N × ATR)
• By Timeframe:
1-5min scalping: 8-12 (fast momentum)
15min-1H day: 12-18 (balanced)
4H swing: 14-21 (smooth trend)
Daily: 18-30 (structural trend)
• By Market:
Crypto (fast moves): 10-14
Stocks (moderate): 14-20
Forex (smooth): 18-25
• Impact: Feeds into gamma calculation (v/c ratio); shorter = more sensitive to velocity spikes → higher gamma
• Relationship: Typically vel_period ≈ base_period / 2 to 2/3
Speed-of-Market (c) (0.5-3.0):
• Function: "Speed limit" for gamma calculation: c = realized_vol + vol_burst × c_multiplier
• By Asset Volatility:
High vol (BTC, TSLA): 1.0-1.3 (lower c = more compression)
Medium vol (SPY, EUR/USD): 1.3-1.6 (balanced)
Low vol (bonds, utilities): 1.6-2.5 (higher c = less compression)
• What It Does:
Lower c → velocity hits "speed limit" sooner → higher gamma → more compression
Higher c → velocity rarely hits limit → gamma stays near 1 → less adaptation
• Effect on Signals: More compression (low c) = faster regime detection, more responsive; Less compression (high c) = smoother, less adaptive
• Tuning: Start at 1.4; if gamma always ~1.0, lower to 1.0-1.2; if gamma spikes >5 often, raise to 1.6-2.0
Gamma Power (0.5-2.0):
• Function: Exponent applied to gamma: final_gamma = gamma^power
• Compression Strength:
0.5-0.8: Softens compression (gamma 4 → 2)
1.0: Linear (gamma 4 → 4)
1.2-2.0: Amplifies compression (gamma 4 → 16)
• Use Cases:
Reduce power (<1.0) if adaptive lengths swing too wildly or getting whipsawed
Increase power (>1.0) for more aggressive regime adaptation in fast markets
• Most users should leave at 1.0; only adjust if gamma behavior needs tuning
Max Kernel Lookback (20-200):
• Function: Computational limit for Lorentzian smoothing (performance control)
• Recommendations:
Fast PC / simple chart: 80-100
Slow PC / complex chart: 40-60
Mobile / lots of indicators: 30-50
• Impact: Each kernel smoothing loops through this many bars; higher = more accurate but slower
• Default 60 balances accuracy and speed; lower to 40-50 if indicator is slow
🎼 HARMONIC FLOW:
Short Horizon (0.2-1.0):
• Function: Fast timeframe multiplier: short_length = base_period × short_ratio / gamma
• Default: 0.5 (captures 2× faster flow than base)
• By Style:
Scalping: 0.3-0.4 (very fast)
Day trading: 0.4-0.6 (moderate)
Swing: 0.5-0.7 (balanced)
• Effect: Lower = more weight on micro-moves; Higher = smooths out fast fluctuations
Mid Horizon (0.5-2.0):
• Function: Medium timeframe multiplier: mid_length = base_period × mid_ratio / gamma
• Default: 1.0 (equals base_period, anchor timeframe)
• Usually keep at 1.0 unless specific strategy needs fine-tuning
Long Horizon (1.0-5.0):
• Function: Slow timeframe multiplier: long_length = base_period × long_ratio / gamma
• Default: 2.5 (captures trend/structure)
• By Style:
Scalping: 1.5-2.0 (less long-term influence)
Day trading: 2.0-3.0 (balanced)
Swing: 2.5-4.0 (strong trend component)
• Effect: Higher = more emphasis on larger structure; Lower = more reactive to recent price action
Short Weight (0-1):
Mid Weight (0-1):
Long Weight (0-1):
• Function: Relative importance in HFL calculation (should sum to 1.0)
• Defaults: Short: 0.45, Mid: 0.35, Long: 0.20 (day trading balanced)
• Preset Configurations:
SCALPING (fast response):
Short: 0.60, Mid: 0.30, Long: 0.10
DAY TRADING (balanced):
Short: 0.45, Mid: 0.35, Long: 0.20
SWING (trend-following):
Short: 0.25, Mid: 0.35, Long: 0.40
• Effect: More short weight = responsive but noisier; More long weight = smoother but laggier
🧠 DUAL MEMORY SYSTEM:
Enable Pattern Memory (true/false):
• Function: Master switch for KNN pattern matching via dual memory
• Enabled (Recommended): Strategy C (Memory Pattern) can fire; memory predictions influence all strategies; prediction arcs shown; heatmaps available
• Disabled: Only Strategy A and B available; faster performance (less computation); pure technical analysis (no pattern matching)
• Keep enabled for full system capabilities; disable only if CPU-constrained or testing pure flow signals
STM Size (50-200):
• Function: Short-Term Memory capacity (recent pattern storage)
• Characteristics: Fast decay (0.980), captures current regime, updates every 10 bars, tactical pattern matching
• Sizing:
Active markets (crypto): 80-120
Moderate (stocks): 100-150
Slow (bonds): 50-100
• By Timeframe:
1-15min: 60-100 (captures few hours of patterns)
1H: 80-120 (captures days)
4H-Daily: 100-150 (captures weeks/months)
• Tradeoff: More = better recent pattern coverage; Less = faster computation
• Default 100 is solid for most use cases
LTM Size (256-1024):
• Function: Long-Term Memory capacity (validated pattern storage)
• Characteristics: Slow decay (0.997), only high-quality patterns (gated), regime-specific recall, strategic pattern library
• Sizing:
Fast PC: 512-768
Medium PC: 384-512
Slow PC/Mobile: 256-384
• By Data Needs:
High-frequency (lots of patterns): 512-1024
Moderate activity: 384-512
Low-frequency (swing): 256-384
• Performance Impact: Each KNN search loops through entire LTM; 512 = good balance of coverage and speed; if slow, drop to 256-384
• Fills over weeks/months with validated patterns
STM Decay (0.95-0.995):
• Function: Short-Term Memory age decay rate: age_weight = decay^bars_since_pattern
• Decay Rates:
0.950: Aggressive fade (50% weight after 14 bars)
0.970: Moderate fade (50% after 23 bars)
0.980: Balanced (50% after 35 bars)
0.990: Slow fade (50% after 69 bars)
• By Timeframe:
1-5min: 0.95-0.97 (fast markets, old patterns irrelevant)
15min-1H: 0.97-0.98 (balanced)
4H-Daily: 0.98-0.99 (slower decay)
• Philosophy: STM should emphasize RECENT patterns; lower decay = only very recent matters; 0.980 works well for most cases
LTM Decay (0.99-0.999):
• Function: Long-Term Memory age decay rate
• Decay Rates:
0.990: 50% weight after 69 bars
0.995: 50% weight after 138 bars
0.997: 50% weight after 231 bars
0.999: 50% weight after 693 bars
• Philosophy: LTM should retain value for LONG periods; pattern from 6 months ago might still matter
• Usage:
Fast-changing markets: 0.990-0.995
Stable markets: 0.995-0.998
Structural patterns: 0.998-0.999
• Warning: Be careful with very high decay (>0.998); market structure changes, old patterns may mislead
• 0.997 balances long-term memory with regime evolution
K Neighbors (3-21):
• Function: Number of similar patterns to query in KNN search
• By Sample Size:
Small dataset (<100 patterns): 3-5
Medium dataset (100-300): 5-8
Large dataset (300-1000): 8-13
Very large (>1000): 13-21
• Tradeoff:
Fewer K (3-5): More reactive to closest matches; noisier; outlier-sensitive; better when patterns very distinct
More K (13-21): Smoother, more stable predictions; may dilute strong signals; better when patterns overlap
• Rule of Thumb: K ≈ √(memory_size) / 3; For STM=100, LTM=512: K ≈ 8-10 ideal
Adaptive Quality Gate (true/false):
• Function: Adapts LTM entry threshold per regime based on Sharpe ratio
• Enabled: Quality gate adapts: Low Sharpe → RAISE gate (demand better patterns); High Sharpe → LOWER gate (accept more patterns); each regime has independent gate
• Disabled: Fixed quality gate (0.4 default) for all regimes
• Recommended: Keep ENABLED; helps LTM focus on proven pattern types per regime; prevents weak patterns from polluting memory
🎯 MULTI-STRATEGY SYSTEM:
Enable Strategy Learning (true/false):
• Function: Core learning feature for regime-specific strategy selection
• Enabled: Tracks 3 strategies × 5 regimes = 15 performance matrices; selects best strategy per regime via Sharpe/Calmar/WinRate; adaptive strategy switching
• Disabled: All strategies fire simultaneously (weighted combination); no regime-specific selection; simpler but less adaptive
• Recommended: ENABLED (this is the core of the adaptive system); disable only for testing or simplification
Strategy A Weight (0-1):
• Function: Weight for Strategy A (Squeeze Breakout) when multi-strategy disabled
• Characteristics: Fires on Bollinger squeeze release; best in Low Vol Range, Transition; compression → expansion pattern
• When Multi-Strategy OFF: Default 0.33 (equal weight); increase to 0.4-0.5 for choppy ranges with breakouts; decrease to 0.2-0.3 for trending markets
• When Multi-Strategy ON: This is ignored (system auto-selects based on performance)
Strategy B Weight (0-1):
• Function: Weight for Strategy B (Lorentzian Flow) when multi-strategy disabled
• Characteristics: Fires on strong HFL + velocity + gamma; best in Trending Bull/Bear; momentum → acceleration pattern
• When Multi-Strategy OFF: Default 0.33; increase to 0.4-0.5 for trending markets; decrease to 0.2-0.3 for choppy/ranging markets
• When Multi-Strategy ON: Ignored (auto-selected)
Strategy C Weight (0-1):
• Function: Weight for Strategy C (Memory Pattern) when multi-strategy disabled
• Characteristics: Fires when dual KNN predicts strong move; best in High Vol Range; requires memory system enabled + sufficient data
• When Multi-Strategy OFF: Default 0.34; increase to 0.4-0.6 if strong pattern repetition and LTM has >200 patterns; decrease to 0.2-0.3 if new to system; set to 0.0 if memory disabled
• When Multi-Strategy ON: Ignored (auto-selected)
📚 PRE-TRAINING:
Historical Pre-Training (true/false):
• Function: Bootstrap feature that fills memory on chart load
• Enabled: Scans past bars to populate STM/LTM before live trading; calculates historical outcomes (10-bar forward returns); builds initial pattern library; system starts with context, not blank slate
• Disabled: Memories only populate in real-time; takes weeks to build pattern library
• Recommended: ENABLED (critical for avoiding "cold start" problem); disable only for testing clean learning
Training Bars (50-500):
• Function: How many historical bars to scan on load (limited by available history)
• Recommendations:
1-5min charts: 200-300 (few hours of history)
15min-1H: 200-400 (days/weeks)
4H: 300-500 (months)
Daily: 200-400 (years)
• Performance:
100 bars: ~1 second
300 bars: ~2-3 seconds
500 bars: ~4-5 seconds
• Sweet Spot: 200-300 (enough patterns without slow load)
• If chart loads slowly: Reduce to 100-150
🎨 VISUALIZATION:
Show Regime Background (true/false):
• Function: Color-code background by current regime
• Colors: Trending Bull (green tint), Trending Bear (red tint), High Vol Range (orange tint), Low Vol Range (blue tint), Transition (purple tint)
• Helps visually track regime changes
Show Flow Bands (true/false):
• Function: Plot upper/lower bands based on HFL strength
• Shows dynamic support/resistance zones; green fill = bullish flow; red fill = bearish flow
• Useful for visual trend confirmation
Show Confidence Meter (true/false):
• Function: Plot signal confidence (0-100) in separate pane
• Calculation: (Signal_Strength / 100) × Regime_Confidence
• Gold line = current confidence; dashed line = minimum threshold
• Signals fire when confidence exceeds threshold
Show Prediction Arc (true/false):
• Function: Dashed line projecting expected price move based on memory prediction
• NOT a price target - a probability vector; steep arc = strong expected move; flat arc = weak/uncertain prediction
• Green = bullish prediction; red = bearish prediction
Show Signals (true/false):
• Function: Triangle markers at entry points
• ▲ Green = Long signal; ▼ Red = Short signal
• Markers show on bar close (non-repainting)
🏆 DASHBOARD:
Show Dashboard (true/false):
• Function: Main info panel showing all system metrics
• Sections: Lorentzian Core, Regime, Dual Memory, Adaptive Parameters, Regime Performance, Shadow Portfolios, Current Signal Status
• Essential for understanding system state
Dashboard Position: Top Left, Top Right, Bottom Left, Bottom Right
Individual Section Toggles:
• System Stats: Lorentzian Core section (Gamma, v/c, HFL, TCI)
• Memory Stats: Dual Memory section (STM/LTM predictions, agreement)
• Shadow Portfolios: Shadow Portfolio table (equity, win%, PF)
• Adaptive Params: Adaptive Parameters section (threshold, quality gate, flow mult)
🔥 HEATMAPS:
Show Dual Heatmaps (true/false):
• Function: Visual pattern density maps for STM and LTM
• Layout: X-axis = pattern age (left=recent, right=old); Y-axis = outcome direction (top=bearish, bottom=bullish); Color intensity = pattern count; Color hue = bullish (green) vs bearish (red)
• Warning: Can clutter chart; disable if not using
Heatmap Position: Screen position for heatmaps (STM at selected position, LTM offset)
Resolution (5-15):
• Function: Grid resolution (bins)
• Higher = more detailed but smaller cells; Lower = clearer but less granular
• 10 is good balance; reduce to 6-8 if hard to read
PART 11: DASHBOARD METRICS EXPLAINED
The comprehensive dashboard provides real-time transparency into every aspect of the adaptive system:
⚡ LORENTZIAN CORE SECTION:
Gamma (γ):
• Range: 1.0 to ~10.0 (capped)
• Interpretation:
γ ≈ 1.0-1.2: Normal market time, low velocity
γ = 1.5-2.5: Moderate compression, trending
γ = 3.0-5.0: High compression, explosive moves
γ > 5.0: Extreme compression, parabolic volatility
• Usage: High gamma = system operating in compressed time; expect shorter effective periods and faster adaptation
v/c (Velocity / Speed Limit):
• Range: 0.0 to 0.999 (approaches but never reaches 1.0)
• Interpretation:
v/c < 0.3: Slow market, low momentum
v/c = 0.4-0.7: Moderate trending
v/c > 0.7: Approaching "speed limit," high velocity
v/c > 0.9: Parabolic move, system at limit
• Color Coding: Red (>0.7), Gold (0.4-0.7), Green (<0.4)
• Usage: High v/c warns of extreme conditions where trend may exhaust
HFL (Harmonic Flow):
• Range: Typically -3.0 to +3.0 (can exceed in extremes)
• Interpretation:
HFL > 0: Bullish flow
HFL < 0: Bearish flow
|HFL| > 0.5: Strong directional bias
|HFL| < 0.2: Weak, indecisive
• Color: Green (positive), Red (negative)
• Usage: Primary directional indicator; strategies often require HFL confirmation
TCI (Temporal Compression Index):
• Calculation: base_period / compressed_length
• Interpretation:
TCI ≈ 1.0: No compression, normal time
TCI = 1.5-2.5: Moderate compression
TCI > 3.0: Significant compression
• Usage: Shows how much time is being compressed; mirrors gamma but more intuitive
╔═══ REGIME SECTION ═══╗
Current:
• Display: Regime name with icon (Trending Bull ↗, Trending Bear ↘, High Vol Range ↔, Low Vol Range —, Transition ⚡)
• Color: Gold for visibility
• Usage: Know which regime you're in; check regime performance to see expected strategy behavior
Confidence:
• Range: 0-100%
• Interpretation:
>70%: Very clear regime definition
40-70%: Moderate clarity
<40%: Ambiguous, mixed conditions
• Color: Green (>70%), Gold (40-70%), Red (<40%)
• Usage: High confidence = trust regime classification; low confidence = regime may be transitioning
Mode:
• States:
🔥 BOOTSTRAP (X/10): Still gathering data for this regime
✅ FAVORABLE: Best strategy has positive risk-adjusted score (>0.5)
⚠️ UNFAVORABLE: All strategies have negative scores (≤0.5)
• Color: Orange (bootstrap), Green (favorable), Red (unfavorable)
• Critical Importance: This tells you whether the system will trade or stand aside (if regime filter enabled)
╔═══ DUAL MEMORY KNN SECTION ═══╗
STM (Size):
• Display: Number of patterns currently in STM (0 to stm_size)
• Interpretation: Should fill to capacity within hours/days; if not filling, check that memory is enabled
STM Pred:
• Range: Typically -0.05 to +0.05 (representing -5% to +5% expected 10-bar move)
• Color: Green (positive), Red (negative)
• Usage: STM's prediction based on recent patterns; emphasis on current regime
LTM (Size):
• Display: Number of patterns in LTM (0 to ltm_size)
• Interpretation: Fills slowly (weeks/months); only validated high-quality patterns; check quality gate if not filling
LTM Pred:
• Range: Similar to STM pred
• Color: Green (positive), Red (negative)
• Usage: LTM's prediction based on long-term validated patterns; more strategic than tactical
Agreement:
• Display:
✅ XX%: Strong agreement (>70%) - both memories aligned
⚠️ XX%: Moderate agreement (40-70%) - some disagreement
❌ XX%: Conflict (<40%) - memories strongly disagree
• Color: Green (>70%), Gold (40-70%), Red (<40%)
• Critical Usage: Low agreement often precedes regime change or signals novel conditions; Strategy C won't fire with low agreement
╔═══ ADAPTIVE PARAMS SECTION ═══╗
Threshold:
• Display: Current regime's signal quality threshold (30-90)
• Interpretation: Higher = pickier; lower = more permissive
• Watch For: If steadily rising in a regime, system is struggling (low win rate); if falling, system is confident
• Default: Starts at base_quality_threshold (usually 60)
Quality:
• Display: Current regime's LTM quality gate (0.2-0.8)
• Interpretation: Minimum quality score for pattern to enter LTM
• Watch For: If rising, system demanding higher-quality patterns; if falling, accepting more diverse patterns
• Default: Starts at 0.4
Flow Mult:
• Display: Current regime's flow multiplier (0.5-2.0)
• Interpretation: Amplifies or dampens HFL for Strategy B
• Watch For: If >1.2, system found strong edge in flow signals; if <0.8, flow signals underperforming
• Default: Starts at 1.0
Learning:
• Display: ✅ ON or ❌ OFF
• Shows whether adaptive learning is enabled
• Color: Green (on), Red (off)
╔═══ REGIME PERFORMANCE SECTION ═══╗
This table shows ONLY the current regime's statistics:
S (Strategy):
• Display: A, B, or C
• Color: Gold if selected strategy; gray if not
• Shows which strategies have data in this regime
Trades:
• Display: Number of completed trades for this pair
• Interpretation: Blank or low numbers mean bootstrap mode; >10 means statistical significance building
Win%:
• Display: Win rate percentage
• Color: Green (>55%), White (45-55%), Red (<45%)
• Interpretation: 52%+ is good; 58%+ is excellent; <45% means struggling
• Note: Short-term variance is normal; judge after 20+ trades
Sharpe:
• Display: Annualized Sharpe ratio
• Color: Green (>1.0), White (0-1.0), Red (<0)
• Interpretation:
>2.0: Exceptional (rare)
1.0-2.0: Good
0.5-1.0: Acceptable
0-0.5: Marginal
<0: Losing
• Usage: Primary metric for strategy selection (60% weight in score)
╔═══ SHADOW PORTFOLIOS SECTION ═══╗
Shows virtual equity tracking across ALL regimes (not just current):
S (Strategy):
• Display: A, B, or C
• Color: Gold if currently selected strategy; gray otherwise
Equity:
• Display: Current virtual balance (starts $10,000)
• Color: Green (>$10,000), White ($9,500-$10,000), Red (<$9,500)
• Interpretation: Which strategy is actually making virtual money across all conditions
• Note: 10% risk per trade assumed
Win%:
• Display: Overall win rate across all regimes
• Color: Green (>55%), White (45-55%), Red (<45%)
• Interpretation: Aggregate performance; strategy may do well in some regimes and poorly in others
PF (Profit Factor):
• Display: Gross profit / gross loss
• Color: Green (>1.5), White (1.0-1.5), Red (<1.0)
• Interpretation:
>2.0: Excellent
1.5-2.0: Good
1.2-1.5: Acceptable
1.0-1.2: Marginal
<1.0: Losing
• Usage: Confirms win rate; high PF with moderate win rate means winners >> losers
╔═══ STATUS BAR ═══╗
Display States:
• 🟢 LONG: Currently in long position (green background)
• 🔴 SHORT: Currently in short position (red background)
• ⬆️ LONG SIGNAL: Long signal present but not yet confirmed (waiting for bar close)
• ⬇️ SHORT SIGNAL: Short signal present but not yet confirmed
• ⚪ NEUTRAL: No position, no signal (white background)
Usage: Immediate visual confirmation of system state; check before manually entering/exiting
PART 12: VISUAL ELEMENT INTERPRETATION
REGIME BACKGROUND COLORS:
Green Tint: Trending Bull regime - expect Strategy B (Flow) to dominate; focus on long momentum
Red Tint: Trending Bear regime - expect Strategy B (Flow) shorts; focus on short momentum
Orange Tint: High Vol Range - expect Strategy A (Squeeze) or C (Memory); trade breakouts or patterns
Blue Tint: Low Vol Range - expect Strategy A (Squeeze); wait for compression release
Purple Tint: Transition regime - often unfavorable; system may stand aside; high uncertainty
Usage: Quick visual regime identification without reading dashboard
FLOW BANDS:
Upper Band: close + HFL × ATR × 1.5
Lower Band: close - HFL × ATR × 1.5
Green Fill: HFL positive (bullish flow); bands act as dynamic support/resistance in uptrend
Red Fill: HFL negative (bearish flow); bands act as dynamic resistance/support in downtrend
Usage:
• Bullish flow: Price bouncing off lower band = trend continuation; breaking below = possible reversal
• Bearish flow: Price rejecting upper band = trend continuation; breaking above = possible reversal
CONFIDENCE METER (Separate Pane):
Gold Line: Current signal confidence (0-100)
Dashed Line: Minimum confidence threshold
Interpretation:
• Line above threshold: Signal likely to fire if strength sufficient
• Line below threshold: Even if signal logic met, won't fire (insufficient confidence)
• Gradual rise: Signal building strength
• Sharp spike: Sudden conviction (check if sustainable)
Usage: Real-time signal probability; helps anticipate upcoming entries
PREDICTION ARC:
Dashed Line: Projects from current close to expected price 8 bars forward
Green Arc: Bullish memory prediction
Red Arc: Bearish memory prediction
Steep Arc: High conviction (strong expected move)
Flat Arc: Low conviction (weak/uncertain move)
Important: NOT a price target; this is a probability vector based on KNN outcomes; actual price may differ
Usage: Directional bias from pattern matching; confirms or contradicts flow signals
SIGNAL MARKERS:
▲ Green Triangle (below bar):
• Long signal confirmed on bar close
• Entry on next bar open
• Non-repainting (appears after bar closes)
▼ Red Triangle (above bar):
• Short signal confirmed on bar close
• Entry on next bar open
• Non-repainting
Size: Tiny (unobtrusive)
Text: "L" or "S" in marker
Usage: Historical signal record; alerts should fire on these; verify against dashboard status
DUAL HEATMAPS (If Enabled):
STM HEATMAP:
• X-axis: Pattern age (left = recent, right = older, typically 0-50 bars)
• Y-axis: Outcome direction (top = bearish outcomes, bottom = bullish outcomes)
• Color Intensity: Brightness = pattern count in that cell
• Color Hue: Green tint (bullish), Red tint (bearish), Gray (neutral)
Interpretation:
• Dense bottom-left: Many recent bullish patterns (bullish regime)
• Dense top-left: Many recent bearish patterns (bearish regime)
• Scattered: Mixed outcomes, ranging regime
• Empty areas: Few patterns (low data)
LTM HEATMAP:
• Similar layout but X-axis spans wider age range (0-500+ bars)
• Shows long-term pattern distribution
• Denser = more validated patterns
Comparison Usage:
• If STM and LTM heatmaps look similar: Current regime matches historical patterns (high agreement)
• If STM bottom-heavy but LTM top-heavy: Recent bullish activity contradicts historical bearish patterns (low agreement, transition signal)
PART 13: DEVELOPMENT STORY
The creation of the Lorentzian Harmonic Flow Adaptive ML system represents over six months of intensive research, mathematical exploration, and iterative refinement. What began as a theoretical investigation into applying special relativity to market time evolved into a complete adaptive learning framework.
THE CHALLENGE:
The fundamental problem was this: markets don't experience time uniformly, yet every indicator treats a 50-period calculation the same whether markets are exploding or sleeping. Traditional adaptive indicators adjust parameters based on volatility, but this is reactive—by the time you measure high volatility, the explosive move is over. What was needed was a framework that measured the market's intrinsic velocity relative to its own structural limits, then compressed time itself proportionally.
THE LORENTZIAN INSIGHT:
Einstein's special relativity provides exactly this framework through the Lorentz factor. When an object approaches the speed of light, time dilates—but from the object's reference frame, it experiences time compression. By treating price velocity as analogous to relativistic velocity and volatility structure as the "speed limit," we could calculate a gamma factor that compressed lookback periods during explosive moves.
The mathematics were straightforward in theory but devilishly complex in implementation. Pine Script has no native support for dynamically-sized arrays or recursive functions, forcing creative workarounds. The Lorentzian kernel smoothing required nested loops through historical bars, calculating kernel weights on the fly—a computational nightmare. Early versions crashed or produced bizarre artifacts (negative gamma values, infinite loops during volatility spikes).
Optimization took weeks. Limiting kernel lookback to 60 bars while still maintaining smoothing quality. Pre-calculating gamma once per bar and reusing it across all calculations. Caching intermediate results. The final implementation balances mathematical purity with computational reality.
THE MEMORY ARCHITECTURE:
With temporal compression working, the next challenge was pattern memory. Simple moving average systems have no memory—they forget yesterday's patterns immediately. But markets are non-stationary; what worked last month may not work today. The solution: dual-memory architecture inspired by cognitive neuroscience.
Short-Term Memory (STM) would capture tactical patterns—the hippocampus of the system. Fast encoding, fast decay, always current. Long-Term Memory (LTM) would store validated strategic patterns—the neocortex. Slow consolidation, persistent storage, regime-spanning wisdom.
The KNN implementation nearly broke me. Calculating Lorentzian distance across 6 dimensions for 500+ patterns per query, applying age decay, filtering by regime, finding K nearest neighbors without native sorting functions—all while maintaining sub-second execution. The breakthrough came from realizing we could use destructive sorting (marking found neighbors as "infinite distance") rather than maintaining separate data structures.
Pre-training was another beast. To populate memory with historical patterns, the system needed to scan hundreds of past bars, calculate forward outcomes, and insert patterns—all on chart load without timing out. The solution: cap at 200 bars, optimize loops, pre-calculate features. Now it works seamlessly.
THE REGIME DETECTION:
Five-regime classification emerged from empirical observation. Traditional trending/ranging dichotomy missed too much nuance. Markets have at least four distinct states: trending up, trending down, volatile range, quiet range—plus a chaotic transition state. Linear regression slope quantifies trend; volatility ratio quantifies expansion; combining them creates five natural clusters.
But classification is useless without regime-specific learning. That meant tracking 15 separate performance matrices (3 strategies × 5 regimes), computing Sharpe ratios and Calmar ratios for sparse data, implementing Bayesian-like strategy selection. The bootstrap mode logic alone took dozens of iterations—too strict and you never get data, too permissive and you blow up accounts during learning.
THE ADAPTIVE LAYER:
Parameter adaptation was conceptually elegant but practically treacherous. Each regime needed independent thresholds, quality gates, and multipliers that adapted based on outcomes. But naive gradient descent caused oscillations—win a few trades, lower threshold, take worse signals, lose trades, raise threshold, miss good signals. The solution: exponential smoothing via learning rate (α) and separate scoring for selection vs adaptation.
Shadow portfolios provided objective validation. By running virtual accounts for all strategies simultaneously, we could see which would have won even when not selected. This caught numerous bugs where selection logic was sound but execution was flawed, or vice versa.
THE DASHBOARD & VISUALIZATION:
A learning system is useless if users can't understand what it's doing. The dashboard went through five complete redesigns. Early versions were information dumps—too much data, no hierarchy, impossible to scan. The final version uses visual hierarchy (section headers, color coding, strategic whitespace) and progressive disclosure (show current regime first, then performance, then parameters).
The dual heatmaps were a late addition but proved invaluable for pattern visualization. Seeing STM cluster in one corner while LTM distributed broadly immediately signals regime novelty. Traders grasp this visually faster than reading disagreement percentages.
THE TESTING GAUNTLET:
Testing adaptive systems is uniquely challenging. Static backtest results mean nothing—the system should improve over time. Early "tests" showed abysmal performance because bootstrap periods were included. The breakthrough: measure pre-learning baseline vs post-learning performance. A system going from 48% win rate (first 50 trades) to 56% win rate (trades 100-200) is succeeding even if absolute performance seems modest.
Edge cases broke everything repeatedly. What happens when a regime never appears in historical data? When all strategies fail simultaneously? When memory fills with only bearish patterns during a bull run? Each required careful handling—bootstrap modes, forced diversification, quality gates.
THE DOCUMENTATION:
This isn't an indicator you throw on a chart with default settings and trade immediately. It's a learning system that requires understanding. The input tooltips alone contain over 10,000 words of guidance—market-specific recommendations, timeframe-specific settings, tradeoff explanations. Every parameter needed not just a description but a philosophical justification and practical tuning guide.
The code comments span 500+ lines explaining theory, implementation decisions, edge cases. Future maintainers (including myself in six months) need to understand not just what the code does but why certain approaches were chosen over alternatives.
WHAT ALMOST DIDN'T WORK:
The entire project nearly collapsed twice. First, when initial Lorentzian smoothing produced complete noise—hours of debugging revealed a simple indexing error where I was accessing instead of in the kernel loop. One character, entire system broken.
Second, when memory predictions showed zero correlation with outcomes. Turned out the KNN distance metric was dominated by the gamma dimension (values 1-10) drowning out normalized features (values -1 to 1). Solution: apply kernel transformation to all dimensions, not just final distance. Obvious in retrospect, maddening at the time.
THE PHILOSOPHY:
This system embodies a specific philosophy: markets are learnable but non-stationary. No single strategy works forever, but regime-specific patterns persist. Time isn't uniform, memory isn't perfect, prediction isn't possible—but probabilistic edges exist for those willing to track them rigorously.
It rejects the premise that indicators should give universal advice. Instead, it says: "In this regime, based on similar past states, Strategy B has a 58% win rate and 1.4 Sharpe. Strategy A has 45% and 0.2 Sharpe. I recommend B. But we're still in bootstrap for Strategy C, so I'm gathering data. Check back in 5 trades."
That humility—knowing what it knows and what it doesn't—is what makes it robust.
PART 14: PROFESSIONAL USAGE PROTOCOL
PHASE 1: DEPLOYMENT (Week 1-4)
Initial Setup:
1. Load indicator on primary trading chart with default settings
2. Verify historical pre-training enabled (should see ~200 patterns in STM/LTM on first load)
3. Enable all dashboard sections for maximum transparency
4. Set alerts but DO NOT trade real money
Observation Checklist:
• Dashboard Validation:
✓ Lorentzian Core shows reasonable gamma (1-5 range, not stuck at 1.0 or spiking to 10)
✓ HFL oscillates with price action (not flat or random)
✓ Regime classifications make intuitive sense
✓ Confidence scores vary appropriately
• Memory System:
✓ STM fills within first few hours/days of real-time bars
✓ LTM grows gradually (few patterns per day, quality-gated)
✓ Predictions show directional bias (not always 0.0)
✓ Agreement metric fluctuates with regime changes
• Bootstrap Tracking:
✓ Dashboard shows "🔥 BOOTSTRAP (X/10)" for each regime
✓ Trade counts increment on regime-specific signals
✓ Different regimes reach threshold at different rates
Paper Trading:
• Take EVERY signal (ignore unfavorable warnings during bootstrap)
• Log each trade: entry price, regime, selected strategy, outcome
• Calculate your actual P&L assuming proper risk management (1-2% risk per trade)
• Do NOT judge system performance yet—focus on understanding behavior
Troubleshooting:
• No signals for days:
- Check base_quality_threshold (try lowering to 50-55)
- Verify enable_regime_filter not blocking all regimes
- Confirm signal confidence threshold not too high (try 0.25)
• Signals every bar:
- Raise base_quality_threshold to 65-70
- Increase min_bars_between to 8-10
- Check if gamma spiking excessively (raise c_multiplier)
• Memory not filling:
- Confirm enable_memory = true
- Verify historical pre-training completed (check STM size after load)
- May need to wait 10 bars for first real-time update
PHASE 2: VALIDATION (Week 5-12)
Statistical Emergence:
By week 5-8, most regimes should exit bootstrap. Look for:
✓ Regime Performance Clarity:
- At least 2-3 strategies showing positive Sharpe in their favored regimes
- Clear separation (Strategy B strong in Trending, Strategy A strong in Low Vol Range, etc.)
- Win rates stabilizing around 50-60% for winning strategies
✓ Shadow Portfolio Divergence:
- Virtual portfolios showing clear winners ($10K → $11K+) and losers ($10K → $9K-)
- Profit factors >1.3 for top strategy
- System selection aligning with best shadow portfolio
✓ Parameter Adaptation:
- Thresholds varying per regime (not stuck at initial values)
- Quality gates adapting (some regimes higher, some lower)
- Flow multipliers showing regime-specific optimization
Validation Questions:
1. Do patterns make intuitive sense?
- Strategy B (Flow) dominating Trending Bull/Bear? ✓ Expected
- Strategy A (Squeeze) succeeding in Low Vol Range? ✓ Expected
- Strategy C (Memory) working in High Vol Range? ✓ Expected
- Random strategy winning everywhere? ✗ Problem
2. Is unfavorable filtering working?
- Regimes with negative Sharpe showing "⚠️ UNFAVORABLE"? ✓ System protecting capital
- Transition regime often unfavorable? ✓ Expected
- All regimes perpetually unfavorable? ✗ Settings too strict or asset unsuitable
3. Are memories agreeing appropriately?
- High agreement during stable regimes? ✓ Expected
- Low agreement during transitions? ✓ Expected (novel conditions)
- Perpetual conflict? ✗ Check memory sizes or decay rates
Fine-Tuning (If Needed):
Too Many Signals in Losing Regimes:
→ Increase learning_rate to 0.07-0.08 (faster adaptation)
→ Raise base_quality_threshold by 5-10 points
→ Enable regime filter if disabled
Missing Profitable Setups:
→ Lower base_quality_threshold by 5-10 points
→ Reduce min_confidence to 0.25-0.30
→ Check if bootstrap mode blocking trades (let it complete)
Excessive Parameter Swings:
→ Reduce learning_rate to 0.03-0.04
→ Increase min_regime_samples to 15-20 (more data before adaptation)
Memory Disagreement Too Frequent:
→ Increase LTM size to 768-1024 (broader pattern library)
→ Lower adaptive_quality_gate requirement (allow more patterns)
→ Increase K neighbors to 10-12 (smoother predictions)
PHASE 3: LIVE TRADING (Month 4+)
Pre-Launch Checklist:
1. ✓ At least 3 regimes show positive Sharpe (>0.8)
2. ✓ Top shadow portfolio shows >53% win rate and >1.3 profit factor
3. ✓ Parameters have stabilized (not changing more than 10% per month)
4. ✓ You understand every dashboard metric and can explain regime/strategy behavior
5. ✓ You have proper risk management plan independent of this system
Position Sizing:
Conservative (Recommended for Month 4-6):
• Risk per trade: 0.5-1.0% of account
• Max concurrent positions: 1-2
• Total exposure: 10-25% of intended full size
Moderate (Month 7-12):
• Risk per trade: 1.0-1.5% of account
• Max concurrent positions: 2-3
• Total exposure: 25-50% of intended size
Full Scale (Year 2+):
• Risk per trade: 1.5-2.0% of account
• Max concurrent positions: 3-5
• Total exposure: 100% (still following risk limits)
Entry Execution:
On Signal Confirmation:
1. Verify dashboard shows signal type (▲ LONG or ▼ SHORT)
2. Check regime mode (avoid if "⚠️ UNFAVORABLE" unless testing)
3. Note selected strategy (A/B/C) and its regime Sharpe
4. Verify memory agreement if Strategy C selected (want >60%)
Entry Method:
• Market entry: Next bar open after signal (for exact backtest replication)
• Limit entry: Slight improvement (2-3 ticks) if confident in direction
Stop Loss Placement:
• Strategy A (Squeeze): Beyond opposite band or recent swing point
• Strategy B (Flow): 1.5-2.0 ATR from entry against direction
• Strategy C (Memory): Based on predicted move magnitude (tighter if pred > 2%)
Exit Management:
System Exit Signals:
• Opposite signal fires: Immediate exit, potential reversal entry
• 20 bars no exit signal: System implies position stale, consider exiting
• Regime changes to unfavorable: Tighten stop, consider partial exit
Manual Exit Conditions:
• Stop loss hit: Take loss, log for validation (system expects some losses)
• Profit target hit: If using fixed targets (2-3R typical)
• Major news event: Flatten during high-impact news (system can't predict these)
Warning Signs (Exit Criteria):
🚨 Stop Trading If:
1. All regimes show negative Sharpe for 4+ weeks (market structure changed)
2. Your results >20% worse than shadow portfolios (execution problem)
3. Parameters hitting extremes (thresholds >85 or <35 across all regimes)
4. Memory agreement <30% for extended periods (unprecedented conditions)
5. Account drawdown >20% (risk management failure, system or otherwise)
⚠️ Reduce Size If:
1. Win rate drops 10%+ from peak (temporary regime shift)
2. Selected strategy underperforming another by >30% (selection lag)
3. Consecutive losses >5 (variance or problem, reduce until clarity)
4. Major market regime change (Fed policy shift, war, etc. - let system re-adapt)
PART 15: THEORETICAL IMPLICATIONS & LIMITATIONS
WHAT THIS SYSTEM REPRESENTS:
Contextual Bandits:
The regime-specific strategy selection implements a contextual multi-armed bandit problem. Each strategy is an "arm," each regime is a "context," and we select arms to maximize expected reward given context. This is reinforcement learning applied to trading.
Experience Replay:
The dual-memory architecture mirrors DeepMind's DQN breakthrough. STM = recent experience buffer; LTM = validated experience replay. This prevents catastrophic forgetting while enabling rapid adaptation—a key challenge in neural network training.
Meta-Learning:
The system learns how to learn. Parameter adaptation adjusts the system's own sensitivity and selectivity based on outcomes. This is "learning to learn"—optimizing the optimization process itself.
Non-Stationary Optimization:
Traditional backtesting assumes stationarity (past patterns persist). This system assumes non-stationarity and continuously adapts. The goal isn't finding "the best parameters" but tracking the moving optimum.
Regime-Conditional Policies:
Rather than a single strategy for all conditions, this implements regime-specific policies. This is contextual decision-making—environment state determines action selection.
FINAL WISDOM:
"The market is a complex adaptive system. To trade it successfully, one must also adapt. This indicator provides the framework—memory, learning, regime awareness—but wisdom comes from understanding when to trade, when to stand aside, and when to defer to conditions the system hasn't yet learned. The edge isn't in the algorithm alone; it's in the partnership between mathematical rigor and human judgment."
— Inspired by the intersection of Einstein's relativity, Kahneman's behavioral economics, and decades of quantitative trading research
Taking you to school. — Dskyz, Trade with insight. Trade with anticipation.
MTF 20 SMA Table - DXY**MTF 20 SMA Table - Multi-Timeframe Trend Analysis Dashboard**
**Overview:**
This indicator provides a comprehensive multi-timeframe analysis dashboard that displays the relationship between price and the 20-period Simple Moving Average (SMA) across four key timeframes: 15-minute, 1-hour, 4-hour, and Daily. It's designed to help traders quickly identify trend alignment and potential trading opportunities across multiple timeframes at a glance. It's definitely not perfect but has helped me speed up my backtesting efforts as it's worked well for me eliminating flipping back and forth between timeframes excpet when I have confluence on the table, then I check the HTF.
**How It Works:**
The indicator creates a table overlay on your chart showing three critical metrics for each timeframe:
1. **Price vs SMA (Row 1):** Shows whether price is currently above (bullish) or below (bearish) the 20 SMA
- Green = Price Above SMA
- Red = Price Below SMA
2. **SMA Direction (Row 2):** Indicates the trend direction of the SMA itself over a lookback period
- Green (↗ Rising) = Uptrend
- Red (↘ Falling) = Downtrend
- Gray (→ Flat) = Ranging/Consolidation
3. **Strength (Row 3):** Displays the distance between current price and the SMA in pips
- Purple background = Strong move (>50 pips away)
- Orange background = Moderate move (20-50 pips)
- Gray background = Weak/consolidating (<20 pips)
- Text color: Green for positive distance, Red for negative
**Key Features:**
- **Customizable Table Position:** Place the table anywhere on your chart (9 position options)
- **Adjustable SMA Lengths:** Modify the SMA period for each timeframe independently (default: 20)
- **Direction Lookback Settings:** Fine-tune how far back the indicator looks to determine SMA direction for each timeframe
- **Flat Threshold:** Set the pip threshold for determining when an SMA is "flat" vs trending (default: 5 pips)
- **DXY Optimized:** Calculations are calibrated for the US Dollar Index (1 pip = 0.01)
**Best Use Cases:**
1. **Trend Alignment:** Identify when multiple timeframes align in the same direction for higher probability trades
2. **Divergence Spotting:** Detect when lower timeframes diverge from higher timeframes (potential reversals)
3. **Entry Timing:** Use lower timeframe signals while higher timeframes confirm overall trend
4. **Strength Assessment:** Gauge how extended price is from the mean (SMA) to avoid overextended entries
**Settings Guide:**
- **SMA Settings Group:** Adjust the SMA period for each timeframe (15M, 1H, 4H, Daily)
- **SMA Direction Group:** Control lookback periods to determine trend direction
- 15M: Default 5 candles
- 1H: Default 10 candles
- 4H: Default 15 candles
- Daily: Default 20 candles
- **Flat Threshold:** Set sensitivity for "flat" detection (lower = more sensitive to ranging markets)
**Trading Strategy Examples:**
1. **Trend Following:** Look for all timeframes showing the same direction (all green or all red)
2. **Pullback Trading:** When Daily/4H are green but 15M/1H show red, wait for lower timeframes to flip green for entry
3. **Ranging Markets:** When multiple SMAs show "flat", consider range-bound strategies
**Important Notes:**
- This is a reference tool only, not a standalone trading system
- Always use proper risk management and combine with other analysis methods
- Best suited for trending instruments like indices and major forex pairs
- Calculations are optimized for DXY but can be used on other instruments (pip calculations may need adjustment)
**Credits:**
Feel free to modify and improve this code! Suggestions for enhancements are welcome in the comments.
---
**Installation Instructions:**
1. Add the indicator to your TradingView chart
2. Adjust the table position via settings to avoid overlap with price action
3. Customize SMA lengths and lookback periods to match your trading style
4. Monitor the table for timeframe alignment and trend confirmation
---
This indicator is published as open source for the community to learn from and improve upon. Happy trading! 📈
BTC Backwardation SearcherThis Pine Script code is a custom indicator named "BTC Backwardation Searcher" designed for the TradingView platform. The indicator aims to identify and visualize the price difference between two Bitcoin futures contracts: CME:BTC1! and CME:BTC2!.
Here's a breakdown of the code:
1. The script fetches the daily close prices of CME:BTC1! and CME:BTC2! using the security() function.
2. It calculates the percentage price difference between the two contracts using the formula: (btc1Price - btc2Price) / btc2Price * 100.
3. The script also calculates the price difference for the previous two days (2 days ago and 3 days ago) using the same formula.
4. Two conditions are defined:
(1) dailyGreenCondition: If the price difference is greater than or equal to 0.3% for three
consecutive days, including the current day and the previous two days.
(2) dailyRedCondition(commented): If the price difference is less than or equal to -1% for three consecutive days, including the current day and the previous two days.
(I commented it out because I don't think it's useful.)
5. The plotshape() function is used to display green triangles on the chart when the dailyGreenCondition is met, and red triangles when the dailyRedCondition is met. These triangles are displayed on the daily, weekly, and monthly timeframes.
The purpose of this indicator is to help traders identify potential trading opportunities based on the price difference between the two Bitcoin futures contracts. The green triangles suggest a bullish scenario where CME:BTC1! is significantly higher than CME:BTC2!, while the red triangles indicate a bearish scenario where CME:BTC2! is significantly lower than CME:BTC1!.
However, it's important to note that this indicator should be used in conjunction with other technical analysis tools and fundamental analysis. Traders should also consider their risk tolerance, investment goals, and market conditions before making any trading decisions based on this indicator.
VSA MTF Dashboard OXEVSA Multi-Timeframe Dashboard
The VSA Multi-Timeframe Dashboard is a professional Volume Spread Analysis (VSA) scanner that detects institutional trading patterns across Daily, H4, and H1 timeframes simultaneously. It identifies when "smart money" (banks, hedge funds, institutions) is accumulating, distributing, or manipulating price, giving you an edge to trade with—not against—the professionals.
Price spread (high to low range)
Volume (trading activity)
Closing price (where the battle ended)
Core Principle: By reading volume and price action together, you can see what smart money is doing before retail traders catch on.The 7 VSA Patterns Detected
🟢 BULLISH PATTERNS (Buy Signals)PatternWhat It Looks LikeWhat It MeansWeightStopping VolumeDown bar + Ultra high volume + Close near highSmart money absorbing panic selling at lows. Strong reversal signal.+10SpringPrice makes new low, then closes back inside rangeLiquidity sweep below support. Bear trap - institutions buying cheap.+9No SupplyDown bar + Low volume + Narrow spreadNo selling pressure from professionals. Supply dried up.+8
🔴 BEARISH PATTERNS (Sell Signals)PatternWhat It Looks LikeWhat It MeansWeightUpthrustPrice makes new high, then closes back inside rangeLiquidity sweep above resistance. Bull trap - institutions selling high.-9No DemandUp bar + Low volume + Narrow spreadNo buying interest from professionals. Weakness at tops.-6
🟡 CONTEXT-DEPENDENT PATTERNSPatternWhat It Looks LikeWhat It MeansWeightClimactic ActionExtreme volume + Wide spreadExhaustion move. Buying climax = bearish. Selling climax = bullish.±7-8Effort vs ResultHigh volume + Narrow spreadSmart money absorption. High effort, little result = hidden weakness/strength.±7How to Read the DashboardTop Section: Current Market State┌──────────────────────────────┐
│ VSA Scanner │
├────┬──────────┬─────┬────────┤
│ TF │ Pattern │ Dir │ Pts │
├────┼──────────┼─────┼────────┤
│ D │ Upthrust │ ↓ │ -27 │ ← Daily trend
│ H4 │ No Supply│ ↑ │ +16 │ ← 4-hour trend
│ H1 │ Spring │ ↑ │ +9 │ ← 1-hour trend
├────┴──────────┴─────┴────────┤
│ ↑ 52% MODERATE BULLISH │ ← OVERALL BIAS
└──────────────────────────────┘Reading the signals:
TF (Timeframe): D = Daily, H4 = 4-hour, H1 = 1-hour
Pattern: Which VSA pattern is detected
Dir (Direction): ↑ = Bullish, ↓ = Bearish
Pts (Points): Weighted score (Daily = 3x, H4 = 2x, H1 = 1x)
Bottom Row = Aggregate Score:
0-50%: WEAK bias
50-75%: MODERATE bias
75-100%: STRONG bias
Bottom Section: Pattern ReferenceQuick reference guide showing all 7 patterns, their detection criteria, bias, and meaning. Always visible for learning.Trading Guidelines✅ HIGH PROBABILITY SETUPS1. Strong Confluence (75%+ Score)
All 3 timeframes aligned in same direction
Action: Aggressive entry in signal direction
Example: Daily Spring + H4 No Supply + H1 Spring = 85% BULLISH → BUY
2. HTF Dominance
Daily and H4 agree, H1 disagrees
Action: Trade with Daily/H4 bias (higher timeframes win)
Example: Daily/H4 bearish, H1 bullish → Wait for H1 to flip bearish, then SELL
3. Spring/Upthrust on Daily
Strongest reversal signals (liquidity sweeps)
Action: Major reversal trade opportunity
Example: Daily Spring after downtrend = significant bottom forming
⚠️ CAUTION ZONES1. Mixed Signals (30-50% Score)
Timeframes conflict
Action: WAIT for alignment or reduce position size
Example: Daily bullish, H4 bearish, H1 bullish = choppy, avoid
2. No Patterns Detected
All timeframes show "-"
Action: Market consolidating, wait for setup
3. Weak Bias (Below 50%)
Low conviction signals
Action: Scalp only or sit out
❌ AVOID
Trading against Daily timeframe (Daily always wins long-term)
Entering during mixed signals
Ignoring No Demand/No Supply (early distribution/accumulation warnings)
Indicator SettingsEssential Settings:SettingDefaultRecommendationDashboard PositionTop RightAdjust to avoid blocking chartLight ModeONTurn OFF if using dark chartsColor CandlesONKeep ON for visual pattern recognitionShow Candle LabelsOFFTurn ON if learning (shows UT, SPR, etc.)Volume Average Length20Don't change unless very experiencedATR Length14Standard setting, leave as isBest PracticesFor Swing Trading (Daily/H4):
Focus on Daily and H4 patterns (ignore H1)
Enter when both align
Use H4 Spring/Upthrust for precise entries
Target: Major support/resistance zones
For Day Trading (H4/H1):
Check Daily bias first (trade WITH it)
Use H4 for trend, H1 for entries
Enter on H1 Spring/Upthrust in direction of H4
Target: Intraday highs/lows
For Scalping (H1 only):
Only trade when H1 shows 70%+ score
Quick entries on Spring/Upthrust
Tight stops (10-15 pips on XAUUSD)
Target: 2:1 risk/reward minimum
Common QuestionsQ: Why does the score change when I switch timeframes?
A: The "bars ago" metric counts in your current chart timeframe. The pattern and bias remain the same, just the time reference changes. Focus on the pattern name and direction, not bars ago.Q: Can patterns repaint?
A: NO. Patterns only confirm after bar close. The dashboard shows live but patterns are stable.Q: What if Daily is bearish but H1 is bullish?
A: Daily ALWAYS wins. The H1 bullish move is likely a pullback in a bearish trend. Wait for H1 to flip bearish for best entries.Q: Should I trade every signal?
A: NO. Only trade when:
Score is 70%+ (strong conviction)
Multiple timeframes align
Pattern makes sense with overall trend
Q: How often do patterns appear?
A: Variable. You might see 2-5 signals per week on Daily, more frequently on H1. Quality over quantity.Quick Reference CardBULLISH SIGNALS TO BUY:
✅ Stopping Volume (strongest)
✅ Spring (liquidity grab)
✅ No Supply (weakness gone)
✅ Score: 70%+ BULLISH
BEARISH SIGNALS TO SELL:
✅ Upthrust (liquidity grab)
✅ No Demand (strength gone)
✅ Climactic Buying (exhaustion)
✅ Score: 70%+ BEARISH
STAY OUT:
❌ Mixed signals (30-50%)
❌ No patterns detected
❌ Timeframes conflicting
Example Trade SetupsPerfect Long Setup:
Daily: Spring ↑ +27 (Liquidity sweep)
H4: No Supply ↑ +16 (No sellers)
H1: Stopping Vol ↑ +10 (Absorption)
Score: 88% STRONG BULLISH
Action: BUY aggressively, target major resistancePerfect Short Setup:
Daily: Upthrust ↓ -27 (Liquidity trap)
H4: No Demand ↓ -12 (No buyers)
H1: Upthrust ↓ -9 (Fake breakout)
Score: 80% STRONG BEARISH
Action: SELL aggressively, target major supportAvoid This Setup:
Daily: No Supply ↑ +24 (Bullish)
H4: Upthrust ↓ -16 (Bearish)
H1: No Demand ↓ -6 (Bearish)
Score: 3% WEAK BULLISH (Mixed!)
Action: WAIT - Conflicting signals
HTF Current/Average RangeThe "HTF(Higher Timeframe) Current/Average Range" indicator calculates and displays the current and average price ranges across multiple timeframes, including daily, weekly, monthly, 4 hour, and user-defined custom timeframes.
Users can customize the lookback period, table size, timeframe, and font color; with the indicator efficiently updating on the final bar to optimize performance.
When the current range surpasses the average range for a given timeframe, the corresponding table cell is highlighted in green, indicating potential maximum price expansion and signaling the possibility of an impending retracement or consolidation.
For day trading strategies, the daily average range can serve as a guide, allowing traders to hold positions until the current daily range approaches or meets the average range, at which point exiting the trade may be considered.
For scalping strategies, the 15min and 5min average range can be utilized to determine optimal holding periods for fast trades.
Other strategies:
Intraday Trading - 1h and 4h Average Range
Swing Trading - Monthly Average Range
Short-term Trading - Weekly Average Range
Also using these statistics in accordance with Power 3 ICT concepts, will assist in holding trades to their statistical average range of the chosen HTF candle.
CODE
The core functionality lies in the data retrieval and table population sections.
The request.security function (e.g., = request.security(syminfo.tickerid, "D", , lookahead = barmerge.lookahead_off)) retrieves high and low prices from specified timeframes without lookahead bias, ensuring accurate historical data.
These values are used to compute current ranges and average ranges (ta.sma(high - low, avgLength)), which are then displayed in a dynamically generated table starting at (if barstate.islast) using table.new, with conditional green highlighting when the current range is greater than average range, providing a clear visual cue for volatility analysis.
HMA & D1 crossover FX (Study)Can work on other Forex pairs if change settings: Period
This example tuned for AUDUSD (FX Version)
Enter new order on HMA ( Hull Moving Average ) and D1 ( Daily Candle) crossovers, Exit orders as basket when profit = Your Target Profit
This study version built for users of Alerts. Crossover of HMA and DailyCandle1 (and/or DailyCandle1 cross DailyCandle2) (also possible Price cross HMA)
True Opens 🧪 [Pro +] | cephxsTRUE OPENS 🧪
This indicator reflects, and is based on Public Domain Information available online. Utilizing concepts by Daye and ICT.
Multi-timeframe True Open indicator displaying key price levels across Micro, 90-minute, Daily, Weekly, and Monthly cycles with automatic timeframe visibility gating.
OVERVIEW
True Opens identifies the opening price of the second quadrant (Q2) across multiple "quarterly" cycles. In quarterly cycle theory, Q2 represents the "True Open" - a significant reference point where price often returns to during the cycle. This indicator automatically plots these levels across five timeframes, helping you identify key premium/discount zones and potential reversal areas.
WHAT IS A TRUE OPEN?
Each market cycle divides into four quarters (Q1-Q4). The Q2 opening price - the "True Open" - acts as a gravitational level that price tends to respect throughout the cycle. Understanding where these levels sit across multiple timeframes gives you confluence zones for higher-probability trade setups depending on your strategy. It is mostly tailored to quarterly theory traders.
FEATURES
5 Cycle Levels: Micro (~22min), 90-minute, Daily (6H sessions), Weekly, and Monthly True Opens
Auto Display Mode: Automatically shows relevant True Opens based on your chart timeframe
Session Labels: Clear identification of Asia, London, NY, and PM session True Opens
Smart Weekly Detection: Uses trading day logic for accurate Weekly True Open on all assets
DST-Aware: Timezone handling automatically adjusts for daylight saving time
Visual Clarity: Dashed lines during active Q2, solid lines after confirmation
Historical Mode: Option to display past True Opens for backtesting reference
CYCLE BREAKDOWN
Micro: 64 sessions per day (~22.5 min each), 16 micro cycles - ideal for scalping
90-Minute: 4 major sessions (Asia, London, NY, PM) each with 4 quarters - intraday trading
Daily: 4 x 6-hour sessions per day - swing/intraday trade reference, slightly longer term
Weekly: Tuesday open = Weekly True Open (Q2 of the week) - swing trading
Monthly: Second week of month = Monthly True Open - macro bias
INPUTS
Master Toggles
Show Micro True Opens: Toggle micro-level True Opens
Show 90m True Opens: Toggle 90-minute session True Opens
Show Daily True Opens: Toggle daily cycle True Opens
Show Weekly True Opens: Toggle weekly True Opens
Show Monthly True Opens: Toggle monthly True Opens
Display Mode
Auto: Automatically shows appropriate True Opens for current timeframe
Custom: Define your own visibility ranges per cycle level
Colors
Fully customizable colors for each cycle level
Settings
Active Line Bar Offset: How far labels extend from current bar
Show Historical True Opens: Display past cycle True Opens
HOW TO USE
Add indicator to your chart
Use Auto mode for automatic timeframe-appropriate display
Watch for price reactions at True Open levels
Look for confluence when multiple True Opens align
RECOMMENDED TIMEFRAMES
1-minute: Micro True Opens visible
3-5 minute: 90m True Opens visible
15min - 1H: Daily True Opens visible
1H - 4H: Weekly True Opens visible
4H - Daily: Monthly True Opens visible
BEST PRACTICES
Combine with market structure analysis for confirmation
True Opens can be used as time based Premium and Discount Levels
Multiple True Opens near same price = strong confluence zone (Stacked True Opens)
Weekly and Monthly True Opens carry more weight for directional bias
Use Micro True Opens for precision entries on lower timeframes
ASSETS
Works on all markets: Forex, Crypto, Indices, Stocks, and Futures. Weekly True Open detection uses smart trading-day logic that handles assets with non-standard session opens (e.g., ES futures opening Sunday 6PM).
DISCLAIMER
This indicator is for educational and informational purposes only. It does not constitute financial advice. Past performance does not guarantee future results. Always conduct your own research and use proper risk management. Trade responsibly.
CHANGELOG
v1.0: Initial release with 5-level True Open system
with ❤️ from cephxs
Quarterly Theory (Lé Modél) 🧪 [Ultimate +] | cephxsQUARTERLY THEORY (LÉ MODÉL) 🧪
SSMT + Timed Structural Swing Points + Alerts
This is mostly types using voice typing so the punctuation might be off.
This indicator uses public domain information based on a trading system called "Quarterly Theory" by TraderDaye & ICT. All concepts are freely available educational material that's been around for years. I just built a tool to visualize it properly.
WHAT IS THIS?
Alright so basically this is my attempt (pretty good attempt I'd say) at building the ultimate quarterly theory tool. It tracks multiple timeframe cycles (monthly, weekly, daily, 90m, and micro) and detects when correlated assets are diverging from each other at key swing points. That's the SSMT (sequential smt) part otherwise called an Offset Divergence either in an Accumulation/distribution phase of price.
On top of that, it finds timed structural swing points with their exact formation times, detects liquidity purges, and confirms change in state of delivery (CISD) through orderblock reclaims. Everything is wrapped in a pretty comprehensive alert system so you can actually trade off this stuff without staring at charts 24/7.
CORE FEATURES
Multi-Cycle SSMT Detection: tracks divergences across 5 nested cycles - monthly, weekly, daily, 90m, and micro. each cycle has its own visibility gates so you're only seeing what's relevant to your chart timeframe. They are also customizable so you are not restricted to what I think is best; nevertheless, hard gates are put in place to prevent unnecessary data calls too far back into history to allow users of all plans to use without errors (Bar data limits)
Timed Swing Points: every pivot high/low gets timestamped. you'll see exactly when the swing formed - super useful for macro window analysis (those :00-:10 and :50-:00 minute windows).
Liquidity Purges: automatically detects when price sweeps a previous swing high/low and reverses. shows both the sweep level and confirmation.
CISD (Change In State of Delivery): finds the stretch candle at pivots and waits for price to reclaim it. that's your delivery change confirmation.
Auto Asset Detection: just throw it on any chart and it figures out the correlated assets for you. works with indices ( CME_MINI:NQ1! , CME_MINI:ES1! , CBOT_MINI:YM1! ), forex majors ( FOREXCOM:EURUSD , FOREXCOM:GBPUSD ), metals ( FOREXCOM:XAUUSD , FOREXCOM:XAGUSD ), crypto, and more.
Normal + Hidden Divergences: normal divergence is when extremes diverge between assets. hidden divergence uses body closes instead of wicks - sometimes catches moves that normal misses.
Comprehensive Alert System: atomic alerts for individual events, preset combos for multi-confluence setups, and a custom "alert kitchen" to build your own conditions.
Each of these features can be visually disabled individually while the logic is still computed and alerts still function without bother.
THE CYCLES EXPLAINED
quarterly theory breaks time down into nested fractal cycles. each cycle divides into 4 quarters (Q1, Q2, Q3, Q4) where Q2 is typically expansion/displacement:
Monthly Cycle: tracks the 4 weeks of the month. best viewed on 4H charts and above
Weekly Cycle: Mon-Tue-Wed-Thu-Fri as the 5 "quarters". best on 1H charts.
Daily Cycle: the trading day split into 4 sessions (asia, london, ny am, ny pm). best on 15m.
90m Cycle: 6 x 90-minute windows throughout the day. best on 3-5m charts.
Micro Cycle: 22.5-minute quarters within each 90m block. 1m charts only.
Tried to implement a new Quarterly Cycle, will defer that to a later update.
VISIBILITY GATES
the indicator automatically shows/hides cycles based on your chart timeframe. here's how it works:
Auto Mode (recommended):
Micro: 1m only
90m: 3m-5m
Daily: 15m only
Weekly: 1H only
Monthly: 4H only
Extended Mode (more flexibility):
Micro: 1m-3m
90m: 1m-30m
Daily: 5m-1H
Weekly: 15m-4H
Monthly: 4H-1D
you can also set custom ranges or just show everything with "All" mode.
INPUTS BREAKDOWN
Visual Preset
All Features: shows everything - SSMT, time labels, CISD, purges
SSMT + TIME + CISD: hides purge lines for cleaner charts
SSMT + CISD: hides time labels too
SSMT Only: just the divergence lines, nothing else
SSMT Plots (Section 2)
Extreme Detection Mode: "Normal" uses wick extremes, "Hidden" uses body closes, "All" shows both
Per-Cycle Toggles: enable/disable each cycle independently with custom colors
Label Styling: choose between "Cycle + Asset", "Cycle" only, or "Asset" only labels
Pivot Detection (Section 3)
Sensitivity: controls how many bars on each side to confirm a swing (default: 2)
Maximum Points: limits how many pivots are displayed
Pivot Labels (Section 4)
Show Time Labels: displays the exact timestamp of each swing
Key Times Only: only shows labels for swings in macro windows (:00-:10, :24-:36, :50-:59)
Macro Colors: special highlighting for pivots during macro windows
Purge Detection (Section 5-6)
Pending Timeout: how many bars a purge can wait for confirmation before being discarded
Strict Key Time: requires both the sweep AND confirmation to be in key time windows
Dotted Line Offset: how far the confirmation line extends past the reversal candle
CISD Detection (Section 7-8)
Size Filter: filters out tiny orderblocks using ATR-based sizing. options from "Really Small" (shows most) to "Juicy" (only big ones)
Pending Timeout: bars before an unconfirmed CISD expires
Exhaustive Mode: shows all valid CISDs instead of limiting to max count
ALERT SYSTEM
this is where it gets powerful. three tiers of alerts:
Atomic Alerts (individual events):
Swing High/Low formed
Bearish/Bullish Purge confirmed
CISD Confirmed/Pending
Purge + CISD Combo
Preset Combos (multi-confluence):
M/W/D/90/Micro SSMT + CISD: fires when SSMT divergence is active AND CISD confirms in matching direction
Require Matching Purge: adds purge to the combo requirement
Stacked Alerts: triggers when 2+ cycles align simultaneously
Alert Kitchen (custom builder):
build your own combo by selecting:
Which SSMT cycle (with direction: bullish/bearish/any)
Whether CISD is required
Whether matching purge is required
Purge tolerance (how close the purge pivot needs to be)
Session Filter:
all alerts can be filtered to only fire during specific sessions:
Asia: 18:00-00:00 ET
London: 02:00-05:00 ET
NY AM: 08:30-12:00 ET
NY PM: 13:30-16:00 ET
Custom time ranges
AUTO ASSET DETECTION
the indicator uses the AssetCorrelation library to automatically figure out which assets to compare. here's what it supports:
US Indices: CME_MINI:NQ1! , CME_MINI:ES1! , CBOT_MINI:YM1! (or micros MNQ/MES/MYM)
Forex Majors: FOREXCOM:EURUSD , FOREXCOM:GBPUSD vs TVC:DXY
Metals: FOREXCOM:XAUUSD , FOREXCOM:XAGUSD , Copper
Energy: CL (crude), RB (gasoline), HO (heating oil)
Crypto: BTC, ETH, TOTAL3 as triad
EU Indices: GER40, EU50, UK100, ESP35
you can also disable auto mode and manually configure your own asset triads/dyads.
STATUS BAR
optional horizontal bar showing which SSMT cycles are currently active. displays M | W | D | 90m | Micro with color coding:
Blue = bullish divergence active
Red = bearish divergence active
Gray = neutral (no divergence)
Purple = both directions active simultaneously (sandwich)
RECOMMENDED USAGE
start with "Auto" timeframe gating - it shows the right cycles for your chart
focus on cycles that align with your trading style (scalpers: 90m/micro, swing: daily/weekly)
use CISD confirmation before entries - divergence alone isn't enough (at least for me)
Pair with True Opens to align properly (This is a trading model in itself)
set up preset alerts for your main setup (e.g., "D SSMT + CISD" on 15m chart)
filter alerts to your active trading session to reduce noise
TIMEFRAME CHEAT SHEET
1m: Micro cycle + 90m context
3-5m: 90m cycle + Daily context
15m: Daily cycle + Weekly context
1H: Weekly cycle + Monthly context
4H: Monthly cycle only
FAQ
why don't i see any SSMT lines?
check your timeframe gating mode. if you're on a 15m chart with "Auto" mode, you'll only see Daily cycle. switch to "Extended" or "All" to see more cycles.
what's the difference between normal and hidden divergence?
normal uses wick highs/lows, hidden uses body closes. hidden can catch divergences that wicks miss, but it's also noisier.
Why do some CISDs not confirm?
the stretch candle needs to be reclaimed by price within the timeout window. if price never comes back to that level, the CISD expires.
can i use this on stocks?
technically yes, but you'll need to manually configure your asset pairs since auto-detection focuses on futures/forex/crypto.
DISCLAIMER
this is an educational tool, not financial advice. quarterly theory, SSMT, and all related concepts are based on publicly available information from TraderDaye and ICT methodology on X with a touch of my own discoveries too.
past performance doesn't guarantee future results. always use proper risk management and never trade more than you can afford to lose. the indicator is provided as-is with no guarantees.
do your own backtesting before using this in live markets.
CREDITS
Quarterly Theory concepts: TraderDaye & ICT
AssetCorrelation library: fstarcapital
Development: cephxs & fstarcapital community
CHANGELOG
Ultimate +: added Alert Kitchen, stacked cycle alerts, session filtering, status bar, size-filtered CISD
Pro +: added hidden divergences, added sweep detection/plots, auto asset detection, preset combos
Base: initial release with core SSMT and pivot time labels
No form of this Library is to be sold in any capacity as part of any service / indicator on the TradingView Platform or elsewhere by anyone else but me.
Otherwise it is completely free to use in private and public open/closed source indicators.
Sidenote: 3rd upload because I'm trying to get the thumbnail right :(
Made with ❤️ from cephxs
Luxy Super-Duper SuperTrend Predictor Engine and Buy/Sell signalA professional trend-following grading system that analyzes historical trend
patterns to provide statistical duration estimates using advanced similarity
matching and k-nearest neighbors analysis. Combines adaptive Supertrend with
intelligent duration statistics, multi-timeframe confluence, volume confirmation,
and quality scoring to identify high-probability setups with data-driven
target ranges across all timeframes.
Note: All duration estimates are statistical calculations based on historical data, not guarantees of future performance.
WHAT MAKES THIS DIFFERENT
Unlike traditional SuperTrend indicators that only tell you trend direction, this system answers the critical question: "What is the typical duration for trends like this?"
The Statistical Analysis Engine:
• Analyzes your chart's last 15+ completed SuperTrend trends (bullish and bearish separately)
• Uses k-nearest neighbors similarity matching to find historically similar setups
• Calculates statistical duration estimates based on current market conditions
• Learns from estimation errors and adapts over time (Advanced mode)
• Displays visual duration analysis box showing median, average, and range estimates
• Tracks Statistical accuracy with backtest statistics
Complete Trading System:
• Statistical trend duration analysis with three intelligence levels
• Adaptive Supertrend with dynamic ATR-based bands
• Multi-timeframe confluence analysis (6 timeframes: 5M to 1W)
• Volume confirmation with spike detection and momentum tracking
• Quality scoring system (0-70 points) rating each setup
• One-click preset optimization for all trading styles
• Anti-repaint guarantee on all signals and duration estimates
METHODOLOGY CREDITS
This indicator's approach is inspired by proven trading methodologies from respected market educators:
• Mark Minervini - Volatility Contraction Pattern (VCP) and pullback entry techniques
• William O'Neil - Volume confirmation principles and institutional buying patterns (CANSLIM methodology)
• Dan Zanger - Volatility expansion entries and momentum breakout strategies
Important: These are educational references only. This indicator does not guarantee any specific trading results. Always conduct your own analysis and risk management.
KEY FEATURES
1. TREND DURATION ANALYSIS SYSTEM - The Core Innovation
The statistical analysis engine is what sets this indicator apart from standard SuperTrend systems. It doesn't just identify trend changes - it provides statistical analysis of potential duration.
How It Works:
Step 1: Historical Tracking
• Automatically records every completed SuperTrend trend (duration in bars)
• Maintains separate databases for bullish trends and bearish trends
• Stores up to 15 most recent trends of each type
• Captures market conditions at each trend flip: volume ratio, ATR ratio, quality score, price distance from SuperTrend, proximity to support/resistance
Step 2: Similarity Matching (k-Nearest Neighbors)
• When new trend begins, system compares current conditions to ALL historical flips
• Calculates similarity score based on:
- Volume similarity (30% weight) - Is volume behaving similarly?
- Volatility similarity (30% weight) - Is ATR/volatility similar?
- Quality similarity (20% weight) - Is setup strength comparable?
- Distance similarity (10% weight) - Is price distance from ST similar?
- Support/Resistance proximity (10% weight) - Similar structural context?
• Selects the 15 MOST SIMILAR historical trends (not just all trends)
• This is like asking: "When conditions looked like this before, how long did trends last?"
Step 3: Statistical Analysis
• Calculates median duration (most common outcome)
• Calculates average duration (mean of similar trends)
• Determines realistic range (min to max of similar trends)
• Applies exponential weighting (recent trends weighted more heavily)
• Outputs confidence-weighted statistical estimate
Step 4: Advanced Intelligence (Advanced Mode Only)
The Advanced mode applies five sophisticated multipliers to refine estimates:
A) Market Structure Multiplier (±30%):
• Detects nearby support/resistance levels using pivot detection
• If flip occurs NEAR a key level: Estimate adjusted -30% (expect bounce/rejection)
• If flip occurs in open space: Estimate adjusted +30% (clear path for continuation)
• Uses configurable lookback period and ATR-based proximity threshold
B) Asset Type Multiplier (±40%):
• Adjusts duration estimates based on asset volatility characteristics
• Small Cap / Biotech: +40% (explosive, extended moves)
• Tech Growth: +20% (momentum-driven, longer trends)
• Blue Chip / Large Cap: 0% (baseline, steady trends)
• Dividend / Value: -20% (slower, grinding trends)
• Cyclical: Variable based on macro regime
• Crypto / High Volatility: +30% (parabolic potential)
C) Flip Strength Multiplier (±20%):
• Analyzes the QUALITY of the trend flip itself
• Strong flip (high volume + expanding ATR + quality score 60+): +20%
• Weak flip (low volume + contracting ATR + quality score under 40): -20%
• Logic: Historical data shows that powerful flips tend to be followed by longer trends
D) Error Learning Multiplier (±15%):
• Tracks Statistical accuracy over last 10 completed trends
• Calculates error ratio: (estimated duration / Actual Duration)
• If system consistently over-estimates: Apply -15% correction
• If system consistently under-estimates: Apply +15% correction
• Learns and adapts to current market regime
E) Regime Detection Multiplier (±20%):
• Analyzes last 3 trends of SAME TYPE (bull-to-bull or bear-to-bear)
• Compares recent trend durations to historical average
• If recent trends 20%+ longer than average: +20% adjustment (trending regime detected)
• If recent trends 20%+ shorter than average: -20% adjustment (choppy regime detected)
• Detects whether market is in trending or mean-reversion mode
Three analysis modes:
SIMPLE MODE - Basic Statistics
• Uses raw median of similar trends only
• No multipliers, no adjustments
• Best for: Beginners, clean trending markets
• Fastest calculations, minimal complexity
STANDARD MODE - Full Statistical Analysis
• Similarity matching with k-nearest neighbors
• Exponential weighting of recent trends
• Median, average, and range calculations
• Best for: Most traders, general market conditions
• Balance of accuracy and simplicity
ADVANCED MODE - Statistics + Intelligence
• Everything in Standard mode PLUS
• All 5 advanced multipliers (structure, asset type, flip strength, learning, regime)
• Highest Statistical accuracy in testing
• Best for: Experienced traders, volatile/complex markets
• Maximum intelligence, most adaptive
Visual Duration Analysis Box:
When a new trend begins (SuperTrend flip), a box appears on your chart showing:
• Analysis Mode (Simple / Standard / Advanced)
• Number of historical trends analyzed
• Median expected duration (most likely outcome)
• Average expected duration (mean of similar trends)
• Range (minimum to maximum from similar trends)
• Advanced multipliers breakdown (Advanced mode only)
• Backtest accuracy statistics (if available)
The box extends from the flip bar to the estimated endpoint based on historical data, giving you a visual target for trend duration. Box updates in real-time as trend progresses.
Backtest & Accuracy Tracking:
• System backtests its own duration estimates using historical data
• Shows accuracy metrics: how well duration estimates matched actual durations
• Tracks last 10 completed duration estimates separately
• Displays statistics in dashboard and duration analysis boxes
• Helps you understand statistical reliability on your specific symbol/timeframe
Anti-Repaint Guarantee:
• duration analysis boxes only appear AFTER bar close (barstate.isconfirmed)
• Historical duration estimates never disappear or change
• What you see in history is exactly what you would have seen real-time
• No future data leakage, no lookahead bias
2. INTELLIGENT PRESET CONFIGURATIONS - One-Click Optimization
Unlike indicators that require tedious parameter tweaking, this system includes professionally optimized presets for every trading style. Select your approach from the dropdown and ALL parameters auto-configure.
"AUTO (DETECT FROM TF)" - RECOMMENDED
The smartest option: automatically selects optimal settings based on your chart timeframe.
• 1m-5m charts → Scalping preset (ATR: 7, Mult: 2.0)
• 15m-1h charts → Day Trading preset (ATR: 10, Mult: 2.5)
• 2h-4h-D charts → Swing Trading preset (ATR: 14, Mult: 3.0)
• W-M charts → Position Trading preset (ATR: 21, Mult: 4.0)
Benefits:
• Zero configuration - works immediately
• Always matched to your timeframe
• Switch timeframe = automatic adjustment
• Perfect for traders who use multiple timeframes
"SCALPING (1-5M)" - Ultra-Fast Signals
Optimized for: 1-5 minute charts, high-frequency trading, quick profits
Target holding period: Minutes to 1-2 hours maximum
Best markets: High-volume stocks, major crypto pairs, active futures
Parameter Configuration:
• Supertrend: ATR 7, Multiplier 2.0 (very sensitive)
• Volume: MA 10, High 1.8x, Spike 3.0x (catches quick surges)
• Volume Momentum: AUTO-DISABLED (too restrictive for fast scalping)
• Quality minimum: 40 points (accepts more setups)
• Duration Analysis: Uses last 15 trends with heavy recent weighting
Trading Logic:
Speed over precision. Short ATR period and low multiplier create highly responsive SuperTrend. Volume momentum filter disabled to avoid missing fast moves. Quality threshold relaxed to catch more opportunities in rapid market conditions.
Signals per session: 5-15 typically
Hold time: Minutes to couple hours
Best for: Active traders with fast execution
"DAY TRADING (15M-1H)" - Balanced Approach
Optimized for: 15-minute to 1-hour charts, intraday moves, session-based trading
Target holding period: 30 minutes to 8 hours (within trading day)
Best markets: Large-cap stocks, major indices, established crypto
Parameter Configuration:
• Supertrend: ATR 10, Multiplier 2.5 (balanced)
• Volume: MA 20, High 1.5x, Spike 2.5x (standard detection)
• Volume Momentum: 5/20 periods (confirms intraday strength)
• Quality minimum: 50 points (good setups preferred)
• Duration Analysis: Balanced weighting of recent vs historical
Trading Logic:
The most balanced configuration. ATR 10 with multiplier 2.5 provides steady trend following that avoids noise while catching meaningful moves. Volume momentum confirms institutional participation without being overly restrictive.
Signals per session: 2-5 typically
Hold time: 30 minutes to full day
Best for: Part-time and full-time active traders
"SWING TRADING (4H-D)" - Trend Stability
Optimized for: 4-hour to Daily charts, multi-day holds, trend continuation
Target holding period: 2-15 days typically
Best markets: Growth stocks, sector ETFs, trending crypto, commodity futures
Parameter Configuration:
• Supertrend: ATR 14, Multiplier 3.0 (stable)
• Volume: MA 30, High 1.3x, Spike 2.2x (accumulation focus)
• Volume Momentum: 10/30 periods (trend stability)
• Quality minimum: 60 points (high-quality setups only)
• Duration Analysis: Favors consistent historical patterns
Trading Logic:
Designed for substantial trend moves while filtering short-term noise. Higher ATR period and multiplier create stable SuperTrend that won't flip on minor corrections. Stricter quality requirements ensure only strongest setups generate signals.
Signals per week: 2-5 typically
Hold time: Days to couple weeks
Best for: Part-time traders, swing style
"POSITION TRADING (D-W)" - Long-Term Trends
Optimized for: Daily to Weekly charts, major trend changes, portfolio allocation
Target holding period: Weeks to months
Best markets: Blue-chip stocks, major indices, established cryptocurrencies
Parameter Configuration:
• Supertrend: ATR 21, Multiplier 4.0 (very stable)
• Volume: MA 50, High 1.2x, Spike 2.0x (long-term accumulation)
• Volume Momentum: 20/50 periods (major trend confirmation)
• Quality minimum: 70 points (excellent setups only)
• Duration Analysis: Heavy emphasis on multi-year historical data
Trading Logic:
Conservative approach focusing on major trend changes. Extended ATR period and high multiplier create SuperTrend that only flips on significant reversals. Very strict quality filters ensure signals represent genuine long-term opportunities.
Signals per month: 1-2 typically
Hold time: Weeks to months
Best for: Long-term investors, set-and-forget approach
"CUSTOM" - Advanced Configuration
Purpose: Complete manual control for experienced traders
Use when: You understand the parameters and want specific optimization
Best for: Testing new approaches, unusual market conditions, specific instruments
Full control over:
• All SuperTrend parameters
• Volume thresholds and momentum periods
• Quality scoring weights
• analysis mode and multipliers
• Advanced features tuning
Preset Comparison Quick Reference:
Chart Timeframe: Scalping (1M-5M) | Day Trading (15M-1H) | Swing (4H-D) | Position (D-W)
Signals Frequency: Very High | High | Medium | Low
Hold Duration: Minutes | Hours | Days | Weeks-Months
Quality Threshold: 40 pts | 50 pts | 60 pts | 70 pts
ATR Sensitivity: Highest | Medium | Lower | Lowest
Time Investment: Highest | High | Medium | Lowest
Experience Level: Expert | Advanced | Intermediate | Beginner+
3. QUALITY SCORING SYSTEM (0-70 Points)
Every signal is rated in real-time across three dimensions:
Volume Confirmation (0-30 points):
• Volume Spike (2.5x+ average): 30 points
• High Volume (1.5x+ average): 20 points
• Above Average (1.0x+ average): 10 points
• Below Average: 0 points
Volatility Assessment (0-30 points):
• Expanding ATR (1.2x+ average): 30 points
• Rising ATR (1.0-1.2x average): 15 points
• Contracting/Stable ATR: 0 points
Volume Momentum (0-10 points):
• Strong Momentum (1.2x+ ratio): 10 points
• Rising Momentum (1.0-1.2x ratio): 5 points
• Weak/Neutral Momentum: 0 points
Score Interpretation:
60-70 points - EXCELLENT:
• All factors aligned
• High conviction setup
• Maximum position size (within risk limits)
• Primary trading opportunities
45-59 points - STRONG:
• Multiple confirmations present
• Above-average setup quality
• Standard position size
• Good trading opportunities
30-44 points - GOOD:
• Basic confirmations met
• Acceptable setup quality
• Reduced position size
• Wait for additional confirmation or trade smaller
Below 30 points - WEAK:
• Minimal confirmations
• Low probability setup
• Consider passing
• Only for aggressive traders in strong trends
Only signals meeting your minimum quality threshold (configurable per preset) generate alerts and labels.
4. MULTI-TIMEFRAME CONFLUENCE ANALYSIS
The system can simultaneously analyze trend alignment across 6 timeframes (optional feature):
Timeframes analyzed:
• 5-minute (scalping context)
• 15-minute (intraday momentum)
• 1-hour (day trading bias)
• 4-hour (swing context)
• Daily (primary trend)
• Weekly (macro trend)
Confluence Interpretation:
• 5-6/6 aligned - Very strong multi-timeframe agreement (highest confidence)
• 3-4/6 aligned - Moderate agreement (standard setup)
• 1-2/6 aligned - Weak agreement (caution advised)
Dashboard shows real-time alignment count with color-coding. Higher confluence typically correlates with longer, stronger trends.
5. VOLUME MOMENTUM FILTER - Institutional Money Flow
Unlike traditional volume indicators that just measure size, Volume Momentum tracks the RATE OF CHANGE in volume:
How it works:
• Compares short-term volume average (fast period) to long-term average (slow period)
• Ratio above 1.0 = Volume accelerating (money flowing IN)
• Ratio above 1.2 = Strong acceleration (institutional participation likely)
• Ratio below 0.8 = Volume decelerating (money flowing OUT)
Why it matters:
• Confirms trend with actual money flow, not just price
• Leading indicator (volume often leads price)
• Catches accumulation/distribution before breakouts
• More intuitive than complex mathematical filters
Integration with signals:
• Optional filter - can be enabled/disabled per preset
• When enabled: Only signals with rising volume momentum fire
• AUTO-DISABLED in Scalping mode (too restrictive for fast trading)
• Configurable fast/slow periods per trading style
6. ADAPTIVE SUPERTREND MULTIPLIER
Traditional SuperTrend uses fixed ATR multiplier. This system dynamically adjusts the multiplier (0.8x to 1.2x base) based on:
• Trend Strength: Price correlation over lookback period
• Volume Weight: Current volume relative to average
Benefits:
• Tighter bands in calm markets (less premature exits)
• Wider bands in volatile conditions (avoids whipsaws)
• Better adaptation to biotech, small-cap, and crypto volatility
• Optional - can be disabled for classic constant multiplier
7. VISUAL GRADIENT RIBBON
26-layer exponential gradient fill between price and SuperTrend line provides instant visual trend strength assessment:
Color System:
• Green shades - Bullish trend + volume confirmation (strongest)
• Blue shades - Bullish trend, normal volume
• Orange shades - Bearish trend + volume confirmation
• Red shades - Bearish trend (weakest)
Opacity varies based on:
• Distance from SuperTrend (farther = more opaque)
• Volume intensity (higher volume = stronger color)
The ribbon provides at-a-glance trend strength without cluttering your chart. Can be toggled on/off.
8. INTELLIGENT ALERT SYSTEM
Two-tier alert architecture for flexibility:
Automatic Alerts:
• Fire automatically on BUY and SELL signals
• Include full context: quality score, volume state, volume momentum
• One alert per bar close (alert.freq_once_per_bar_close)
• Message format: "BUY: Supertrend bullish + Quality: 65/70 | Volume: HIGH | Vol Momentum: STRONG (1.35x)"
Customizable Alert Conditions:
• Appear in TradingView's "Create Alert" dialog
• Three options: BUY Signal Only, SELL Signal Only, ANY Signal (BUY or SELL)
• Use TradingView placeholders: {{ticker}}, {{interval}}, {{close}}, {{time}}
• Fully customizable message templates
All alerts use barstate.isconfirmed - Zero repaint guarantee.
9. ANTI-REPAINT ARCHITECTURE
Every component guaranteed non-repainting:
• Entry signals: Only appear after bar close
• duration analysis boxes: Created only on confirmed SuperTrend flips
• Informative labels: Wait for bar confirmation
• Alerts: Fire once per closed bar
• Multi-timeframe data: Uses lookahead=barmerge.lookahead_off
What you see in history is exactly what you would have seen in real-time. No disappearing signals, no changed duration estimates.
HOW TO USE THE INDICATOR
QUICK START - 3 Steps to Trading:
Step 1: Select Your Trading Style
Open indicator settings → "Quick Setup" section → Trading Style Preset dropdown
Options:
• Auto (Detect from TF) - RECOMMENDED: Automatically configures based on your chart timeframe
• Scalping (1-5m) - For 1-5 minute charts, ultra-fast signals
• Day Trading (15m-1h) - For 15m-1h charts, balanced approach
• Swing Trading (4h-D) - For 4h-Daily charts, trend stability
• Position Trading (D-W) - For Daily-Weekly charts, long-term trends
• Custom - Manual configuration (advanced users only)
Choose "Auto" and you're done - all parameters optimize automatically.
Step 2: Understand the Signals
BUY Signal (Green Triangle Below Price):
• SuperTrend flipped bullish
• Quality score meets minimum threshold (varies by preset)
• Volume confirmation present (if filter enabled)
• Volume momentum rising (if filter enabled)
• duration analysis box shows expected trend duration
SELL Signal (Red Triangle Above Price):
• SuperTrend flipped bearish
• Quality score meets minimum threshold
• Volume confirmation present (if filter enabled)
• Volume momentum rising (if filter enabled)
• duration analysis box shows expected trend duration
Duration Analysis Box:
• Appears at SuperTrend flip (start of new trend)
• Shows median, average, and range duration estimates
• Extends to estimated endpoint based on historical data visually
• Updates mode-specific intelligence (Simple/Standard/Advanced)
Step 3: Use the Dashboard for Context
Dashboard (top-right corner) shows real-time metrics:
• Row 1 - Quality Score: Current setup rating (0-70)
• Row 2 - SuperTrend: Direction and current level
• Row 3 - Volume: Status (Spike/High/Normal/Low) with color
• Row 4 - Volatility: State (Expanding/Rising/Stable/Contracting)
• Row 5 - Volume Momentum: Ratio and trend
• Row 6 - Duration Statistics: Accuracy metrics and track record
Every cell has detailed tooltip - hover for full explanations.
SIGNAL INTERPRETATION BY QUALITY SCORE:
Excellent Setup (60-70 points):
• Quality Score: 60-70
• Volume: Spike or High
• Volatility: Expanding
• Volume Momentum: Strong (1.2x+)
• MTF Confluence (if enabled): 5-6/6
• Action: Primary trade - maximum position size (within risk limits)
• Statistical reliability: Highest - duration estimates most accurate
Strong Setup (45-59 points):
• Quality Score: 45-59
• Volume: High or Above Average
• Volatility: Rising
• Volume Momentum: Rising (1.0-1.2x)
• MTF Confluence (if enabled): 3-4/6
• Action: Standard trade - normal position size
• Statistical reliability: Good - duration estimates reliable
Good Setup (30-44 points):
• Quality Score: 30-44
• Volume: Above Average
• Volatility: Stable or Rising
• Volume Momentum: Neutral to Rising
• MTF Confluence (if enabled): 3-4/6
• Action: Cautious trade - reduced position size, wait for additional confirmation
• Statistical reliability: Moderate - duration estimates less certain
Weak Setup (Below 30 points):
• Quality Score: Below 30
• Volume: Low or Normal
• Volatility: Contracting or Stable
• Volume Momentum: Weak
• MTF Confluence (if enabled): 1-2/6
• Action: Pass or wait for improvement
• Statistical reliability: Low - duration estimates unreliable
USING duration analysis boxES FOR TRADE MANAGEMENT:
Entry Timing:
• Enter on SuperTrend flip (signal bar close)
• duration analysis box appears simultaneously
• Note the median duration - this is your expected hold time
Profit Targets:
• Conservative: Use MEDIAN duration as profit target (50% probability)
• Moderate: Use AVERAGE duration (mean of similar trends)
• Aggressive: Aim for MAX duration from range (best historical outcome)
Position Management:
• Scale out at median duration (take partial profits)
• Trail stop as trend extends beyond median
• Full exit at average duration or SuperTrend flip (whichever comes first)
• Re-evaluate if trend exceeds estimated range
analysis mode Selection:
• Simple: Clean trending markets, beginners, minimal complexity
• Standard: Most markets, most traders (recommended default)
• Advanced: Volatile markets, complex instruments, experienced traders seeking highest accuracy
Asset Type Configuration (Advanced Mode):
If using Advanced analysis mode, configure Asset Type for optimal accuracy:
• Small Cap: Stocks under $2B market cap, low liquidity
• Biotech / Speculative: Clinical-stage pharma, penny stocks, high-risk
• Blue Chip / Large Cap: S&P 500, mega-cap tech, stable large companies
• Tech Growth: High-growth tech (TSLA, NVDA, growth SaaS)
• Dividend / Value: Dividend aristocrats, value stocks, utilities
• Cyclical: Energy, materials, industrials (macro-driven)
• Crypto / High Volatility: Bitcoin, altcoins, highly volatile assets
Correct asset type selection improves Statistical accuracy by 15-20%.
RISK MANAGEMENT GUIDELINES:
1. Stop Loss Placement:
Long positions:
• Place stop below recent swing low OR
• Place stop below SuperTrend level (whichever is tighter)
• Use 1-2 ATR distance as guideline
• Recommended: SuperTrend level (built-in volatility adjustment)
Short positions:
• Place stop above recent swing high OR
• Place stop above SuperTrend level (whichever is tighter)
• Use 1-2 ATR distance as guideline
• Recommended: SuperTrend level
2. Position Sizing by Quality Score:
• Excellent (60-70): Maximum position size (2% risk per trade)
• Strong (45-59): Standard position size (1.5% risk per trade)
• Good (30-44): Reduced position size (1% risk per trade)
• Weak (Below 30): Pass or micro position (0.5% risk - learning trades only)
3. Exit Strategy Options:
Option A - Statistical Duration-Based Exit:
• Exit at median estimated duration (conservative)
• Exit at average estimated duration (moderate)
• Trail stop beyond average duration (aggressive)
Option B - Signal-Based Exit:
• Exit on opposite signal (SELL after BUY, or vice versa)
• Exit on SuperTrend flip (trend reversal)
• Exit if quality score drops below 30 mid-trend
Option C - Hybrid (Recommended):
• Take 50% profit at median estimated duration
• Trail stop on remaining 50% using SuperTrend as trailing level
• Full exit on SuperTrend flip or quality collapse
4. Trade Filtering:
For higher win-rate (fewer trades, better quality):
• Increase minimum quality score (try 60 for swing, 50 for day trading)
• Enable volume momentum filter (ensure institutional participation)
• Require higher MTF confluence (5-6/6 alignment)
• Use Advanced analysis mode with appropriate asset type
For more opportunities (more trades, lower quality threshold):
• Decrease minimum quality score (40 for day trading, 35 for scalping)
• Disable volume momentum filter
• Lower MTF confluence requirement
• Use Simple or Standard analysis mode
SETTINGS OVERVIEW
Quick Setup Section:
• Trading Style Preset: Auto / Scalping / Day Trading / Swing / Position / Custom
Dashboard & Display:
• Show Dashboard (ON/OFF)
• Dashboard Position (9 options: Top/Middle/Bottom + Left/Center/Right)
• Text Size (Auto/Tiny/Small/Normal/Large/Huge)
• Show Ribbon Fill (ON/OFF)
• Show SuperTrend Line (ON/OFF)
• Bullish Color (default: Green)
• Bearish Color (default: Red)
• Show Entry Labels - BUY/SELL signals (ON/OFF)
• Show Info Labels - Volume events (ON/OFF)
• Label Size (Auto/Tiny/Small/Normal/Large/Huge)
Supertrend Configuration:
• ATR Length (default varies by preset: 7-21)
• ATR Multiplier Base (default varies by preset: 2.0-4.0)
• Use Adaptive Multiplier (ON/OFF) - Dynamic 0.8x-1.2x adjustment
• Smoothing Factor (0.0-0.5) - EMA smoothing applied to bands
• Neutral Bars After Flip (0-10) - Hide ST immediately after flip
Volume Momentum:
• Enable Volume Momentum Filter (ON/OFF)
• Fast Period (default varies by preset: 3-20)
• Slow Period (default varies by preset: 10-50)
Volume Analysis:
• Volume MA Length (default varies by preset: 10-50)
• High Volume Threshold (default: 1.5x)
• Spike Threshold (default: 2.5x)
• Low Volume Threshold (default: 0.7x)
Quality Filters:
• Minimum Quality Score (0-70, varies by preset)
• Require Volume Confirmation (ON/OFF)
Trend Duration Analysis:
• Show Duration Analysis (ON/OFF) - Display duration analysis boxes
• analysis mode - Simple / Standard / Advanced
• Asset Type - 7 options (Small Cap, Biotech, Blue Chip, Tech Growth, Dividend, Cyclical, Crypto)
• Use Exponential Weighting (ON/OFF) - Recent trends weighted more
• Decay Factor (0.5-0.99) - How much more recent trends matter
• Structure Lookback (3-30) - Pivot detection period for support/resistance
• Proximity Threshold (xATR) - How close to level qualifies as "near"
• Enable Error Learning (ON/OFF) - System learns from estimation errors
• Memory Depth (3-20) - How many past errors to remember
Box Visual Settings:
• duration analysis box Border Color
• duration analysis box Background Color
• duration analysis box Text Color
• duration analysis box Border Width
• duration analysis box Transparency
Multi-Timeframe (Optional Feature):
• Enable MTF Confluence (ON/OFF)
• Minimum Alignment Required (0-6)
• Individual timeframe enable/disable toggles
• Custom timeframe selection options
All preset configurations override manual inputs except when "Custom" is selected.
ADVANCED FEATURES
1. Scalpel Mode (Optional)
Advanced pullback entry system that waits for healthy retracements within established trends before signaling entry:
• Monitors price distance from SuperTrend levels
• Requires pullback to configurable range (default: 30-50%)
• Ensures trend remains intact before entry signal
• Reduces whipsaw and false breakouts
• Inspired by Mark Minervini's VCP pullback entries
Best for: Swing traders and day traders seeking precision entries
Scalpers: Consider disabling for faster entries
2. Error Learning System (Advanced analysis mode Only)
The system learns from its own estimation errors:
• Tracks last 10-20 completed duration estimates (configurable memory depth)
• Calculates error ratio for each: estimated duration / Actual Duration
• If system consistently over-estimates: Applies negative correction (-15%)
• If system consistently under-estimates: Applies positive correction (+15%)
• Adapts to current market regime automatically
This self-correction mechanism improves accuracy over time as the system gathers more data on your specific symbol and timeframe.
3. Regime Detection (Advanced analysis mode Only)
Automatically detects whether market is in trending or choppy regime:
• Compares last 3 trends to historical average
• Recent trends 20%+ longer → Trending regime (+20% to estimates)
• Recent trends 20%+ shorter → Choppy regime (-20% to estimates)
• Applied separately to bullish and bearish trends
Helps duration estimates adapt to changing market conditions without manual intervention.
4. Exponential Weighting
Option to weight recent trends more heavily than distant history:
• Default decay factor: 0.9
• Recent trends get higher weight in statistical calculations
• Older trends gradually decay in importance
• Rationale: Recent market behavior more relevant than old data
• Can be disabled for equal weighting
5. Backtest Statistics
System backtests its own duration estimates using historical data:
• Walks through past trends chronologically
• Calculates what duration estimate WOULD have been at each flip
• Compares to actual duration that occurred
• Displays accuracy metrics in duration analysis boxes and dashboard
• Helps assess statistical reliability on your specific chart
Note: Backtest uses only data available AT THE TIME of each historical flip (no lookahead bias).
TECHNICAL SPECIFICATIONS
• Pine Script Version: v6
• Indicator Type: Overlay (draws on price chart)
• Max Boxes: 500 (for duration analysis box storage)
• Max Bars Back: 5000 (for comprehensive historical analysis)
• Security Calls: 1 (for MTF if enabled - optimized)
• Repainting: NO - All signals and duration estimates confirmed on bar close
• Lookahead Bias: NO - All HTF data properly offset, all duration estimates use only historical data
• Real-time Updates: YES - Dashboard and quality scores update live
• Alert Capable: YES - Both automatic alerts and customizable alert conditions
• Multi-Symbol: Works on stocks, crypto, forex, futures, indices
Performance Optimization:
• Conditional calculations (duration analysis can be disabled to reduce load)
• Efficient array management (circular buffers for trend storage)
• Streamlined gradient rendering (26 layers, can be toggled off)
• Smart label cooldown system (prevents label spam)
• Optimized similarity matching (analyzes only relevant trends)
Data Requirements:
• Minimum 50-100 bars for initial duration analysis (builds historical database)
• Optimal: 500+ bars for robust statistical analysis
• Longer history = more accurate duration estimates
• Works on any timeframe from 1 minute to monthly
KNOWN LIMITATIONS
• Trending Markets Only: Performs best in clear trends. May generate false signals in choppy/sideways markets (use quality score filtering and regime detection to mitigate)
• Lagging Nature: Like all trend-following systems, signals occur AFTER trend establishment, not at exact tops/bottoms. Use duration analysis boxes to set realistic profit targets.
• Initial Learning Period: Duration analysis system requires 10-15 completed trends to build reliable historical database. Early duration estimates less accurate (first few weeks on new symbol/timeframe).
• Visual Load: 26-layer gradient ribbon may slow performance on older devices. Disable ribbon if experiencing lag.
• Statistical accuracy Variables: Duration estimates are statistical estimates, not guarantees. Accuracy varies by:
- Market regime (trending vs choppy)
- Asset volatility characteristics
- Quality of historical pattern matches
- Timeframe traded (higher TF = more reliable)
• Not Best Suitable For:
- Ultra-short-term scalping (sub-1-minute charts)
- Mean-reversion strategies (designed for trend-following)
- Range-bound trading (requires trending conditions)
- News-driven spikes (estimates based on technical patterns, not fundamentals)
FREQUENTLY ASKED QUESTIONS
Q: Does this indicator repaint?
A: Absolutely not. All signals, duration analysis boxes, labels, and alerts use barstate.isconfirmed checks. They only appear after the bar closes. What you see in history is exactly what you would have seen in real-time. Zero repaint guarantee.
Q: How accurate are the trend duration estimates?
A: Accuracy varies by mode, market conditions, and historical data quality:
• Simple mode: 60-70% accuracy (within ±20% of actual duration)
• Standard mode: 70-80% accuracy (within ±20% of actual duration)
• Advanced mode: 75-85% accuracy (within ±20% of actual duration)
Best accuracy achieved on:
• Higher timeframes (4H, Daily, Weekly)
• Trending markets (not choppy/sideways)
• Assets with consistent behavior (Blue Chip, Large Cap)
• After 20+ historical trends analyzed (builds robust database)
Remember: All duration estimates are statistical calculations based on historical patterns, not guarantees.
Q: Which analysis mode should I use?
A:
• Simple: Beginners, clean trending markets, want minimal complexity
• Standard: Most traders, general market conditions (RECOMMENDED DEFAULT)
• Advanced: Experienced traders, volatile/complex markets (biotech, small-cap, crypto), seeking maximum accuracy
Advanced mode requires correct Asset Type configuration for optimal results.
Q: What's the difference between the trading style presets?
A: Each preset optimizes ALL parameters for a specific trading approach:
• Scalping: Ultra-sensitive (ATR 7, Mult 2.0), more signals, shorter holds
• Day Trading: Balanced (ATR 10, Mult 2.5), moderate signals, intraday holds
• Swing Trading: Stable (ATR 14, Mult 3.0), fewer signals, multi-day holds
• Position Trading: Very stable (ATR 21, Mult 4.0), rare signals, week/month holds
Auto mode automatically selects based on your chart timeframe.
Q: Should I use Auto mode or manually select a preset?
A: Auto mode is recommended for most traders. It automatically matches settings to your timeframe and re-optimizes if you switch charts. Only use manual preset selection if:
• You want scalping settings on a 15m chart (overriding auto-detection)
• You want swing settings on a 1h chart (more conservative than auto would give)
• You're testing different approaches on same timeframe
Q: Can I use this for scalping and day trading?
A: Absolutely! The preset system is specifically designed for all trading styles:
• Select "Scalping (1-5m)" for 1-5 minute charts
• Select "Day Trading (15m-1h)" for 15m-1h charts
• Or use "Auto" mode and it configures automatically
Volume momentum filter is auto-disabled in Scalping mode for faster signals.
Q: What is Volume Momentum and why does it matter?
A: Volume Momentum compares short-term volume (fast MA) to long-term volume (slow MA). It answers: "Is money flowing into this asset faster now than historically?"
Why it matters:
• Volume often leads price (early warning system)
• Confirms institutional participation (smart money)
• No lag like price-based indicators
• More intuitive than complex mathematical filters
When the ratio is above 1.2, you have strong evidence that institutions are accumulating (bullish) or distributing (bearish).
Q: How do I set up alerts?
A: Two options:
Option 1 - Automatic Alerts:
1. Right-click on chart → Add Alert
2. Condition: Select this indicator
3. Choose "Any alert() function call"
4. Configure notification method (app, email, webhook)
5. You'll receive detailed alerts on every BUY and SELL signal
Option 2 - Customizable Alert Conditions:
1. Right-click on chart → Add Alert
2. Condition: Select this indicator
3. You'll see three options in dropdown:
- "BUY Signal" (long signals only)
- "SELL Signal" (short signals only)
- "ANY Signal" (both BUY and SELL)
4. Choose desired option and customize message template
5. Uses TradingView placeholders: {{ticker}}, {{close}}, {{time}}, etc.
All alerts fire only on confirmed bar close (no repaint).
Q: What is Scalpel Mode and should I use it?
A: Scalpel Mode waits for healthy pullbacks within established trends before signaling entry. It reduces whipsaws and improves entry timing.
Recommended ON for:
• Swing traders (want precision entries on pullbacks)
• Day traders (willing to wait for better prices)
• Risk-averse traders (prefer fewer but higher-quality entries)
Recommended OFF for:
• Scalpers (need immediate entries, can't wait for pullbacks)
• Momentum traders (want to enter on breakout, not pullback)
• Aggressive traders (prefer more opportunities over precision)
Q: Why do some duration estimates show wider ranges than others?
A: Range width reflects historical trend variability:
• Narrow range: Similar historical trends had consistent durations (high confidence)
• Wide range: Similar historical trends had varying durations (lower confidence)
Wide ranges often occur:
• Early in analysis (fewer historical trends to learn from)
• In volatile/choppy markets (inconsistent trend behavior)
• On lower timeframes (more noise, less consistency)
The median and average still provide useful targets even when range is wide.
Q: Can I customize the dashboard position and appearance?
A: Yes! Dashboard settings include:
• Position: 9 options (Top/Middle/Bottom + Left/Center/Right)
• Text Size: Auto, Tiny, Small, Normal, Large, Huge
• Show/Hide: Toggle entire dashboard on/off
Choose position that doesn't overlap important price action on your specific chart.
Q: Which timeframe should I trade on?
A: Depends on your trading style and time availability:
• 1-5 minute: Active scalping, requires constant monitoring
• 15m-1h: Day trading, check few times per session
• 4h-Daily: Swing trading, check once or twice daily
• Daily-Weekly: Position trading, check weekly
General principle: Higher timeframes produce:
• Fewer signals (less frequent)
• Higher quality setups (stronger confirmations)
• More reliable duration estimates (better statistical data)
• Less noise (clearer trends)
Start with Daily chart if new to trading. Move to lower timeframes as you gain experience.
Q: Does this work on all markets (stocks, crypto, forex)?
A: Yes, it works on all markets with trending characteristics:
Excellent for:
• Stocks (especially growth and momentum names)
• Crypto (BTC, ETH, major altcoins)
• Futures (indices, commodities)
• Forex majors (EUR/USD, GBP/USD, etc.)
Best results on:
• Trending markets (not range-bound)
• Liquid instruments (tight spreads, good fills)
• Volatile assets (clear trend development)
Less effective on:
• Range-bound/sideways markets
• Ultra-low volatility instruments
• Illiquid small-caps (use caution)
Configure Asset Type (in Advanced analysis mode) to match your instrument for best accuracy.
Q: How many signals should I expect per day/week?
A: Highly variable based on:
By Timeframe:
• 1-5 minute: 5-15 signals per session
• 15m-1h: 2-5 signals per day
• 4h-Daily: 2-5 signals per week
• Daily-Weekly: 1-2 signals per month
By Market Volatility:
• High volatility = more SuperTrend flips = more signals
• Low volatility = fewer flips = fewer signals
By Quality Filter:
• Higher threshold (60-70) = fewer but better signals
• Lower threshold (30-40) = more signals, lower quality
By Volume Momentum Filter:
• Enabled = Fewer signals (only volume-confirmed)
• Disabled = More signals (all SuperTrend flips)
Adjust quality threshold and filters to match your desired signal frequency.
Q: What's the difference between entry labels and info labels?
A:
Entry Labels (BUY/SELL):
• Your primary trading signals
• Based on SuperTrend flip + all confirmations (quality, volume, momentum)
• Include quality score and confirmation icons
• These are actionable entry points
Info Labels (Volume Spike):
• Additional market context
• Show volume events that may support or contradict trend
• 8-bar cooldown to prevent spam
• NOT necessarily entry points - contextual information only
Control separately: Can show entry labels without info labels (recommended for clean charts).
Q: Can I combine this with other indicators?
A: Absolutely! This works well with:
• RSI: For divergences and overbought/oversold conditions
• Support/Resistance: Confluence with key levels
• Fibonacci Retracements: Pullback targets in Scalpel Mode
• Price Action Patterns: Flags, pennants, cup-and-handle
• MACD: Additional momentum confirmation
• Bollinger Bands: Volatility context
This indicator provides trend direction and duration estimates - complement with other tools for entry refinement and additional confluence.
Q: Why did I get a low-quality signal? Can I filter them out?
A: Yes! Increase the Minimum Quality Score in settings.
If you're seeing signals with quality below your preference:
• Day Trading: Set minimum to 50
• Swing Trading: Set minimum to 60
• Position Trading: Set minimum to 70
Only signals meeting the threshold will appear. This reduces frequency but improves win-rate.
Q: How do I interpret the MTF Confluence count?
A: Shows how many of 6 timeframes agree with current trend:
• 6/6 aligned: Perfect agreement (extremely rare, highest confidence)
• 5/6 aligned: Very strong alignment (high confidence)
• 4/6 aligned: Good alignment (standard quality setup)
• 3/6 aligned: Moderate alignment (acceptable)
• 2/6 aligned: Weak alignment (caution)
• 1/6 aligned: Very weak (likely counter-trend)
Higher confluence typically correlates with longer, stronger trends. However, MTF analysis is optional - you can disable it and rely solely on quality scoring.
Q: Is this suitable for beginners?
A: Yes, but requires foundational knowledge:
You should understand:
• Basic trend-following concepts (higher highs, higher lows)
• Risk management principles (position sizing, stop losses)
• How to read candlestick charts
• What volume and volatility mean
Beginner-friendly features:
• Auto preset mode (zero configuration)
• Quality scoring (tells you signal strength)
• Dashboard tooltips (hover for explanations)
• duration analysis boxes (visual profit targets)
Recommended for beginners:
1. Start with "Auto" or "Swing Trading" preset on Daily chart
2. Use Standard Analysis Mode (not Advanced)
3. Set minimum quality to 60 (fewer but better signals)
4. Paper trade first for 2-4 weeks
5. Study methodology references (Minervini, O'Neil, Zanger)
Q: What is the Asset Type setting and why does it matter?
A: Asset Type (in Advanced analysis mode) adjusts duration estimates based on volatility characteristics:
• Small Cap: Explosive moves, extended trends (+30-40%)
• Biotech / Speculative: Parabolic potential, news-driven (+40%)
• Blue Chip / Large Cap: Baseline, steady trends (0% adjustment)
• Tech Growth: Momentum-driven, longer trends (+20%)
• Dividend / Value: Slower, grinding trends (-20%)
• Cyclical: Macro-driven, variable (±10%)
• Crypto / High Volatility: Parabolic potential (+30%)
Correct configuration improves Statistical accuracy by 15-20%. Using Blue Chip settings on a biotech stock may underestimate trend length (you'll exit too early).
Q: Can I backtest this indicator?
A: Yes! TradingView's Strategy Tester works with this indicator's signals.
To backtest:
1. Note the entry conditions (SuperTrend flip + quality threshold + filters)
2. Create a strategy script using same logic
3. Run Strategy Tester on historical data
Additionally, the indicator includes BUILT-IN duration estimate validation:
• System backtests its own duration estimates
• Shows accuracy metrics in dashboard and duration analysis boxes
• Helps assess reliability on your specific symbol/timeframe
Q: Why does Volume Momentum auto-disable in Scalping mode?
A: Scalping requires ultra-fast entries to catch quick moves. Volume Momentum filter adds friction by requiring volume confirmation before signaling, which can cause missed opportunities in rapid scalping.
Scalping preset is optimized for speed and frequency - the filter is counterproductive for that style. It remains enabled for Day Trading, Swing Trading, and Position Trading presets where patience improves results.
You can manually enable it in Custom mode if desired.
Q: How much historical data do I need for accurate duration estimates?
A:
Minimum: 50-100 bars (indicator will function but duration estimates less reliable)
Recommended: 500+ bars (robust statistical database)
Optimal: 1000+ bars (maximum Statistical accuracy)
More history = more completed trends = better pattern matching = more accurate duration estimates.
New symbols or newly-switched timeframes will have lower Statistical accuracy initially. Allow 2-4 weeks for the system to build historical database.
IMPORTANT DISCLAIMERS
No Guarantee of Profit:
This indicator is an educational tool and does not guarantee any specific trading results. All trading involves substantial risk of loss. Duration estimates are statistical calculations based on historical patterns and are not guarantees of future performance.
Past Performance:
Historical backtest results and Statistical accuracy statistics do not guarantee future performance. Market conditions change constantly. What worked historically may not work in current or future markets.
Not Financial Advice:
This indicator provides technical analysis signals and statistical duration estimates only. It is not financial, investment, or trading advice. Always consult with a qualified financial advisor before making investment decisions.
Risk Warning:
Trading stocks, options, futures, forex, and cryptocurrencies involves significant risk. You can lose all of your invested capital. Never trade with money you cannot afford to lose. Only risk capital you can lose without affecting your lifestyle.
Testing Required:
Always test this indicator on a demo account or with paper trading before risking real capital. Understand how it works in different market conditions. Verify Statistical accuracy on your specific instruments and timeframes before trusting it with real money.
User Responsibility:
You are solely responsible for your trading decisions. The developer assumes no liability for trading losses, incorrect duration estimates, software errors, or any other damages incurred while using this indicator.
Statistical Estimation Limitations:
Trend Duration estimates are statistical estimates based on historical pattern matching. They are NOT guarantees. Actual trend durations may differ significantly from duration estimates due to unforeseen news events, market regime changes, or lack of historical precedent for current conditions.
CREDITS & ACKNOWLEDGMENTS
Methodology Inspiration:
• Mark Minervini - Volatility Contraction Pattern (VCP) concepts and pullback entry techniques
• William O'Neil - Volume analysis principles and CANSLIM institutional buying patterns
• Dan Zanger - Momentum breakout strategies and volatility expansion entries
Technical Components:
• SuperTrend calculation - Classic ATR-based trend indicator (public domain)
• Statistical analysis - Standard median, average, range calculations
• k-Nearest Neighbors - Classic machine learning similarity matching concept
• Multi-timeframe analysis - Standard request.security implementation in Pine Script
For questions, feedback, or support, please comment below or send a private message.
Happy Trading!






















