EMA RaaIf you trade index options / futures intraday:
5 EMA → Entry timing
20 EMA → Trend pullback
50 EMA → Regime filter
Chỉ báo và chiến lược
Trend FollowingTrend Following is a visual trend-tracking indicator built on multiple exponential moving averages (EMAs) and market-context confirmation.
The indicator combines:
Slow EMA (50) to define the primary trend
Fast EMA (20) for intermediate trend alignment
Fastest EMA (9) for timing and sensitivity
200 SMA as a long-term structural reference
The moving averages change color dynamically:
Green when the MA is rising and price is above it (healthy trend)
Red when the MA is falling and price is below it (downtrend)
Yellow during transition phases, consolidation, or loss of momentum
The chart background is also color-coded to highlight the market regime:
Green → bullish bias (trend continuation)
Red → bearish bias
Black → conflict, correction, or consolidation zones (avoid aggressive entries)
Additionally, the script includes:
Logic for identifying low-wick candles, indicating directional strength
Volume confirmation using a 21-period volume moving average
📌 Indicator purpose:
To help traders stay aligned with the dominant trend, avoid low-probability environments, and improve timing on pullbacks and continuation moves.
📈 Best suited for:
Trend following
Swing trading
Position trading
Market context and trend confirmation before technical setups
⚠️ This indicator does not generate automated signals. It is designed as a context and confirmation tool and should be used alongside proper risk management and a well-defined trading strategy.
CRT + Turtle Soup IndicatorEste proyecto combina dos poderosas metodologías de trading basadas en conceptos de ICT (Inner Circle Trader):
Candle Range Theory (CRT) se fundamenta en la identificación de rangos de velas en timeframes superiores y la detección de raids de liquidez. La teoría sostiene que cuando el precio captura la liquidez de un lado del rango (high o low), tiende a moverse hacia el lado opuesto. Este comportamiento se basa en el principio de que el mercado se mueve principalmente por dos razones: balancear desequilibrios (imbalances) y cazar liquidez.
Turtle Soup es una estrategia que capitaliza los false breakouts (rupturas falsas) de niveles clave de soporte y resistencia. El nombre proviene de una referencia humorística al sistema "Turtle Trading" de los años 80, que operaba breakouts reales. Turtle Soup hace exactamente lo contrario: identifica cuando el precio rompe un nivel clave temporalmente para cazar stops, y luego revierte rápidamente en la dirección opuesta.
La combinación de ambas estrategias proporciona un marco robusto para identificar puntos de reversión de alta probabilidad, especialmente cuando se confirman con cambios en la estructura de mercado (Market Structure Shift).
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This project combines two powerful trading methodologies based on Inner Circle Trader (ICT) concepts:
Candle Range Theory (CRT) is based on identifying candlestick ranges on higher timeframes and detecting liquidity raids. The theory states that when the price captures liquidity on one side of a range (high or low), it tends to move to the opposite side. This behavior is based on the principle that the market moves primarily for two reasons: to balance imbalances and to hunt for liquidity.
Turtle Soup is a strategy that capitalizes on false breakouts of key support and resistance levels. The name comes from a humorous reference to the "Turtle Trading" system from the 1980s, which traded real breakouts. Turtle Soup does the exact opposite: it identifies when the price temporarily breaks a key level to trigger stop-loss orders, and then quickly reverses in the opposite direction.
The combination of both strategies provides a robust framework for identifying high-probability reversal points, especially when confirmed by market structure shifts.
DIMA SETUP | 4 Candle Streak4 candles trade in 3 min time frame
session 20:00-22:00 israel time zone
NY 16:00 Close Overview
This indicator is designed for traders active in Pre-market, Post-market, and Blue Ocean (Overnight) sessions. It identifies the exact closing price of the financial instrument at 16:00 New York Time (the end of the Regular Trading Hours - RTH) and anchors a continuous horizontal line to this level.
The 16:00 Close is a critical psychological and institutional level. This script helps you visualize how the price deviates from the official daily close during extended hours and subsequent trading days.
Key Features
Smart NY Close Detection: Automatically identifies the 16:00 NY bar. For instruments with early closures (like certain Futures or Commodities ending at 13:45), the script automatically anchors the line to the final available closing price of the session.
Workday-Only Logic: The script respects the traditional trading week. For assets that trade 24/7 (like Crypto), the line remains fixed at Friday's 16:00 close throughout the weekend and only updates on Monday.
Real-Time Price Label: Displays the exact anchor price on the right axis for quick reference.
Dynamic Performance Tracker: A floating dashboard in the top-right corner shows the current percentage change relative to the 16:00 Close.
Green Background: Price is above the anchor.
Red Background: Price is below the anchor.
Formatted Accuracy: Displays with leading zeros (e.g., -0.60%) for professional-grade readability.
Infinite Extension: The anchor line extends indefinitely into the future, providing a clean "waterline" for your charts.
Built-in Alerts: Includes a "Cross" alert that triggers whenever the price touches or crosses the 16:00 Close level.
Settings
Line Color/Width: Customize the visual appearance of the anchor line.
Show Label: Toggle the price tag on the right side.
Label Offset: Adjust the distance of the label from the bars to prevent overlap.
How to Use
Gap Analysis: Use the percentage box to instantly see the "Overnight Gap" during Blue Ocean or Pre-market sessions.
Support/Resistance: Watch how price reacts to the previous 16:00 close; it often acts as a significant "magnet" or pivot point during low-liquidity hours.
Trend Confirmation: If the price stays consistently above the blue line during the pre-market, it may indicate bullish sentiment for the upcoming RTH open.
Daily Returns Analysis: N vs M
This script displays the moving average of the percentage difference in price over n vs. m periods.
Note: This is a daily average.
1 MIN SCALP TRADER fixed//@version=5
indicator("15MIN SCALP TRADER", overlay=true)
// ============================================
// SETTINGS
// ============================================
length_rsi = input(14, "RSI Length", group="Indicators")
length_ma = input(20, "MA Length", group="Indicators")
rsi_overbought = input(70, "RSI Overbought", group="Signals")
rsi_oversold = input(30, "RSI Oversold", group="Signals")
// ============================================
// CALCULATIONS
// ============================================
// RSI
rsi = ta.rsi(close, length_rsi)
// Moving Averages
ma_fast = ta.sma(close, length_ma)
ma_slow = ta.sma(close, length_ma * 2)
// Volume
vol = ta.sma(volume, 20)
vol_spike = volume > vol * 1.5
// Support/Resistance
highest = ta.highest(high, 20)
lowest = ta.lowest(low, 20)
// ============================================
// SIGNALS
// ============================================
// BUY Signal: Price breaks above MA + RSI < 50 + Volume
buy_signal = close > ma_fast and close > ma_slow and rsi < 50 and vol_spike
// SELL Signal: Price below MA + RSI > 50
sell_signal = close < ma_fast and rsi > 50 and vol_spike
// ============================================
// TAKE PROFIT / STOP LOSS LEVELS
// ============================================
atr = ta.atr(14)
tp_long = close + (atr * 2)
sl_long = close - (atr * 1)
tp_short = close - (atr * 2)
sl_short = close + (atr * 1)
// ============================================
// PLOT
// ============================================
// Moving Averages
plot(ma_fast, "MA20", color.new(color.blue, 50), linewidth=2)
plot(ma_slow, "MA40", color.new(color.red, 50), linewidth=2)
// Support/Resistance
plot(highest, "Resistance", color.new(color.orange, 60), linewidth=1, style=plot.style_circles)
plot(lowest, "Support", color.new(color.green, 60), linewidth=1, style=plot.style_circles)
// ============================================
// ALERTS & ARROWS
// ============================================
// Buy Signal
plotshape(buy_signal, title="BUY", style=shape.labelup, location=location.belowbar,
color=color.new(color.green, 0), textcolor=color.white, text="BUY", size=size.small)
// Sell Signal
plotshape(sell_signal, title="SELL", style=shape.labeldown, location=location.abovebar,
color=color.new(color.red, 0), textcolor=color.white, text="SELL", size=size.small)
// ============================================
// ALERTS
// ============================================
alertcondition(buy_signal, title="BUY SIGNAL 15MIN", message="🟢 BUY - Check chart now!")
alertcondition(sell_signal, title="SELL SIGNAL 15MIN", message="🔴 SELL - Check chart now!")
// ============================================
// TABLE INFO
// ============================================
var table info = table.new(position.top_right, 2, 5, border_color=color.gray,
frame_color=color.blue, frame_width=2)
table.cell(info, 0, 0, "RSI", text_color=color.white, bgcolor=color.navy)
table.cell(info, 1, 0, str.tostring(math.round(rsi, 2)), text_color=color.white, bgcolor=color.navy)
table.cell(info, 0, 1, "Close", text_color=color.white, bgcolor=color.navy)
table.cell(info, 1, 1, str.tostring(math.round(close, 2)), text_color=color.white, bgcolor=color.navy)
table.cell(info, 0, 2, "MA20", text_color=color.white, bgcolor=color.navy)
table.cell(info, 1, 2, str.tostring(math.round(ma_fast, 2)), text_color=color.white, bgcolor=color.navy)
table.cell(info, 0, 3, "Volume", text_color=color.white, bgcolor=color.navy)
table.cell(info, 1, 3, str.tostring(math.round(volume / 1000000, 2)) + "M", text_color=color.white, bgcolor=color.navy)
table.cell(info, 0, 4, "ATR", text_color=color.white, bgcolor=color.navy)
table.cell(info, 1, 4, str.tostring(math.round(atr, 4)), text_color=color.white, bgcolor=color.navy)
Elliott Wave: Pro Forecast + DashboardTitle: Elliott Wave: Pro Forecast + Dashboard
This is an improvement from my previous Elliott Wave Script
Description:
This is an advanced, "context-aware" Elliott Wave forecasting engine designed for both scalpers and swing traders. Unlike static wave indicators, this script uses an adaptive logic system to detect the dominant market trend and automatically project the most probable wave structure (Impulse vs. Correction) in real-time.
It features a "Real-Time Swing Detection" engine that bypasses standard pivot lag during high-volatility events, ensuring your forecast targets remain accurate even during sharp breakouts or crashes.
Key Features
🧠 1. AI / Adaptive Trend Logic
Auto-Detect Mode: The script analyzes the 200 EMA and recent pivot structure to automatically determine if the next move is an Impulse (1-2-3-4-5) or a Correction (A-B-C / W-X-Y).
Dynamic Bias:
Bull Trend + Recent Low = Projects Bullish Impulse.
Bull Trend + Recent High = Projects Bullish Correction.
Manual Override: You can force "Impulse Only" or "Correction Only" modes for specific analysis.
⚡ 2. Real-Time Swing Detection (Volatility Guard)
Standard pivot indicators lag by several bars. This script monitors price action in real-time. If price breaks significantly below a "live" low or above a "live" high, the script immediately updates the forecast anchor point, preventing the "floating lines" issue common in other indicators during volatility spikes.
🌊 3. Advanced Wave Structures
Impulse: Projects a standard 5-wave motive structure using Fibonacci expansions (1.618 for Wave 3, Equality for Wave 5).
Correction Selector: Choose between:
Double Zig-Zag (W-X-Y): For sharp, complex corrections. Includes automatic Parallel Channeling.
Triangle (A-B-C-D-E): For sideways consolidation patterns.
Extensions: Automatically detects and draws Extension targets (0.5 Vol) before the reversal begins.
📊 4. Professional Dashboard
Status Panel: Displays the detected trend phase (e.g., "Detected: Bull CORRECTION").
Target Table: Lists exact price targets for every wave (1-5, A-E, W-X-Y) along with the % distance from the current price.
Macro Forecast: Includes a separate, thicker 1-Year Macro projection that runs independently of the short-term forecast.
🔗 5. Scenario Linking
"Link" Mode: Optionally chain the forecast to start after the Extension target is hit, allowing you to visualize "Extension -> Reversal" scenarios seamlessly.
How to Use
Add to Chart: Works best on 1H, 4H, and Daily timeframes.
Check the Status: Look at the top-right dashboard. The "STATUS" row tells you if the script sees an Impulse or Correction.
Adjust Sensitivity: Use the "Short-Term Sensitivity" setting (Default: 5) to tune the pivot detection to your specific asset's volatility.
Correction Style: If the market is chopping sideways, switch the "Correction Pattern" in settings to Triangle. If it is trending sharply, leave it on Double Zig-Zag.
Disclaimer: This tool provides hypothetical projections based on Fibonacci ratios and Elliott Wave theory. It is not financial advice. Always use stop losses and proper risk management.
Funded Indicator### Detailed Step-by-Step Guide for Using the "Funded Indicator" on TradingView
This comprehensive guide explains how to install, configure, interpret, and use the "Funded Indicator" — an advanced Pine Script v5 tool that combines momentum signals from RSI, MACD, and Stochastic across multiple timeframes, with volume spike confirmation, divergence detection, a real-time dashboard, trend background coloring, and customizable alerts. It is designed for technical traders analyzing forex, cryptocurrencies, stocks, or any other market on TradingView.
**Important Disclaimer**: This indicator is provided for educational and analytical purposes only. It does not constitute financial advice, guarantee profits, or predict future price movements. Trading carries the risk of loss of capital. Always perform your own analysis, apply proper risk management (such as stop-loss orders), and comply with TradingView’s terms of service. No warranties are made — performance varies depending on market conditions, asset, timeframe, and user settings. Backtest thoroughly before using real capital.
The guide assumes you have a TradingView account (free or premium) and basic familiarity with the platform.
#### **Step 1: Installation on TradingView**
- **Open TradingView**:
- Log in to tradingview.com via browser or the mobile/desktop app.
- Load a chart of any symbol (e.g., BTCUSD, EURUSD, AAPL) and choose an initial timeframe (5m or 15m recommended for first tests).
- **Access the Pine Editor**:
- Click the “Pine Editor” tab at the bottom of the chart (or press Alt + Shift + P on PC/Mac).
- If hidden, click the “...” button in the bottom toolbar and select “Pine Editor.”
- **Paste the Script Code**:
- Delete any existing code in the editor.
- Copy and paste the complete Pine Script code of the indicator.
- Click “Save” (or Ctrl + S). Give it a name like “Funded Indicator” or “Momentum Fusion Pro.”
- **Add to the Chart**:
- Click the green “Add to Chart” button in the top-right corner of the editor.
- The indicator should now appear: a Fusion Score line, horizontal levels, buy/sell labels, divergence tags, background coloring (if enabled), and a dashboard table in the top-right corner.
- **Verification**:
- Check the console at the bottom of the editor for any compilation errors. If errors appear, review the error message carefully.
- Refresh the page or switch timeframes/symbols if elements do not display.
- If the dashboard is missing, ensure “Show Dashboard” is enabled in the settings (see Step 2).
#### **Step 2: Configuring the Inputs (Customization)**
- **Open Settings**:
- Locate the indicator name in the left panel (e.g., “Funded Indicator”).
- Double-click it or right-click → “Settings.”
- Go to the “Inputs” tab.
- **Detailed Explanation of Each Input Group**:
- **───── Core & Timeframe ─────**
- **Source**: Price data used for calculations (default: close).
Use “close” for standard behavior; “high” for bullish bias or “low” for bearish bias.
- **Higher TF Multiplier (× current)**: Defines the higher timeframe (default: 4).
Example: 5m chart × 4 = 20m analysis. Increase (5–10) for stronger trend filtering in volatile markets; decrease (2–3) for faster response in low-volatility pairs.
- **───── RSI ─────**
- **Length**: RSI period (default: 14).
Shorten (7–10) for sensitive signals; lengthen (21+) for smoother trends.
- **Overbought / Oversold**: Thresholds (default: 70 / 30).
Raise OB to 80 in strong uptrends; lower OS to 20 in strong downtrends.
- **───── MACD ─────**
- **Fast / Slow / Signal**: Standard MACD periods (12/26/9).
Shorten Fast to 8–10 for quicker signals in crypto; lengthen for smoother forex behavior.
- **───── Stochastic ─────**
- **%K Length / %K Smooth / %D Smooth**: Periods (14/3/3).
Reduce smoothing for rawer signals; increase for noise reduction.
- **Overbought / Oversold**: Thresholds (80/20).
Adjust similarly to RSI levels.
- **───── Volume & Weights ─────**
- **Volume MA Length**: Period for volume average (default: 20).
Increase to 50 for stronger confirmation; decrease to 10 for intraday.
- **Volume Spike × MA**: Spike detection threshold (default: 1.6).
Raise to 2.0+ in low-volume assets; lower to 1.2 in high-liquidity markets.
- **RSI / MACD / Stoch Weight**: Fusion score weights (default: 0.40 / 0.35 / 0.25).
Adjust to emphasize preferred oscillator; keep sum close to 1.0.
- **───── Display & Alerts ─────**
- **Trend Background**: Enables green/red background coloring (default: true).
Disable if the chart feels cluttered.
- **Show Dashboard**: Displays the summary table (default: true).
Highly recommended for quick multi-TF overview.
- **Show Divergence Labels**: Shows bullish/bearish divergence tags (default: true).
Disable in very noisy or ranging markets.
- **Save Changes**:
- Click “OK.” Reload the chart if necessary.
#### **Step 3: Interpreting Visual Elements and Signals**
- **Fusion Score Plot**: Thick line colored green above zero, red below.
Above +40 = strong bullish momentum; below -40 = strong bearish momentum.
- **Horizontal Lines**: Zero (gray dashed), +40 (green dotted), -40 (red dotted).
Use as dynamic support/resistance for momentum.
- **Buy/Sell Shapes**: Green “BUY” below candle, red “SELL” above candle.
Appear only on crossovers confirmed by volume spike.
- **Divergence Labels**: “Bull Div ▲” (green) and “Bear Div ▼” (red).
Indicate potential reversals when price and RSI diverge.
- **Trend Background**: Light green = strong bull, light red = strong bear.
Provides instant visual bias.
- **Dashboard Table** (top-right corner): Shows current and higher-TF values for Fusion, RSI, MACD Hist, Stoch, Volume Spike, and Trend.
Green = bullish, red = bearish, yellow = neutral/overbought/oversold.
#### **Step 4: Generating and Using Signals / Basic Strategy**
- **Buy Signal** — “BUY” label + fusion crosses above 0 + volume spike + bullish divergence + green background.
- **Sell Signal** — “SELL” label + fusion crosses below 0 + volume spike + bearish divergence + red background.
- **Strong Trend Confirmation** — Dashboard shows “STRONG BULL” or “STRONG BEAR” → favor trend-following trades.
- **Neutral / Ranging** — No strong color or dashboard signals → avoid new positions or wait for breakout.
- **Example Workflow**:
1. Check higher-TF column in dashboard for alignment.
2. Wait for “BUY” or “SELL” label with volume “YES”.
3. Confirm divergence (if present) and background color.
4. Enter trade with stop-loss below/above recent swing.
5. Exit on opposite signal or when fusion returns to zero.
#### **Step 5: Setting Up Alerts**
- Right-click on the chart → “Add Alert.”
- Select “Funded Indicator” as the condition source.
- Choose one of the built-in alerts:
- “Fusion BUY + Volume”
- “Fusion SELL + Volume”
- Set frequency to “Once Per Bar Close” to reduce noise.
- Customize message (e.g., “Buy signal on {{ticker}} at {{close}}”).
- Enable notifications (email, app push, SMS, webhook for automation).
- Test alerts in a demo environment first.
#### **Step 6: Testing and Optimization**
- **Backtesting** — Use TradingView’s “Bar Replay” tool to manually review historical signals.
- **Forward Testing** — Apply the indicator to a paper trading account for 1–4 weeks.
- **Parameter Optimization** — Adjust one input at a time (e.g., volume threshold, weights) and compare performance across different symbols and timeframes.
- **Market-Specific Tuning** — Crypto may need higher volume thresholds; forex may benefit from tighter RSI levels.
#### **Step 7: Advanced Tips and Important Reminders**
- **Best Timeframes**: 5m–1h for intraday; 4h–daily for swing trading.
- **Complementary Tools**: Use with support/resistance, moving averages, or volume profile for better context.
- **Risk Management**: Never risk more than 1–2% per trade. Always set stop-loss and take-profit levels.
- **Limitations**: No indicator is perfect. False signals occur in ranging or low-volume markets.
- **Updates**: If new features are added (e.g., additional filters), re-save and re-add the script.
This guide helps users maximize the value of the Funded Indicator while maintaining responsible trading practices. Happy analyzing and trading!
DafePatternLibDafePatternLib: The Neural Pattern Recognition & Reinforcement Learning Engine
This is not a pattern library. This is an artificial trading brain. It doesn't just find patterns; it learns, adapts, and evolves based on their performance in the live market.
█ CHAPTER 1: THE PHILOSOPHY - BEYOND STATIC RULES, INTO DYNAMIC LEARNING
For decades, chart pattern analysis has been trapped in a static, rigid paradigm. An indicator is coded to find a "Bullish Engulfing" or a "Head and Shoulders," and it will signal that pattern with the same blind confidence every single time, regardless of whether that pattern has been consistently failing for the past month. It has no memory, no intelligence, no ability to adapt. It is a dumb machine executing a fixed command.
The DafePatternLib was created to shatter this paradigm. It is built on a powerful, revolutionary philosophy borrowed from the world of artificial intelligence: Reinforcement Learning . This library is not just a collection of pattern detection functions; it is a complete, self-optimizing neural framework. It doesn't just find patterns; it tracks their outcomes. It remembers what works and what doesn't. Over time, it learns to amplify the signals of high-probability patterns and silence the noise from those that are failing in the current market regime.
This is not a black box. It is an open-source, observable learning system. It is a "Neural Edition" because, like a biological brain, it strengthens and weakens its own "synaptic" connections based on positive and negative feedback, evolving into a tool that is uniquely adapted to the specific personality of the asset you are trading.
█ CHAPTER 2: THE CORE INNOVATIONS - WHAT MAKES THIS A "NEURAL" LIBRARY?
This library introduces several concepts previously unseen in the TradingView ecosystem, creating a truly next-generation analytical tool.
Reinforcement Learning Engine: The brain of the system. Every time a high-confidence pattern is detected, it is logged into an "Active Memory." The library then tracks the outcome of that pattern against its projected stop and target. If the pattern is successful, the "synaptic weight" for that entire category of patterns is strengthened. If it fails, the weight is weakened. This is a continuous feedback loop of performance-driven adaptation.
Synaptic Plasticity (Learning Rate): You have direct control over the brain's "plasticity"—its ability to learn. A high plasticity allows it to adapt very quickly to changing market conditions, while a lower plasticity creates a more stable, long-term learning model.
Dynamic Volatility Scaling (DVS): Markets are not static; they breathe. DVS is a proprietary function that calculates a real-time volatility scalar by comparing the current ATR to its historical average. This scalar is then used to automatically adjust the lookback periods and sensitivity of all relevant pattern detection engines. In high-volatility environments, the engines look for larger, more significant patterns. In low-volatility, they tighten their focus to find smaller, more subtle setups.
Neural Confidence Score: The output of this library is not a simple "true/false" signal. Every detected pattern comes with two confidence scores:
Raw Confidence: The original, static confidence level based on the pattern's textbook definition.
Net Confidence: The AI-adjusted score. This is the Raw Confidence × Learned Bias. A pattern that has been performing well will see its confidence amplified (e.g., 70% raw → 95% net). A pattern that has been failing will see its confidence diminished (e.g., 70% raw → 45% net).
Intelligent Filtering: The learning system is not just for scoring. If the learned bias for a particular pattern category (e.g., "Candle") drops below a certain threshold (e.g., 0.8), the library will automatically begin to filter out those signals, treating them as unreliable noise until their performance improves.
█ CHAPTER 3: THE ANATOMY OF THE AI - HOW IT THINKS
The library's intelligence is built on a clear, observable architecture.
The NeuralWeights (The Brain)
This is the central data structure that holds the system's "memory." It is a simple object that stores a single floating-point number—a weight or "bias"—for each of the five major categories of pattern analysis. It is initialized with neutral weights of 1.0 for all categories.
w_candle: For candlestick patterns.
w_harmonic: For harmonic patterns.
w_structure: For market structure patterns (e.g., BOS/CHoCH).
w_geometry: For classic geometric patterns (e.g., flags, wedges).
w_vsa: For Volume Spread Analysis patterns.
The update_brain() Function (The Learning Process)
This is the core of the reinforcement learning loop. When a pattern from the ActiveMemory is resolved (as a win or a loss), this function is called. If the pattern was a "win," it applies a small, positive adjustment (the plasticity value) to the corresponding weight in the brain. If it was a "loss," it applies a negative adjustment. The weights are constrained between 0.5 (maximum distrust) and 2.0 (maximum trust), preventing runaway feedback loops.
The manage_memory() Function (The Short-Term Memory)
This function is the AI's hippocampus. It maintains an array of ActiveMemory objects, tracking up to 50 recent, high-confidence signals. On every bar, it checks each active pattern to see if its target or stop has been hit. If a pattern resolves, it triggers the update_brain() function with the outcome and removes the pattern from memory. If a pattern does not resolve within a set number of bars (e.g., 50), it is considered "expired" and is treated as a minor loss, teaching the AI to distrust patterns that lead to nowhere.
The scan_neural_universe() Function (The Master Controller)
This is the main exported function that you will call from your indicator. It is the AI's "consciousness." On every bar, it performs a sequence of high-level actions:
It calculates the current Dynamic Volatility Scalar (DVS).
It runs all of its built-in pattern detection engines (VSA, Geometry, Candles, etc.), feeding them the DVS to ensure they are adapted to the current market volatility.
It identifies the single "best" active pattern for the current bar based on its raw confidence score.
It passes this "best" pattern to the manage_memory() function to be tracked and to trigger learning from any previously resolved patterns.
It retrieves the current learned bias for the "best" pattern's category from the brain.
It calculates the final net_confidence by multiplying the raw confidence by the learned bias.
It performs a final check, intelligently filtering out the signal if its learned bias is too low.
It returns the final, neurally-enhanced PatternResult object to your indicator.
█ CHAPTER 4: A GUIDE FOR DEVELOPERS - INTEGRATING THE BRAIN
I have designed the DafePatternLib to be both incredibly powerful and remarkably simple to integrate into your own scripts.
Import the Library: Add the following line to the top of your script (replace YourUsername with your TradingView username):
import DskyzInvestments/DafePatternLib/1 as pattern
Call the Scanner: On every bar, simply call the main scanning function. The library handles everything else internally—the DVS calculation, the multi-pattern scanning, the memory management, and the reinforcement learning.
pattern.PatternResult signal = pattern.scan_neural_universe()
Use the Result: The signal object now contains all the intelligence you need. Check if a pattern is active, and if so, use its properties to draw your signals and alerts. You can choose to display the raw_confidence vs. the net_confidence to give your users a direct view of the AI's learning process.
if signal.is_active
label.new(bar_index, signal.entry, "AI Conf: " + str.tostring(signal.net_confidence, "#") + "%")
With just these few lines, you have integrated a self-learning, self-optimizing, multi-pattern recognition engine into your indicator.
// ═══════════════════════════════════════════════════════════
// INSTRUCTIONS FOR DEVELOPERS:
// ───────────────────────────────────────────────────────────
1. Import the library at the top of your indicator script:
import YourUsername/DafePatternLib/1 as pattern
2. Copy the entire "INPUTS TEMPLATE" section below and paste it into your indicator's code.
This will create the complete user settings panel for controlling the AI.
3. Copy the "USAGE EXAMPLE" section and adapt it to your script's logic.
This shows how to initialize the brain, call the scanner, and use the results.
// ═══════════════════════════════════════════════════════════
// INPUT GROUPS
// ═══════════════════════════════════════════════════════════
string G_AI_ENGINE = "══════════ 🧠 NEURAL ENGINE ══════════"
string G_AI_PATTERNS = "══════════ 🔬 PATTERN SELECTION ══════════"
string G_AI_VISUALS = "══════════ 🎨 VISUALS & SIGNALS ══════════"
string G_AI_DASH = "══════════ 📋 BRAIN STATE DASHBOARD ══════════"
string G_AI_ALERTS = "══════════ 🔔 ALERTS ══════════"
// ═══════════════════════════════════════════════════════════
// NEURAL ENGINE CONTROLS
// ═══════════════════════════════════════════════════════════
bool i_enable_ai = input.bool(true, "✨ Enable Neural Pattern Engine", group = G_AI_ENGINE,
tooltip="Master switch to enable or disable the entire pattern recognition and learning system.")
float i_plasticity = input.float(0.03, "Synaptic Plasticity (Learning Rate)", minval=0.01, maxval=0.1, step=0.01, group = G_AI_ENGINE,
tooltip="Controls how quickly the AI adapts to pattern performance. " +
"• Low (0.01-0.02): Slow, stable learning. Good for long-term adaptation. " +
"• Medium (0.03-0.05): Balanced adaptation (Recommended). " +
"• High (0.06-0.10): Fast, aggressive learning. Adapts quickly to new market regimes but can be more volatile.")
float i_filter_threshold = input.float(0.8, "Neural Filter Threshold", minval=0.5, maxval=1.0, step=0.05, group = G_AI_ENGINE,
tooltip="The AI will automatically hide (filter) signals from any pattern category whose learned 'Bias' falls below this value. Set to 0.5 to disable filtering.")
// ═══════════════════════════════════════════════════════════
// PATTERN SELECTION
// ═══════════════════════════════════════════════════════════
bool i_scan_candles = input.bool(true, "🕯️ Candlestick Patterns", group = G_AI_PATTERNS, inline="row1")
bool i_scan_vsa = input.bool(true, "📦 Volume Spread Analysis", group = G_AI_PATTERNS, inline="row1")
bool i_scan_geometry = input.bool(true, "📐 Geometric Patterns", group = G_AI_PATTERNS, inline="row2")
bool i_scan_structure = input.bool(true, "📈 Market Structure (SMC)", group = G_AI_PATTERNS, inline="row2")
bool i_scan_harmonic = input.bool(false, "🦋 Harmonic Setups (Experimental)", group = G_AI_PATTERNS, inline="row3",
tooltip="Harmonic detection is simplified and experimental. Enable for additional confluence but use with caution.")
// ═══════════════════════════════════════════════════════════
// VISUALS & SIGNALS
// ═══════════════════════════════════════════════════════════
bool i_show_signals = input.bool(true, "Show Pattern Signals on Chart", group = G_AI_VISUALS)
color i_bull_color = input.color(#00FF88, "Bullish Signal Color", group = G_AI_VISUALS, inline="colors")
color i_bear_color = input.color(#FF0055, "Bearish Signal Color", group = G_AI_VISUALS, inline="colors")
string i_signal_size = input.string("Small", "Signal Size", options= , group = G_AI_VISUALS)
//══════════════════════════════════════════════════════
// BRAIN STATE DASHBOARD
//══════════════════════════════════════════════════════
bool i_show_dashboard = input.bool(true, "Show Brain State Dashboard", group = G_AI_DASH)
string i_dash_position = input.string("Bottom Right", "Position", options= , group = G_AI_DASH)
string i_dash_size = input.string("Small", "Size", options= , group = G_AI_DASH)
// ══════════════════════════════════════════════════════════
// ALERTS
// ═══════════════════════════════════════════════════════════
bool i_enable_alerts = input.bool(true, "Enable All Pattern Alerts", group = G_AI_ALERTS)
int i_alert_min_confidence = input.int(75, "Min Neural Confidence to Alert (%)", minval=50, maxval=100, group = G_AI_ALERTS)
█ DEVELOPMENT PHILOSOPHY
The DafePatternLib was born from a vision to bring the principles of modern AI to the world of technical analysis on TradingView. We believe that an indicator should not be a static, lifeless tool. It should be a dynamic, intelligent partner that learns and adapts alongside the trader. This library is an open-source framework designed to empower developers to build the next generation of smart indicators, moving beyond fixed rules and into the realm of adaptive, performance-driven intelligence.
This library is designed to be a tool for that discipline. By providing an objective, data-driven, and self-correcting analysis of patterns, it helps to remove the emotional guesswork and second-guessing that plagues so many traders, allowing you to act with the cold, calculated confidence of a machine.
█ A NOTE TO USERS & DISCLAIMER
THIS IS A LIBRARY FOR DEVELOPERS: This script does nothing on its own. It is a powerful engine that must be imported and used by other indicator developers in their own scripts.
THE AI LEARNS, IT DOES NOT PREDICT: The reinforcement learning is based on the recent historical performance of patterns. It is a powerful statistical edge, but it is not a crystal ball. Past performance does not guarantee future results.
ALL TRADING INVOLVES RISK: The patterns and confidence scores are for informational and educational purposes only. Always use proper risk management.
**Please be aware that this is a library script and has no visual output on its own. The charts, signals, and dashboards shown in the images were created with a separate demonstration indicator that utilizes this library's powerful pattern recognition and learning engine.
"The key to trading success is emotional discipline. If intelligence were the key, there would be a lot more people making money trading."
— Victor Sperandeo, Market Wizard
Taking you to school. - Dskyz, Create with DAFE
SELF FU Wick Sweep + Inside Close//@version=5
indicator("SELF FU Wick Sweep + Inside Close", overlay=true)
// Oldingi va joriy sham holati
prevBull = close > open
prevBear = close < open
currBull = close > open
currBear = close < open
// Wick ikkala tomondan sweep
wickSweep = high > high and low < low
// Yopilish narxi oldingi sham ichida
closeInsidePrev = close < high and close > low
// Bearish SELF FU
bearSELFFU = prevBull and currBear and wickSweep and closeInsidePrev
plotshape(bearSELFFU, title="Bearish SELF FU", location=location.abovebar,
style=shape.labeldown, color=color.red, text="SELF FU", textcolor=color.white)
// Bullish SELF FU
bullSELFFU = prevBear and currBull and wickSweep and closeInsidePrev
plotshape(bullSELFFU, title="Bullish SELF FU", location=location.belowbar,
style=shape.labelup, color=color.green, text="SELF FU", textcolor=color.white)
SSL Channel with SignalsSSL cross with arrow signaling. Crossover, triangle shape. Signaling longs and shorts.
Inversion ZonesInversion Zones is a simple indicator designed to help identify potential price reversal areas, based on liquidity behavior.
The indicator highlights zones where the market:
approaches an area of interest (Supply or Demand),
takes liquidity above or below that zone,
and shows a possible price reaction.
It does not provide automatic entry signals, but helps traders read market context and understand where the price may react, leaving the final trading decision to the trader.All the indicator parameters are fully adjustable, allowing it to be adapted to:
your own trading style,
the timeframe you use,
and the market you trade.
Each trader can choose whether the indicator should be:
more conservative or more reactive,
more focused on market context or on timing.
1m sweep entry helperThis script is designed to aid in sweep trades where the intention is to mean revert after grabbing sellside of buyside liquidity. This script specifically helps with identifying 1m pivot liquidity and targets for the trades.
RTR - Indecision Box Buy/Sell 3RRRTR Buy and Sell Indicator
The RTR Buy and Sell indicator is a technical analysis tool designed to identify potential buying and selling opportunities in the market. It generates buy signals when market conditions suggest a possible upward movement, and sell signals when conditions indicate a potential downward move. The indicator helps traders make more informed decisions by highlighting trend changes and optimal entry and exit points.
Adaptive Buy Sell Signal [AvantCoin]A comprehensive customized indicator for different markets:
🌍 Market-Specific Optimizations
Auto-Detection (or Manual Selection):
It automatically detects which market you're trading:
Forex (EUR/USD, GBP/USD, etc.)
Stocks (AAPL, TSLA, etc.)
Indices (NAS100, SPX, etc.)
Commodities (Gold, Silver, Oil)
Crypto (BTC, ETH, etc.)
Forex-Specific Features:
✅ Session Filters: Avoids low-liquidity Asian session
✅ Session backgrounds: Green for London/NY overlap (best trading time)
✅ Tighter ADX threshold (20) - good for Forex trends
✅ Lower volatility filter - skips dead zones
⚙️ Min Confluence: 5 (balanced)
⚙️ Cooldown: 5 bars
⚙️ Volume threshold: 1.3x (Forex has consistent volume)
Stocks-Specific Features:
✅ Market hours filter: Only signals during NYSE hours.
✅ Gap detection: Avoids trading immediately after large gaps up/down
✅ Higher ADX threshold (22) - Stocks trend differently
✅ Stricter volume requirement (1.5x) - Stocks vary more
⚙️ Min Confluence: 6 (higher quality)
⚙️ Cooldown: 3 bars (stocks move faster)
Indices (Nasdaq, S&P 500):
✅ Similar to stocks but slightly more lenient
✅ Lower ADX (18) - Indices are smoother
⚙️ Min Confluence: 5
⚙️ Cooldown: 4 bars
Commodities (Gold, Silver, Oil):
✅ Highest ADX requirement (23) - Only trade strong trends
✅ Higher volatility filter (1.6x) - Commodities can be wild
⚙️ Min Confluence: 6
⚙️ Cooldown: 6 bars (avoid whipsaws)
Crypto:
✅ 24/7 trading (no session restrictions)
✅ Lower ADX (15) - Crypto is always volatile
✅ Much higher volume threshold (2.0x) - Crypto volume spikes
⚙️ Min Confluence: 4 (crypto moves fast)
⚙️ Cooldown: 3 bars
📊 Visual Enhancements:
Market Type Badge at top of table (Forex, Stocks, etc.)
Session Status:
Forex: Shows 🟢 LDN/NY, 🔵 London, 🟠 NY, 🔴 Asian
Stocks: Shows 🟢 Open or 🔴 Closed
Session Background Colors on chart (optional)
Current Settings Display: Shows your Min score, ADX threshold, Cooldown
⚙️ How to Use:
For Forex:
Enable "Avoid Asian Session"
Best signals during London/NY overlap
For Stocks:
Enable "Trade Stock Hours Only"
Watch for gap warnings
🎯 Expected Performance by Market:
Forex (Major pairs) 60-70% - Smooth trends, high liquidity.
Stocks (Large cap) 65-75% - Clear trends, predictable.
Indices 60-70% - Follow market sentiment.
Commodities 55-65% More volatile, harder.
Crypto 50-60% Extremely volatile.
Smooth MTF EMA Cloud - ProEma cloud that has multiple time frames and is smoothed. No choppy outlines on the ema resolution between different time frames.
Current Trade Holding Time (H:M:S)Purpose:
This TradingView Pine Script strategy tracks your current open trade and displays its holding time in a table on the chart’s bottom-left corner, updating live as each bar forms. It also optionally shows a label above the price with the current holding time in hours, minutes, and seconds.
Features:
Entry / Exit Logic:
Buy Condition: When the 9-period SMA crosses above the 21-period SMA.
Sell Condition: When the 9-period SMA crosses below the 21-period SMA.
(These are example conditions — you can replace them with your own strategy.)
Table Display:
Always visible in the bottom-left corner.
Columns:
Bars: Number of bars the trade has been open.
Days: Total days held (decimal).
Hours: Total full hours held.
Minutes: Remaining minutes.
Seconds: Remaining seconds.
Updates live while the trade is open.
Clears automatically when the trade closes.
Optional Chart Label:
Shows Hours:Minutes:Seconds above the highest price of the current bar.
Can be turned on/off using the Show Labels input.
Single Trade Tracking:
Only the current open trade is displayed.
Past trades are not recorded in the table, keeping it clean.
Time Calculation:
Uses time, the bar timestamp, for precise elapsed time.
Converts milliseconds to seconds, minutes, hours, and days for display.
Intended Use:
Traders who want to monitor exactly how long their open trade has been held.
Useful for scalping or swing trading, where holding time matters.
Works on any timeframe chart.
Volatilidad (COCIENTE close) 14/90 + Zonas📊 Volatility (CLOSE RATIO) 14/90 + Zones
This indicator measures relative market volatility by comparing the daily price range to the daily closing price, and then evaluating that value against its historical behavior over short-term (14) and medium-term (90) periods.
Unlike traditional volatility approaches based solely on the High–Low range, this indicator introduces a close-normalized ratio, providing a more realistic and comparable volatility measure across assets with different prices or trading regimes.
🔍 Calculation Methodology
SMA 14 → short-term reference
SMA 90 → medium-term reference
Normalized Volatility
Volatility 14 = (Ratio / SMA14) × 100
Volatility 90 = (Ratio / SMA90) × 100
These two curves show whether current volatility is below, near, or above its historical norm.
🎨 Color Zones (Market Context)
The background color dynamically reflects volatility conditions, allowing immediate visual interpretation:
🟢 Green – Low volatility / stable environment
🟡 Yellow – Moderate volatility
🟠 Orange – High volatility
🟤 Brown – Very high volatility / caution zone
🔴 Red – Extreme volatility / elevated risk
The zones can be calculated using either the 14-period or 90-period volatility, depending on user preference.
📈 Practical Interpretation
Low volatility (green/yellow):
Favorable environment for trend-following strategies and structured entries.
Rising volatility (orange/brown):
Increased risk, potential breakouts, or exhaustion phases.
Extreme volatility (red):
Unstable market conditions, prone to sharp reversals, whipsaws, and emotional price action.
This indicator does not generate entry or exit signals. It is designed as a context and risk filter, helping traders decide when to trade and when to stay out.





















