Indicadores y estrategias
Adaptive Trend Flow (ATF)Adaptive Trend Flow (ATF) is a custom trend-following indicator designed to work reliably across all markets and all timeframes.
It uses an adaptive moving average that automatically adjusts to market conditions, combined with trend slope analysis and a volatility filter to reduce noise during ranging periods.
Unlike traditional fixed moving averages, ATF reacts faster during strong trends and slows down during consolidation, helping traders stay aligned with meaningful price movements.
🔍 How It Works
Uses an adaptive smoothing algorithm to track price efficiently
Confirms trend direction using trend slope
Filters out low-volatility and choppy conditions using ATR-based logic
Does not repaint — signals are based only on confirmed data
📊 Visual Interpretation
🟢 Green line / background → Bullish trend
🔴 Red line / background → Bearish trend
⚪ Gray → No clear trend (range / low volatility)
⚙️ Features
Works on Crypto, Forex, Stocks, Futures
Compatible with all timeframes
Optional trend-change signals
Optional background highlighting
Fully customizable inputs
Alert-ready
🎯 Best Use Cases
Trend filter for entries and exits
Directional bias for scalping, day trading, or swing trading
Strategy backbone when combined with price action or momentum tools
⚠️ Disclaimer
This indicator is for educational and analytical purposes only and does not constitute financial advice. Always manage risk appropriately.
DEMA200 + EMA9/20/50 + VWAP (Paul Laurent Trading)This script is an all-in-one overlay indicator for TradingView that combines a **DEMA 200**, **EMA 9/20/50**, and TradingView’s **anchored VWAP** (the same VWAP logic as the default VWAP indicator). It’s designed to keep your chart clean while showing key trend and mean-reversion references in one place.
**How to use it**
* Add it to your chart like any indicator: open **Indicators**, search the script name, and click **Add to chart**.
* Use **EMA 9/20/50** for short-term trend and pullback structure (9 = fastest, 50 = slowest).
* Use **DEMA 200** as your long-term trend filter and major dynamic support/resistance.
* Use **VWAP (middle blue line)** as the intraday “fair value” reference. Price above VWAP generally shows stronger demand; below VWAP suggests weaker demand.
* Open the script **Settings** to customize:
* **Colors** and **Strength (line width)** for each line
* VWAP **Anchor Period** (Session, Week, Month, etc.)
* Optional VWAP **Bands** (off by default, can be enabled anytime)
ATR with History (Red/Yellow Style)Gives you last 20 candles ATR (Red Line) , and averages the last 2 weeks' ATR at your current time (Yellow Line)
Demand Index##Description:
This indicator is a precise Pine Script replica of the "Demand Index" (Study ID 139) as found in the Sierra Chart trading platform.
Originally developed by James Sibbet, the Demand Index combines price and volume data to measure buying and selling pressure. It is often considered a leading indicator, anticipating price trend changes by identifying divergences between the price action and the volume flow.
##Key Features & Formula Logic
This script strictly follows the official documentation provided by Sierra Chart to ensure the values match the original platform as closely as possible.
Specific calculation details included in this port:
- P(HL2C): Uses the weighted average (High + Low + 2*Close).
- Range Calculation: Uses a Moving Range based on Max(High, 2) - Min(Low, 2).
- The H0/L0 Factor: A unique characteristic of the Sierra Chart formula is the use of H0 and L0 (the High and Low of the first loaded bar in history) to scale the volatility exponent. This script replicates that behavior.
Note: Because H0 and L0 depend on the start of the loaded data, values may shift slightly if the amount of historical data on your chart changes. This is consistent with how the study behaves in Sierra Chart.
- Complex Weighting: Calculates "Buy Power" and "Sell Power" using the specific exponential decay formula outlined in SC ID 139.
##Settings (Inputs)
- Buy/Sell Power Length (nBS): Length for smoothing Volume and Range (Default: 19).
- Buy/Sell Power MA Length: Length for the smoothing of the calculated Buy/Sell Power (Default: 19).
- Demand Index MA Length: Length for the final Simple Moving Average (SMA) of the Demand Index (Default: 19).
- MA Type: Choose the smoothing algorithm for intermediate steps (EMA, SMA, WMA, RMA). Default is EMA.
##How to Trade / Interpret
- Divergence: The most powerful signal. If price makes a new High but the Demand Index fails to reach a new High, it suggests Buying Power is weakening (Bearish Divergence). Conversely for Bullish Divergence.
- Zero Line Cross: A cross above zero indicates Buy Power > Sell Power (Bullish). A cross below zero indicates Sell Power > Buy Power (Bearish).
Disclaimer: This script is for educational and analytical purposes only. It is a code conversion based on public documentation of Sierra Chart Study ID 139.
Sierra Chart, best trading software, EVER!
With the best datafeet. Denali Exchange Data Feed.
Custom Dividers [louis]Custom Dividers is a streamlined utility designed for Multi-Timeframe Analysis (MTF). It allows you to visualize higher timeframe structures directly on lower timeframe charts by drawing infinite vertical lines at the open of new periods.
Unlike standard grid lines and other divider indicators, this has custom inputs, giving you complete control over non-standard timeframes (e.g., 90-minute cycles, 6-hour blocks, or 2-day periods).
🔑 Key Features
- 4 Independent Timeframe Slots: Configure up to four different vertical dividers simultaneously.
- Custom Minute Inputs (TF 1 & TF 2): Instead of restricting you to a dropdown, the first two slots allow you to input any integer for minutes.
Example: Set 90 for 90-minute cycle dividers.
Example: Set 360 for 6-hour dividers.
- Standard Timeframe Selectors (TF 3 & TF 4): Traditional dropdowns for standard periods like Daily (D), Weekly (W), or Monthly (M).
- Visual Customization:
Lines: Uses line.new() drawing logic to ensure dividers stretch infinitely from top to bottom, regardless of price scale.
Styles: Select from Solid, Dashed, or Dotted directly in the inputs.
Width & Color: Fully customizable to blend into your chart theme.
⚙️ How to Configure
Go to the Settings (Inputs Tab):
TF 1 & TF 2: Enter the specific number of minutes (e.g., 60 = 1 Hour, 240 = 4 Hours). Toggle the checkbox to Show/Hide.
TF 3 & TF 4: Select the timeframe period from the dropdown. Toggle the checkbox to Show/Hide.
Style: Choose your line style, color, and width.
Note: Since this indicator uses geometric drawings (line.new) to achieve full-height vertical lines, all visual settings (Color, Width, Style) are located in the Inputs Tab, not the Style tab.
Probabilidad Alcista / Bajista por Volumen yvvProbabilidad Alcista / Bajista por Volumen y tendencia
Crypto Prev Day/Week Hi-Lo (UTC)escription
Crypto Prev + This Day/Week Hi-Lo (UTC) plots key high/low levels for crypto markets using a 24-hour session anchored to 00:00 UTC.
This indicator is designed for traders who treat crypto as a true 24/7 market and want consistent, global day/week levels that don’t shift with daylight savings.
What it plots
PDH / PDL = Previous Day High / Previous Day Low
PWH / PWL = Previous Week High / Previous Week Low
TWH / TWL = This Week High / This Week Low
00:00 UTC vertical line = marks the start of a new UTC day
Abbreviations
PDH = Previous Day High
PDL = Previous Day Low
PWH = Previous Week High
PWL = Previous Week Low
TWH = This Week High
TWL = This Week Low
UTC = Coordinated Universal Time (global standard time reference)
Koko's Capital Flow Channel Koko’s Capital Flow Channel is a structured EMA channel system designed to reduce over-trading and eliminate chase entries. It separates Early Direction signals (clearing bars) from Smart Entries (inside-channel confirmations), helping traders execute with patience and clarity.
Koko’s Capital Flow Channel™ provides a clean, psychology-friendly framework for traders transitioning from fast scalping to higher timeframes.
What it does
This indicator uses an EMA-based channel to define structure and trend flow, then delivers two tiers of signals:
Early Direction Signals (Early BUY / Early SELL)
Trigger on a clearing bar (break/close condition depending on your setting)
Used for directional awareness and early positioning
Smart Entry Signals (BUY-S / SELL-S)
Trigger only when price returns inside the channel and prints a qualifying candle
Designed to reduce impulsive entries and improve execution quality
Why it’s different
Many tools fire signals everywhere. This channel is built to create clarity and restraint:
Less noise
Fewer, higher-quality signals
Built-in structure + intent filters
Optional ATR filtering to avoid low-quality breaks
Best use cases
Daily / swing trading
Trend continuation and pullback entries
Traders learning discipline and consistency
Burned-out scalpers who want calmer, higher-quality setups
Recommended settings
Timeframe: Daily (works on others but Daily is the intended home)
Start with:
Clearing Bar Mode: Cross (or Over/Under “event” logic if enabled)
Candle Body: Body Only
Intent: Bullish/Bearish Candle
ATR Filter: Clearing Bar Strength, ATR(14), Multiplier 1.0
Signal Key
BUY-E / SELL-E = Early Direction signal (clearing bar)
BUY-S / SELL-S = Smart Entry signal (inside-channel confirmation)
5) How to Use It (simple instructions section)
Workflow
Wait for Early BUY-E / SELL-E to confirm flow direction
Only take Smart Entries (BUY-S / SELL-S) when price returns inside the channel
Use the channel boundaries for structure (helps avoid chasing)
Alerts
You can create alerts for:
Early BUY / Early SELL
Smart BUY / Smart SELL
Risk Disclaimer (safe + standard)
Disclaimer: This indicator is for educational and informational purposes only and is not financial advice. Markets involve risk. Always manage risk appropriately and test settings before live use.
SMC Louis 4H-15M V6为了方便你将这个脚本分享到 TradingView 社区或私人收藏,我为你准备了一份中英文对照的专业描述。这份描述突出了脚本的技术核心——**Louis Trading 的 SMC 进场逻辑**。
---
## 📝 脚本描述 / Script Description
### 中文描述:SMC Louis 实战进场辅助工具 (V6版本)
**核心理念:**
本脚本根据 Louis Trading 的 SMC(Smart Money Concepts)交易教学编写,专注于 **4H 趋势过滤 + 15M 结构突破** 的高胜率进场逻辑。它通过自动化的绘图,将复杂的盘面观察简化为清晰的视觉信号。
**主要功能:**
* **多时段趋势追踪**:内置 200 EMA 动态过滤大周期方向,确保你始终顺势交易。
* **自动 BOS (结构突破) 检测**:实时标记市场结构的改变,识别潜在的反转或延续机会。
* **动态 0.715 进场参考线**:当 15M 级别发生 BOS 突破时,脚本自动根据波段高低点计算并绘制 Louis 教学中的 **0.715 黄金回撤位**,无需手动拉斐波那契线。
* **失衡区 (FVG) 视觉化**:自动高亮显示价格快速移动留下的真空区域,帮助识别高概率的订单回踩区。
* **实时仪表盘**:右上角直观显示当前大周期方向与行动建议(等待回踩或反弹)。
**使用说明:**
1. 建议在 **15分钟 (15M)** 周期下使用。
2. 观察仪表盘的趋势方向。
3. 当绿色 **BOS** 出现后,等待价格回踩 **黄色虚线 (0.715)** 且该线位于 **FVG** 区域内时考虑进场。
---
### English Description: SMC Louis Strategy Entry Assistant (V6)
**Core Concept:**
This script is meticulously designed based on the SMC (Smart Money Concepts) methodology taught by Louis Trading. It focuses on the high-probability **4H Trend Filter + 15M Market Structure Break (BOS)** execution workflow. It automates the complex manual charting process into clear, actionable visual cues.
**Key Features:**
* **MTF Trend Filtering**: Integrated 200 EMA helps you stay on the right side of the 4H higher-timeframe trend.
* **Automated BOS Detection**: Real-time identification of Market Structure Breaks (BOS), highlighting potential trend reversals or continuations.
* **Dynamic 0.715 Entry Level**: When a BOS occurs on the 15M timeframe, the script automatically calculates and plots the **0.715 Fibonacci retracement level**—a signature entry point from Louis's strategy.
* **Fair Value Gap (FVG) Visualization**: Automatically highlights price imbalances (FVGs), helping you spot where "Smart Money" is likely to mitigate orders.
* **Live Dashboard**: A clean UI in the top-right corner provides immediate context on trend direction and actionable advice.
**How to Use:**
1. Best used on the **15-Minute (15M)** timeframe.
2. Check the dashboard for the overall trend bias.
3. Wait for a **BOS** label; look for price to retracing into the **Yellow Dashed Line (0.715)**, especially if it aligns with a plotted **FVG box**.
---
### 💡 建议
如果你打算发布这个脚本,建议在 TradingView 的设置中将“15M 摆动回溯周期”默认设置为 **10-15**,这通常能最准确地过滤掉市场杂讯。
**你想让我为你生成一份专门针对“移动端使用”的简化版界面代码吗?(去掉了复杂的仪表盘,只保留核心线条,适合手机查看)**
ICT Professional OB HunterICT Professional OB Hunter
A professional-grade Order Block mapping tool designed for traders following Smart Money Concepts to track institutional order flow and significant market structures.
This tool identifies validated Order Blocks with Break of Structure confirmation, filtering out market noise and focusing only on high-probability levels where institutional participation is evident.
How It Works
The script operates without repainting, using historical swing highs and lows as reference points rather than future data. Three core criteria must be satisfied before an Order Block is drawn:
Strong Candle Formation: The candle must have a significant body (no dojis), exceeding the ATR threshold—indicating genuine institutional participation rather than indecision.
Displacement: Following the Order Block candle, price must move with momentum exceeding 1.5x the ATR. This captures true "market shifting" moves while ignoring slow, low-volume price action.
Break of Structure: Price must definitively break the previous swing high or low to confirm momentum before the Order Block is validated and drawn.
What You See on the Chart
Thick Blue Lines: Bullish Order Blocks representing demand zones where price historically finds support and reacts upward.
Thick Orange Lines: Bearish Order Blocks representing supply zones that act as resistance.
Yellow Boxes: OTE (Optimal Trade Entry) zones between the 50% and 61.8% retracement levels of the Order Block—ICT's preferred fib confluence area for precision entries.
Dashed Lines: Breaker Blocks indicating former Order Blocks that have been violated by price and now act as reverse levels or "mitigated" areas.
Key Differences from Standard Tools
Most available Order Block indicators mark every red or green candle indiscriminately, creating excessive noise and poor trading opportunities. This code implements a displacement filter to capture only structures formed after significant, volume-backed institutional moves. It contains no future reference or repainting logic—all decisions finalize strictly on bar close based on confirmed historical data.
Settings
Displacement Lookback (2-5 bars): Determines how many subsequent bars to analyze for momentum confirmation after the initial Order Block candle. Three bars provides the optimal balance between responsiveness and confirmation.
ATR Multiplier (0.5+): Sets the sensitivity for displacement detection. A value of 1.5 works well for Gold (XAU/USD). Lower values generate more Order Blocks but decrease quality and reliability.
Mitigation Zones: Toggle the display of OTE (Optimal Trade Entry) boxes on or off.
Usage Recommendations
This indicator is not a standalone buy/sell signal generator—it marks zones where institutional capital is likely positioned.
Recommended approach:
Apply to 15-minute or 1-hour charts, particularly during the New York session (14:30-17:00 EST) when institutional volume peaks.
Wait for price to reach the confluence of the Blue Line and Yellow OTE box.
The setup invalidates if price closes below the OTE zone boundary.
When Orange lines transition to dashed (Breaker Block), recognize that former support has become resistance; adjust position management accordingly.
Risk Warning
This is a statistical model based on historical price behavior, not a "holy grail" solution. Market conditions change, particularly during high-volatility macroeconomic news events (FOMC, CPI, NFP), where Order Blocks may fail. Always employ stop-loss protection and integrate this tool as one component of a comprehensive risk management strategy rather than relying on it exclusively.
Written in Pine Script v6 utilizing array structures for efficient real-time line updates and optimized for performance even on older hardware configurations.
Developer Note: Historical backtest analysis indicates that BOS-validated Order Blocks, particularly in Gold (XAU/USD) and major indices, demonstrate improved win rates when combined with disciplined entry criteria and proper risk management. However, the market retains ultimate authority—respect price action above all indicators.
Last Candle + Previous Day + Pre-Market- RangeV2 of the Indicator (Test)
Last Candle + Previous Day + Pre-Market Script – Features
Last Candle Levels (Current Timeframe)
Draws horizontal lines at the high and low of the last confirmed candle.
Optional display of the candle range in percentage.
Lines automatically update and move correctly when zooming or changing the timeframe.
Previous Day High / Low
Shows the high and low of the previous trading day as dashed lines.
Lines are automatically updated and extend to the right, following the price scale.
Works on any timeframe chart.
Pre-Market High / Low
Highlights the pre-market session (default 04:00–09:30) with dotted lines.
Only calculated during intraday charts.
Lines behave exactly like the daily range lines: zoomable, shiftable, and extendable.
Optional toggle to enable or disable.
Customization Options
Colors for TF candle, daily range, and pre-market range lines.
Length of line extension to the right can be adjusted.
Toggle which levels to show: current TF, previous day, pre-market.
Stable & Safe in Pine Script v6
No repaint issues.
Works reliably on all intraday and daily charts.
Compatible with zooming and chart shifting.
If you want, I can also create a very short “user guide” with screenshots / labels in the chart, so it’s immediately clear what each toggle and line represents.
Do you want me to do that next?
Fear Greed RangesFear Greed Ranges Indicator: A Practical Guide to Market Sentiment Analysis
Introduction: Understanding Market Psychology
The "Fear Greed Ranges" indicator is a specialized technical analysis tool designed to visualize market sentiment through the lens of the Relative Strength Index (RSI). Unlike traditional RSI displays that show only a line graph, this indicator transforms raw RSI data into intuitive, color-coded zones that immediately signal whether markets are driven by fear, greed, or balanced sentiment. By providing this visual context, it helps traders identify potential turning points and manage risk more effectively.
Rational Integration: Why RSI Forms the Core
The indicator's foundation rests on the well-established RSI oscillator, chosen for several compelling reasons. First, RSI has stood the test of time since its development by J. Welles Wilder Jr. in 1978, with decades of empirical validation across various asset classes. Second, its mathematical construction—comparing the magnitude of recent gains to recent losses—directly measures momentum, which often precedes price reversals at extremes. Third, RSI's bounded nature (0-100 range) makes it ideal for creating clearly defined zones without subjective interpretation.
The integration transforms this numerical oscillator into a spatial visualization system. Rather than simply reading RSI values, traders can immediately perceive market conditions through color psychology: red triggers caution, green suggests opportunity, and yellow indicates neutrality. This multi-sensory approach reduces cognitive load during fast-moving markets and helps overcome confirmation bias that might occur when interpreting raw numbers.
Component Synergy: How the System Works Together
The indicator comprises three interconnected layers that create a unified analytical framework:
Core Calculation Layer: The traditional RSI calculation processes price data using the specified period length (default 14 periods). This generates the fundamental sentiment metric that drives all subsequent visualizations. The RSI calculation serves as the "brain" of the indicator, continuously analyzing market momentum.
Sentiment Classification Layer: This layer applies threshold logic to categorize each RSI reading into one of three emotional states. Readings above 70 are classified as "Greed" (market potentially overbought), below 30 as "Fear" (market potentially oversold), and between 30-70 as "Neutral" (balanced market conditions). These thresholds are based on the conventional RSI interpretation framework that has been widely adopted in technical analysis.
Visual Translation Layer: The most innovative aspect transforms numerical classifications into immediate visual cues. The colored ribbon area creates a "sentiment atmosphere" around price action, while the background tint provides subtle contextual framing. Horizontal reference lines at 30, 50, and 70 offer precise anchoring points, and the floating label provides real-time status updates. These elements work in concert: the ribbon shows sentiment intensity, the background provides persistent context, and the reference lines offer precise measurement points.
Practical Application: How to Use the Indicator Effectively
For optimal results, traders should incorporate this tool into a comprehensive analysis framework:
Initial Setup: Apply the indicator to any financial chart (stocks, forex, cryptocurrencies, etc.) using the default 14-period setting for general purposes. For shorter timeframes, consider reducing the period to 10; for longer-term analysis, increase to 20-25 periods.
Signal Interpretation:
When the ribbon turns red and the background tints crimson, exercise caution with new long positions and consider profit-taking on existing holdings.
Green zones may indicate accumulation opportunities, particularly if accompanied by bullish divergence (price making lower lows while RSI makes higher lows).
Yellow areas suggest normal market fluctuation where trend-following strategies may be more appropriate than reversal anticipation.
Confirmation Protocol: Always wait for additional confirmation before acting on extreme readings. For greed zone signals, look for bearish candlestick patterns, resistance at key price levels, or decreasing volume. For fear zone signals, watch for bullish reversal patterns, support levels holding, or increasing volume on down moves.
Timeframe Harmony: Analyze multiple timeframes simultaneously. A greed signal on a daily chart carries more weight than one on a 15-minute chart. Look for alignment across timeframes for higher-probability setups.
Alert Utilization: Enable the built-in alert system to receive notifications when sentiment zones change, ensuring you never miss potential opportunities or risk scenarios.
Original Contribution: What Sets This Indicator Apart
While RSI indicators are ubiquitous, the "Fear Greed Ranges" implementation offers several distinctive advantages:
Cognitive Efficiency: By converting numerical data into immediate visual perception, the indicator reduces the mental processing required to assess market conditions. Traders can glance at a chart and instantly understand the sentiment landscape without calculating or interpreting raw values.
Contextual Persistence: The colored background maintains a subtle but constant reminder of the prevailing sentiment, preventing the common pitfall of overlooking extreme conditions that might develop gradually.
Dual-Layer Communication: The system operates on both conscious (reference lines, labels) and subconscious (color psychology) levels, engaging multiple cognitive pathways for more reliable signal recognition.
Integrated Risk Framework: By explicitly naming emotional extremes ("Fear" and "Greed"), the indicator constantly reminds traders of the psychological forces driving markets, encouraging more disciplined decision-making.
Important Considerations and Limitations
No technical indicator guarantees future performance, and this tool should form only one component of a comprehensive trading strategy. Several critical factors require attention:
Market Context Matters: During strong trending markets, RSI can remain in extreme zones for extended periods without immediate reversal. In such conditions, the indicator signals strength rather than imminent reversal.
Volatility Adjustments: Highly volatile instruments may generate frequent zone changes that could lead to overtrading if not filtered appropriately.
Complementary Tools: This indicator works best when combined with price action analysis, volume studies, support/resistance levels, and fundamental factors where applicable.
Personal Adaptation: Traders should backtest the indicator on their preferred markets and timeframes to understand its characteristics before live implementation, potentially adjusting the RSI period or zone thresholds to match specific instrument behaviors.
The "Fear Greed Ranges" indicator serves as a visual translator of market psychology, converting mathematical momentum readings into intuitive emotional landscapes. By making RSI interpretation more immediate and accessible, it helps traders maintain objectivity during emotionally charged market conditions and supports more disciplined execution of their trading strategies. Remember that successful trading involves risk management, continuous learning, and adapting tools to your individual approach—this indicator provides one lens through which to view the markets, not a complete trading system in itself.
NY Open 15M high low ( carrillos )This indicator marks the high and low of the first candle when the New York market opens, ideal for day trading.
AI Academy: Volume k-NN [PhenLabs]📊 AI Academy: Volume k-NN
Version: PineScript™ v6
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 Description
AI Academy: Volume k-NN (Theory Edition) is an educational indicator designed to demystify how artificial intelligence pattern recognition works directly on your TradingView charts. Rather than being a black-box signal generator, this tool visualizes the entire k-Nearest Neighbors algorithm process in real-time, showing you exactly how AI identifies similar historical patterns and generates predictions.
The indicator scans up to 2,000 historical bars to find patterns that match your current price action, then uses an ensemble of the closest matches to project potential future movement. What sets this apart is the integrated “AI Grimoire”—an interactive educational book overlay that teaches core machine learning concepts through four illuminating chapters.
Whether you’re a trader curious about AI methodology or a developer learning algorithmic concepts, this indicator transforms abstract machine learning theory into tangible, visual understanding.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Points of Innovation
• First TradingView indicator to visualize k-NN algorithm execution in real-time with full transparency
• Interactive “AI Grimoire” educational overlay teaches machine learning concepts while you trade
• Dual-mode pattern matching combines price action with optional volume confirmation
• Confidence-based opacity system visually communicates prediction reliability
• Historical match visualization shows exactly which past patterns informed the prediction
• Ghost bar projections display averaged ensemble predictions with adjustable forecast horizons
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 Core Components
• Pattern Capture Engine: Converts recent price action into logarithmic returns for normalized comparison across different price levels
• k-NN Search Algorithm: Calculates Euclidean distance between current pattern and historical patterns to find closest matches
• Volume Weighting System: Optional feature that incorporates volume patterns into distance calculations with adjustable influence
• Ensemble Predictor: Averages future returns from k-nearest historical matches to generate consensus forecast
• Confidence Calculator: Measures average distance of top matches to determine prediction reliability on 0-100% scale
• AI Grimoire Display: Table-based educational overlay rendering book-style content with chapter navigation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔥 Key Features
• Adjustable Pattern Length: Define how many bars constitute the current pattern for matching (5-100 bars)
• Configurable Search Depth: Control how far back the algorithm searches for historical matches (500-4,900 bars)
• Flexible k-Neighbors: Select how many closest matches inform the prediction (1-20 neighbors)
• Volume Toggle: Enable or disable volume pattern matching for different market conditions
• Volume Influence Slider: Fine-tune the weight given to volume vs. price patterns (0-100%)
• Ghost Bar Count: Adjust how many future bars the indicator projects (3-15 bars)
• Minimum Confidence Filter: Set threshold to hide low-confidence predictions
• Historical Match Display: Toggle visibility of colored boxes marking source patterns
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎨 Visualization
• Blue Scanner Box: Highlights current pattern being analyzed labeled “AI INPUT (The Prompt)”
• Green Historical Boxes: Mark past patterns where price subsequently moved bullish
• Red Historical Boxes: Mark past patterns where price subsequently moved bearish
• Ghost Bars: Semi-transparent candles projecting into the future showing predicted price path
• Confidence Label: Displays prediction confidence percentage and number of matches used
• AI Grimoire Book: Leather-bound book overlay in top-right corner with navigable chapters
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📖 Usage Guidelines
Algorithm Settings
• Pattern Length — Default: 20 | Range: 5-100 | Controls how many recent bars define the pattern. Shorter values find more matches but less specific. Longer values find fewer but more precise matches.
• Search Depth — Default: 2000 | Range: 500-4900 | Determines how many historical bars to scan. Higher values find more potential matches but increase computation time.
• k-Neighbors — Default: 5 | Range: 1-20 | Number of closest matches to use for prediction. Higher values smooth predictions but may dilute strong signals.
• Ghost Bar Count — Default: 5 | Range: 3-15 | How many future bars to project. Shorter horizons are typically more reliable.
• Use Volume Matching — Default: Off | When enabled, patterns must match on both price AND volume characteristics.
• Volume Influence — Default: 30% | Range: 0-100% | Weight given to volume pattern when volume matching is enabled.
Visualization Settings
• Bullish/Bearish Match Colors — Customize colors for historical match boxes based on outcome direction.
• Min Confidence % — Default: 60 | Predictions below this threshold will not display.
• Show Historical Matches — Default: On | Toggle visibility of source pattern boxes on chart.
Education Settings
• Select Chapter — Navigate through AI Grimoire chapters or keep book closed for clean chart view.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Best Use Cases
• Learning how k-Nearest Neighbors algorithm functions in a trading context
• Understanding the relationship between historical patterns and forward predictions
• Identifying when current market conditions resemble past scenarios
• Supplementing discretionary analysis with pattern-based confluence
• Teaching others machine learning concepts through visual demonstration
• Validating whether volume confirms price pattern formations
• Building intuition for what AI “sees” when analyzing charts
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ Limitations
• Past pattern similarity does not guarantee future outcome similarity
• Requires sufficient historical data (minimum 500+ bars) to function properly
• Computation-intensive on lower timeframes with maximum search depth
• Cannot predict truly novel “black swan” events not represented in historical data
• Volume matching less effective on assets with inconsistent volume reporting
• Predictions become less reliable as forecast horizon extends further out
• Educational overlay may obstruct chart view on smaller screens
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 What Makes This Unique
• Full Transparency: Unlike black-box AI tools, every step of the algorithm is visualized on your chart
• Integrated Education: The AI Grimoire teaches machine learning concepts without leaving TradingView
• Theory Meets Practice: See exactly which historical patterns inform each prediction
• Honest Uncertainty: Confidence scoring and opacity fading acknowledge when the AI “doesn’t know”
• Dual-Mode Analysis: Optional volume weighting adds institutional-quality analysis dimension
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔬 How It Works
1. Pattern Capture: On each bar, the indicator captures the most recent price changes as logarithmic returns, creating a normalized “fingerprint” of current market behavior. If volume matching is enabled, volume changes are captured similarly.
2. Historical Search: The algorithm iterates through up to 2,000 historical bars, calculating the Euclidean distance between the current pattern fingerprint and each historical pattern. Distance combines price similarity and optional volume similarity based on weight settings.
3. Neighbor Selection: All historical patterns are ranked by similarity (lowest distance = most similar). The k-closest matches are selected as the “ensemble council” that will inform the prediction.
4. Confidence Calculation: Average distance of top-k matches determines confidence. Tighter clustering of similar patterns yields higher confidence scores, while scattered or distant matches produce lower confidence.
5. Prediction Generation: Future returns from each historical match (what happened AFTER those patterns) are averaged together. This ensemble average is applied to current price to generate ghost bar projections.
6. Visualization: Historical match locations are marked with colored boxes (green for bullish outcomes, red for bearish). Ghost bars render with opacity tied to confidence level—higher confidence means more solid bars.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 Note:
This indicator is designed primarily for educational purposes —to help traders understand how AI pattern recognition algorithms function. While the predictions can supplement your analysis, they should never be used as the sole basis for trading decisions. The AI Grimoire chapters explain key concepts including why AI “hallucinates” during unprecedented market events. Always combine with proper risk management and additional confirmation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Noise Area (TS Intraday, Custom Session + Timezone List)This indicator replicates the algorithm proposed in “Beat the Market: An Effective Intraday Momentum Strategy for the S&P 500 ETF (SPY)” by Carlo Zarattini, Andrew Aziz, and Andrea Barbon. The implementation follows the core methodology described in the paper, reproducing its intraday momentum signals and trading logic as applied to the S&P 500 ETF (SPY)
Multi Moving Averages (EMA / SMA Toggle) ConfigurableMulti Moving Averages (EMA / SMA Toggle) is a lightweight and highly configurable indicator designed to plot up to three moving averages on your chart with a clean and minimalist input panel.
The indicator allows you to switch seamlessly between Exponential Moving Averages (EMA) and Simple Moving Averages (SMA) using a single toggle, while preserving the same lengths, sources, and visual settings. Each moving average can be independently shown or hidden and fully customized for color, line width, and plot style.
This tool is ideal for traders who rely on multiple moving averages for trend identification, dynamic support and resistance, pullback analysis, and crossover-based strategies, while keeping their charts uncluttered and easy to read.
Key Features
Plot up to three moving averages
Global EMA / SMA toggle
Individual show / hide control for each MA
Customizable length, source, color, width, and style
Minimalist input layout with low scrolling
Fully compatible with the Style panel
Whether you prefer fast-reacting EMAs or smoother SMAs, this indicator adapts instantly to your workflow without requiring multiple indicators or duplicate settings.
Bullish/Bearish Trend OscillatorThis oscillator compresses multiple trend signals into a single 0–100 gauge (50 = neutral). It combines:
Fast trend alignment (SMA stack + MACD)
Distance from SMA20 and SMA200 (stronger bear weighting below)
SMMA channel position
Trend line channel position
Price momentum (bar‑to‑bar change)
Volume ratio (green vs red candle weight)
The result is a smoothed, step‑colored trend score that highlights bullish vs bearish pressure and helps identify trend strength changes over time.
Note:
This is an educational indicator and not financial advice.
DEMA200 + EMA9/20/50 + VWAP (Paul Laurent Trading)This script is an all-in-one overlay indicator for TradingView that combines a **DEMA 200**, **EMA 9/20/50**, and TradingView’s **anchored VWAP** (the same VWAP logic as the default VWAP indicator). It’s designed to keep your chart clean while showing key trend and mean-reversion references in one place.
**How to use it**
* Add it to your chart like any indicator: open **Indicators**, search the script name, and click **Add to chart**.
* Use **EMA 9/20/50** for short-term trend and pullback structure (9 = fastest, 50 = slowest).
* Use **DEMA 200** as your long-term trend filter and major dynamic support/resistance.
* Use **VWAP (middle blue line)** as the intraday “fair value” reference. Price above VWAP generally shows stronger demand; below VWAP suggests weaker demand.
* Open the script **Settings** to customize:
* **Colors** and **Strength (line width)** for each line
* VWAP **Anchor Period** (Session, Week, Month, etc.)
* Optional VWAP **Bands** (off by default, can be enabled anytime)
Short Option Intrinsic + Option Price + Time ValueThis code print out and plot the intrinsic values, time values and the option price on the screen. This tells your how likely a short option will be exercised. User needs to select the option type (call, or put). Then input strike price and the current option price.
RDMTFX Custom Engulfing CandlesIdentifies candles which trade beyond the previous extreme and close beyond the opposite extreme.






















