Advance SMC (Milad Tayefi)Smart money indicator which recognizes market structure and produces buy/sell signals.
트렌드 어낼리시스
Buy Sell Signal (Improved Simple)Buy Sell Signal (Improved Simple) es un indicador mejorado del original
Heikin Ashi + Real Price OverlayHeikin-Ashi + Real Price Overlay
This indicator combines the smooth trend visualization of Heikin-Ashi candles with the true market price for precise execution.
Features:
Heikin-Ashi Candles: Provides a clear, smoothed view of market trends and momentum.
Real Close Price Overlay: Plots the actual closing price as a line on top of HA candles, ensuring accurate entry, exit, and stop placement.
Trend-Based Coloring: The real price line is colored according to HA trend (green for bullish, red for bearish), making trend bias instantly visible.
Lightweight and ideal for scalping, day trading, or any strategy where trend bias + exact price matters.
Use Case:
Use HA candles to identify market bias and momentum.
Use the real price line for precise entries, exits, and stop levels.
Perfect for traders who want the clarity of HA without sacrificing real price accuracy.
BTC ETF Average Inflow Cost BasisConcept
Since the historic launch of Bitcoin Spot ETFs on January 11, 2024, institutional flows have become a major driver of price action. This indicator aims to visualize the aggregate Cost Basis (average entry price) of the major Bitcoin ETFs relative to the underlying asset.
It serves as an on-chain proxy for institutional positioning, helping traders identify critical support levels where ETF inflows have historically concentrated.
How it Works
The script aggregates daily volume data from the top Bitcoin ETFs (IBIT, FBTC, ARKB, GBTC, BITB) and compares it against the Bitcoin price (BTCUSDT).
ETF Cost Basis (Pink Line):
This is calculated as a Cumulative Volume-Weighted Average Price (VWAP), anchored specifically to the ETF launch date (Jan 11, 2024).
Formula: It accumulates (BTC Price * Total ETF Volume) and divides it by the Cumulative Total ETF Volume.
This creates a dynamic level representing the "breakeven" price for the aggregate volume traded through these funds.
True Market Mean (Gray Line):
This represents the simple cumulative average of the Bitcoin price since the ETF launch date. It acts as a neutral baseline for the post-ETF market era.
How to Use
Institutional Support: The Cost Basis line often acts as a strong dynamic support level during corrections. When price revisits this level, it suggests the market is returning to the average institutional entry price.
Trend Filter:
Price > Cost Basis: The market is in a net profit state relative to ETF flows (Bullish/Trend continuation).
Price < Cost Basis: The market is in a net loss state (Bearish/Capitulation risk).
Confluence: The intersection of the Cost Basis and the True Market Mean can signal pivotal moments of trend reset.
Features
Data Aggregation: Pulls data from 5 major ETFs via request.security without repainting (using closed bars).
Dashboard: Includes a table in the top-right corner displaying real-time values for Price, Cost Basis, and Market Mean.
Customization: You can toggle individual ETF Moving Averages in the settings (disabled by default due to price scale differences between BTC and ETF shares).
Disclaimer
This tool is for educational purposes only and attempts to estimate institutional cost basis using volume proxies. It does not represent financial advice.
Dolar MEP Implicito de CEDEARs y ADRs**Implicit USD Exchange Rate from CEDEARs and ADRs**
This indicator calculates the implicit ARS/USD exchange rate using CEDEAR pairs traded on the Argentine stock exchange (BYMA). It compares the ARS price of a CEDEAR against its USD MEP version (D-suffix ticker) to derive the implicit dollar rate.
**How it works:**
Divide the ARS ticker price by the D-suffix ticker price. Example: AAPL / AAPLD = Implicit rate.
**Features:**
• Top 10 CEDEARs ranked by 30-day average volume
• AL30/AL30D bond benchmark as white reference line
• Filter: Top 5, Top 10, or All
• Custom ticker input field
• Info box with best buy and best sell rates
• Colored labels for each ticker
**Default Tickers:** PAMP, GGAL, AMZN, IBIT, GOOGL, NVDA, MELI, VIST, NFLX, GLD
**Usage:** Apply to any chart. Works independently of chart symbol.
**Disclaimer:** For informational and educational purposes only. Eco Valores S.A. does NOT provide investment advice. Consult a qualified financial advisor before investing.
Eco Valores S.A. - ALyC 109/CNV
Slope Averages
📊 Indicator Overview: Three Moving Averages Slope Table
This indicator is designed to calculate and display the slopes and averages of three different moving averages (MAs) in a table format. It helps traders quickly visualize the direction and strength of multiple moving averages, as well as their combined averages, across different timeframes.
⚙️ Inputs and Configuration
• MA Type 1, 2, 3: Choose the type of moving average for each line. Options:
• (Exponential Moving Average)
• (Simple Moving Average)
• (Weighted Moving Average)
• (Volume-Weighted Moving Average)
• (a custom smoother using multiple EMAs)
• Length 1, 2, 3: Periods for each moving average (e.g., 20, 50, 100).
• Source: The price source used (default = ).
• Extra Timeframes (optional): You can configure up to 3 additional timeframes (e.g., 1h, 4h, Daily) to compare the combined average across different chart periods.
🔧 Functions Explained
1. tilson(src, length)
• A custom moving average that smooths price using 8 sequential EMAs.
• Produces a smoother line than a standard EMA.
2. getMA(src, length, maType)
• Selects the correct moving average type based on user input.
• Returns the chosen MA value.
3. Slope Calculation
• Each slope is calculated as:
• This converts the difference between current and previous MA values into an angle in degrees.
• Positive slope = upward trend, negative slope = downward trend.
4. Combined Slopes
• : Average slope of all three MAs.
• , , : Average slopes of pairs of MAs.
5. Combined Averages
• : Average of MA1 and MA2.
• : Average of MA2 and MA3.
• : Average of MA1 and MA3.
• : Average of all three MAs.
6. Color Function
• : Returns green if value ≥ 0, red if value < 0.
• Used to color table cells for quick visual feedback.
📋 Table Output
The table shows:
1. Individual slopes of MA1, MA2, MA3.
2. Average slope of all three.
3. Combined averages (M1+M2, M2+M3, M1+M3).
4. Combined slopes of pairs.
5. Overall average .
6. Optional: RSI or multi-timeframe averages can also be added.
Each value cell is colored green if positive, red if negative, making it easy to spot bullish or bearish conditions.
🎯 How to Use It
• Trend Strength: Look at the slope values. Steeper positive slopes = stronger uptrend; steep negative slopes = stronger downtrend.
• Confluence: When all three MAs and their combined averages point in the same direction, it signals strong trend alignment.
• Multi-Timeframe Analysis: Configure extra timeframes to see if short-term and long-term averages agree. If they align, confidence in the trend increases.
• RSI Integration (optional): Add RSI to confirm momentum. For example, bullish slope + RSI > 50 = stronger buy signal.
✅ Practical Example
• MA1 = EMA(20), MA2 = SMA(50), MA3 = WMA(100).
• If slope1, slope2, slope3 are all positive and green, and is also green → strong bullish trend.
• If slopes are mixed (some green, some red), the market is consolidating.
• If all slopes are red and is red → strong bearish trend.
Dynamic Multi-Timeframe SMAs (Brian Shannon Style)Overview : This indicator implements the logic of Brian Shannon's "Multi-Timeframe Analysis" on intraday charts. It automatically calculates the correct length for the 5-Day and 50-Day Simple Moving Averages (SMA), regardless of the timeframe (e.g., 5m, 15m, 1h) you are viewing.
How it works Standard SMAs only count bars. A "50 SMA" on a 5-minute chart only looks back ~4 hours. This script dynamically calculates how many bars represent full trading days.
Features:
Asset Class Selector : Choose between Crypto (24/7) and Stocks (6.5h US Session) to ensure correct minute-per-day calculations.
Info Table : Displays exactly how many bars are being used for the calculation in real-time.
Hicham XAUUSD Key Levels PRO (1H / 4H + Psychological)🔑 XAUUSD Key Levels PRO | 1H / 4H Structure + Psychological Levels
This indicator is designed specifically for Gold (XAUUSD) traders who want clean, institutional-grade key levels without chart clutter.
It combines market structure levels with true psychological price levels used by institutions, making it ideal for scalping, intraday, and swing trading.
📌 Features
🔹 Market Structure Key Levels
Automatic 1H & 4H High / Low detection
Based on swing pivots (configurable strength)
Solid lines for clear structure visibility
🔹 Gold Psychological Levels (XAUUSD)
Major levels: every 500$ (strong institutional zones)
Medium levels: every 250$
Minor levels: every 10$
Dynamic levels around current price
No line spam, optimized performance
🔹 Visual Clarity
Solid / dashed / dotted line styles
Custom colors & line thickness
Optional price labels
Works perfectly on M1 → H4
🎯 Best Use Cases
Liquidity sweeps & reactions
Premium / discount zones
Stop-loss & take-profit placement
Confluence with BOS / CHoCH
London & New York sessions
⚙️ Fully Customizable
Toggle 1H / 4H levels
Adjust psychological level spacing
Enable / disable labels
Clean & lightweight (no lag)
⚠️ Notes
Optimized for XAUUSD (Gold)
Best results when combined with price action & structure
Not a trading signal indicator
If you want:
Session-based levels
Alerts on key levels
Smart Money Concepts integration
Feel free to comment or DM 👊
Happy trading 💛📈
All-in-One Momentum Composite The Four Components (and Why They're Chosen)
RSI (Relative Strength Index) – Classic overbought/oversold oscillator (14-period default). Measures speed and change of price movements.
Stochastic (%D line) – Smoothened momentum indicator that compares closing price to the price range over a period. Excellent at spotting reversals in ranging markets.
WaveTrend – Very popular in crypto and forex communities (originally by LazyBear). It’s essentially a momentum oscillator based on overbought/oversold channels, similar to a faster, smoother RSI/Stochastic hybrid. Known for early divergence signals and clean crossovers.
MACD Histogram – Captures momentum changes and trend strength via the difference between fast and slow EMAs. The histogram shows acceleration/deceleration.
SMI Trigger System The SMI Trigger System is a lower-pane momentum indicator based on a Hull-smoothed Stochastic Momentum Index (SMI). It is designed to assist in identifying potential momentum shifts by highlighting signal alignment and level interactions.
This indicator is intended to be used as part of a broader analysis framework. Confluence between trend, structure, and higher-timeframe context defines the setup, while SMI signal behavior may be used for confirmation.
The script can be applied across multiple timeframes and markets. It does not generate trade signals on its own and should be used alongside additional analysis and risk management techniques.
For educational purposes only. Not financial advice.
SMAHiLO- 2 EMA/SMA can be used for trend following default value is 50 and 200
- green box and red box incorporated to chart for visual representation for Week ,Daily, H4, H2,H1
- blue line representation for opening candle, previous low and previous high and by clicking prev. close open alert at setting it will alert if prev. low or high are reach and current opening candle is breakdown or breakout
settings:
- engulfing alert it will alert bullish engulfing entry if 50 is above 200 vise versa
- harami alert it will alert bullish harami if 50 is above 200 vise versa
- pullback alert it will alert bullish pullback if 50 is above 200 or bearish pullback if 50 below 200
- mcd ob/os alert it will display green circle above candle if macd getting weaker from bearish to bullish vise versa
- spot play alert most of the time buy alert only no sell alert.
- engul/harami alert it will alert if harami or engulfing is met unlike on engulfing alert and harami alert it will follow the trend if 50 above 200 vise versa.
Universe_Super MA [MTF & Multi-Type]**Overview**
"Universe_Super MA" is a comprehensive trend analysis tool designed to overcome indicator limits. Instead of adding 4 separate moving averages, this script allows you to monitor 4 distinct Moving Averages within a single indicator slot.
It features full **Multi-Timeframe (MTF)** capabilities, meaning you can view higher timeframe trends (e.g., Daily 200 SMA) while trading on lower timeframes (e.g., 15-minute chart).
**Default Configuration (Institutional Setup)**
The indicator comes pre-loaded with a powerful institutional trend setup:
1. **50 Period (Green):** Short-term trend and dynamic support.
2. **99 Period (Orange):** Medium-term trend filter.
3. **200 Period (Red):** The classic institutional dividing line between Bull and Bear markets.
4. **389 Period (Blue):** A long-term "Deep Trend" baseline used to identify major market cycles and heavy support/resistance levels.
**Key Features**
* **fully Customizable:** You can change the Length, Color, and Width of each line.
* **Multi-Timeframe (MTF):** Select any timeframe for any MA. (e.g., Keep MA1 on the "Chart" timeframe, but lock MA4 to the "Daily" timeframe).
* **6 MA Types:** Choose between SMA, EMA, WMA, HMA (Hull), RMA, and VWMA for each line independently.
* **Clean Interface:** Toggle any line On/Off via settings without removing the indicator.
**Usage & Interpretation**
* **Trend Identification:** The 200 (Red) and 389 (Blue) lines are designed to visualize the long-term market bias. In technical analysis, price action sustaining above these levels is generally considered a bullish context, while price below suggests a bearish context.
* **Crossover Monitoring:** The script facilitates the observation of interactions between short-term and long-term averages (e.g., the 50 crossing the 200), allowing users to easily spot common technical patterns like the "Golden Cross".
* **Dynamic Levels:** The 99 and 200-period lines act as dynamic levels that may align with technical support or resistance zones during market retracements.
**Settings**
* **Timeframe:** Leave empty to use the current chart's timeframe, or select a specific one (e.g., "1D" or "4H").
* **Type:** Select your preferred calculation method (SMA is default).
**Disclaimer**
This tool is for educational purposes and trend visualization only. Always manage your risk.
Wavelet Candle Constructor (Inc. Morlet) 2Here is the detailed description of the **Wavelet Candle** construction principles based on the code provided.
This indicator is not a simple smoothing mechanism (like a Moving Average). It utilizes the **Discrete Wavelet Transform (DWT)**, specifically the Stationary variant (SWT / à Trous Algorithm), to separate "noise" (high frequencies) from the "trend" (low frequencies).
Here is how it works step-by-step:
###1. The Wavelet Kernel (Coefficients)The heart of the algorithm lies in the coefficients (the `h` array in the `get_coeffs` function). Each wavelet type represents a different set of mathematical weights that define how price data is analyzed:
* **Haar:** The simplest wavelet. It acts like a simple average of neighboring candles. It reacts quickly but produces a "boxy" or "jagged" output.
* **Daubechies 4:** An asymmetric wavelet. It is better at detecting sudden trend changes and the fractal structure of the market, though it introduces a slight phase shift.
* **Symlet / Coiflet:** More symmetric than Daubechies. They attempt to minimize lag (phase shift) while maintaining smoothness.
* **Morlet (Gaussian):** Implemented in this code as a Gaussian approximation (bell curve). It provides the smoothest, most "organic" effect, ideal for filtering noise without jagged edges.
###2. The Convolution EngineInstead of a simple average, the code performs a mathematical operation called **convolution**:
For every candle on the chart, the algorithm takes past prices, multiplies them by the Wavelet Kernel weights, and sums them up. This acts as a **digital low-pass filter**—it allows the main price movements to pass through while cutting out the noise.
###3. The "à Trous" Algorithm (Stationary Wavelet Transform)This is the key difference between this indicator and standard data compression.
In a classic wavelet transform, every second data point is usually discarded (downsampling). Here, the **Stationary** approach is used:
* **Level 1:** Convolution every **1** candle.
* **Level 2:** Convolution every **2** candles (skipping one in between).
* **Level 3:** Convolution every **4** candles.
* **Level 4:** Convolution every **8** candles.
Because of this, **we do not lose time resolution**. The Wavelet Candle is drawn exactly where the original candle is, but it represents the trend structure from a broader perspective. The higher the `Decomposition Level`, the deeper the denoising (looking at a wider context).
###4. Independent OHLC ProcessingThe algorithm processes each component of the candle separately:
1. Filters the **Open** series.
2. Filters the **High** series.
3. Filters the **Low** series.
4. Filters the **Close** series.
This results in four smoothed curves: `w_open`, `w_high`, `w_low`, `w_close`.
###5. Geometric Reconstruction (Logic Repair)Since each price series is filtered independently, the mathematics can sometimes lead to physically impossible situations (e.g., the smoothed `Low` being higher than the smoothed `High`).
The code includes a repair section:
```pinescript
real_high = math.max(w_high, w_low)
real_high := math.max(real_high, math.max(w_open, w_close))
// Same logic for Low (math.min)
```
This guarantees that the final Wavelet Candle always has a valid construction: wicks encapsulate the body, and the `High` is strictly the highest point.
---
###Summary of ApplicationThis construction makes the Wavelet Candle an **excellent trend-following tool**.
* If the candle is **green**, it means that after filtering the noise (according to the selected wavelet), the market energy is bullish.
* If it is **red**, the energy is bearish.
* The wicks show volatility that exists within the bounds of the selected decomposition level.
Here is a descriptive comparison of **Wavelet Candles** against other popular chart types. As requested, this is a narrative explanation focusing on the differences in mechanics, interpretation philosophy, and the specific pros and cons of each approach.
---
###1. Wavelet Candles vs. Standard (Japanese) CandlesThis is a clash between "the raw truth" and "mathematical interpretation." Standard Japanese candles display raw market data—exactly what happened on the exchange. Wavelet Candles are a synthetic image created by a signal processor.
**Differences and Philosophy:**
A standard candle is full of emotion and noise. Every single price tick impacts its shape. The Wavelet Candle treats this noise as interference that must be removed to reveal the true energy of the trend. Wavelets decompose the price, reject high frequencies (noise), and reconstruct the candle using only low frequencies (the trend).
* **Wavelet Advantages:** The main advantage is clarity. Where a standard chart shows a series of confusing candles (e.g., a long green one, followed by a short red one, then a doji), the Wavelet Candle often draws a smooth, uniform wave in a single color. This makes it psychologically easier to hold a position and ignore temporary pullbacks.
* **Wavelet Disadvantages:** The biggest drawback is the loss of price precision. The Open, Close, High, and Low values on a Wavelet candle are calculated, not real. You **cannot** place Stop Loss orders or enter trades based on these levels, as the actual market price might be in a completely different place than the smoothed candle suggests. They also introduce lag, which depends on the chosen wavelet—whereas a standard candle reacts instantly.
###2. Wavelet Candles vs. Heikin AshiThese are close cousins, but they share very different "DNA." Both methods aim to smooth the trend, but they achieve it differently.
**Differences and Philosophy:**
Heikin Ashi (HA) is based on a simple recursive arithmetic average. The current HA candle depends on the previous one, making it react linearly.
The Wavelet Candle uses **convolution**. This means the shape of the current candle depends on a "window" (group) of past candles multiplied by weights (Gaussian curve, Daubechies, etc.). This results in a more "organic" and elastic reaction.
* **Wavelet Advantages:** Wavelets are highly customizable. With Heikin Ashi, you are stuck with one algorithm. With Wavelet Candles, you can change the kernel to "Haar" for a fast (boxy) reaction or "Morlet" for an ultra-smooth, wave-like effect. Wavelets handle the separation of market cycles better than simple HA averaging, which can generate many false color flips during consolidation.
* **Wavelet Disadvantages:** They are computationally much more complex and harder to understand intuitively ("Why is this candle red if the price is going up?"). In strong, vertical breakouts (pumps), Heikin Ashi often "chases" the price faster, whereas deep wavelet decomposition (High Level) may show more inertia and change color more slowly.
###3. Wavelet Candles vs. RenkoThis compares two different dimensions: Time vs. Price.
**Differences and Philosophy:**
Renko completely ignores time. A new brick is formed only when the price moves by a specific amount. If the market stands still for 5 hours, nothing happens on a Renko chart.
The Wavelet Candle is **time-synchronous**. If the market stands still for 5 hours, the Wavelet algorithm will draw a series of flat, small candles (the "wavelet decays").
* **Wavelet Advantages:** They preserve the context of time, which is crucial for traders who consider trading sessions (London/New York) or macroeconomic data releases. On a wavelet chart, you can see when volatility drops (candles become small), whereas Renko hides periods of stagnation, which can be misleading for options traders or intraday strategies.
* **Wavelet Disadvantages:** In sideways trends (chop), Wavelet Candles—despite the smoothing—will still draw a "snake" that flips colors (unless you set a very high decomposition level). Renko can remain perfectly clean and static during the same period, not drawing any new bricks, which for many traders is the ultimate filter against overtrading in a flat market.
###Summary**Wavelet Candles** are a tool for the analyst who wants to visualize the **structure of the wave and market cycle**, accepting some lag in exchange for noise reduction, but without giving up the time axis (like in Renko) or relying on simple averaging (like in Heikin Ashi). It serves best as a "roadmap" for the trend rather than a "sniper scope" for precise entries.
EMA COLOR CHANCE
indicator("Renk Değiştiren EMA & Mum Al-Sat", overlay=true)
emaLength = input.int(50, "EMA Periyodu", minval=1)
emaValue = ta.ema(close, emaLength)
trendUp = close > emaValue
trendDown = close < emaValue
plot(emaValue, title="EMA", color = (trendUp ? color.lime : color.red), linewidth=2)
barcolor(trendUp ? color.lime : color.red)
buySignal = ta.crossover(close, emaValue)
sellSignal = ta.crossunder(close, emaValue)
plotshape(buySignal, title="BuySignal", location=location.belowbar, style=shape.triangleup, size=size.large, color=color.lime)
plotshape(sellSignal, title="SellSignal", location=location.abovebar, style=shape.triangledown, size=size.large, color=color.red)
alertcondition(buySignal, title="AL Sinyali", message="AL sinyali - fiyat EMA'yı yukarı kesti")
alertcondition(sellSignal, title="SAT Sinyali", message="SAT sinyali - fiyat EMA'yı aşağı kesti")
Hybrid Strategy: Trend/ORB/MTFHybrid Strategy: Trend + ORB + Multi-Timeframe Matrix
This script is a comprehensive "Trading Manager" designed to filter out noise and identify high-probability breakout setups. It combines three powerful concepts into a single, clean chart interface: Trend Alignment, Opening Range Breakout (ORB), and Multi-Timeframe (MTF) Analysis.
It is designed to prevent "analysis paralysis" by providing a unified Dashboard that confirms if the trend is aligned across 5 different timeframes before you take a trade.
How it Works
The strategy relies on the "Golden Trio" of confluence:
1. Trend Definition (The Setup) Before looking for entries, the script analyzes the immediate trend. A bullish trend is defined as:
Price is above the Session VWAP.
The fast EMA (9) is above the slow EMA (21). (The inverse applies for bearish trends).
2. The Signal (The Trigger) The script draws the Opening Range (default: first 15 minutes of the session).
Buy Signal: Price breaks above the Opening Range High while the Trend is Bullish.
Sell Signal: Price breaks below the Opening Range Low while the Trend is Bearish.
3. The Confirmation (The Filter) A signal is only valid if the Higher Timeframe (default: 60m) agrees with the direction. If the 1m chart says "Buy" but the 60m chart is bearish, the signal is filtered out to prevent false breakouts.
Key Features
The Matrix Dashboard A zero-lag, real-time table in the corner of your screen that monitors 5 user-defined timeframes (e.g., 5m, 15m, 30m, 60m, 4H).
Trend: Checks if Price > EMA 21.
VWAP: Checks if Price > VWAP.
ORB: Checks if Price is currently above/below the Opening Range of that session.
D H/L: Warns if price is near the Daily High or Low.
PD H/L: Warns if price is near the Previous Daily High or Low.
Visual Order Blocks The script automatically identifies valid Order Blocks (sequences of consecutive candles followed by a strong explosive move).
Chart: Draws Green/Red zones extending to the right, showing where price may react.
Dashboard: Displays the exact High, Low, and Average price of the most recent Order Blocks for precision planning.
Risk Management (Trailing Stop) Once a trade is active, the script plots Chandelier Exit dots (ATR-based trailing stop) to help you manage the trade and lock in profits during trend runs.
Visual Guide (Chart Legend)
⬜ Gray Box: Represents the Opening Range (first 15 minutes). This is your "No Trade Zone." Wait for price to break out of this box.
🟢 Green Line: The Opening Range High. A break above this line signals potential Bullish momentum.
🔴 Red Line: The Opening Range Low. A break below this line signals potential Bearish momentum.
🟢 Green / 🔴 Red Zones (Boxes): These are Order Blocks.
🟢 Green Zone: A Bullish Order Block (Demand). Expect price to potentially bounce up from here.
🔴 Red Zone: A Bearish Order Block (Supply). Expect price to potentially reject down from here.
⚪ Dots (Trailing Stop):
🟢 Green Dots: These appear below price during a Bullish trend. They represent your suggested Stop Loss.
🔴 Red Dots: These appear above price during a Bearish trend.
🏷️ Buy / Sell Labels:
BUY: Triggers when Price breaks the Green Line + Trend is Bullish + HTF is Bullish.
SELL: Triggers when Price breaks the Red Line + Trend is Bearish + HTF is Bearish.
Settings
Session: Customizable RTH (Regular Trading Hours) to filter out pre-market noise.
Matrix Timeframes: 5 fixed slots to choose which timeframes you want to monitor.
Order Blocks: Adjust the sensitivity and lookback period for Order Block detection.
Risk: Customize the ATR multiplier for the trailing stop.
Disclaimer
This tool is for educational purposes only. Past performance does not guarantee future results. Always manage your risk properly.
USD Liquidity Regime IndexTrack global risk regimes with this USD Liquidity Composite —
It aims to be a daily macro indicator blending normalised DXY (50%), UUP (20%), 10Y Treasury yields (20%), and VIX (10%).
How to read:
When the blue index is above its red SMA: Strong USD, tightening liquidity → Risk-Off mode (often bearish for Nasdaq, BTC, and risk assets).
When the line is below: Weak USD, abundant liquidity → Risk-On (bullish environment).
Example: In 2022's bear market, the index stayed high above SMA most of the year, signalling persistent Risk-Off as USD surged.
Features on-chart table, regime background colors, and crossover alerts.
Great contextual tool for macro traders IMO.
Educational only — not financial advice.
Use at your own risk.
By @frank_vergaram
Risk & Order Size Calculatorhello,
this will calculate the risk and you may change the script as per your risk appetite, my advise do not risk more than 2% of your capital.
Thank you
Structure Lite - Automatic Major Trend LinesStructure Lite — Automatic Major Trend Lines
Structure Lite automatically detects and plots major market structure using higher-timeframe pivot highs and lows.
It is designed to provide a clean, lightweight view of primary support and resistance without manual drawing or chart clutter.
This script focuses only on major structure and intentionally excludes short-term noise, advanced liquidity concepts, or signal logic.
Features
Automatically plots major resistance (red) and major support (green) trend lines
Uses higher-period pivots to reflect macro / swing structure
Lines extend right for forward projection
Keeps only the most recent major levels to reduce clutter
Optional toggle to hide all trend lines for a clean chart view
How to Use
Add the indicator to your chart
Adjust Major Pivot Period to control how swing-based the structure is
Higher values = fewer, more important levels
Lower values = more responsive structure
Use the plotted lines to:
Identify higher-timeframe support and resistance
Contextualize price action and trend bias
Toggle Hide All Trend Lines to quickly remove structure without removing the indicator
This tool is intended for context and structure awareness, not trade signals.
Design Philosophy
Structure Lite is intentionally minimal:
No alerts
No buy/sell signals
No predictions
No performance claims
It is built as a foundational structure tool that can be combined with the user’s own methodology.
Notes
Some inputs reference advanced features available in a separate professional version
These options are disabled here and included only for interface consistency
No external links, promotions, or monetization are included in this script
Disclaimer
Educational and informational purposes only.
This script does not provide financial advice or trade recommendations.
Past market behavior does not guarantee future results.
© 2025 GammaBulldog
Adaptive RSI Pro# Adaptive RSI Pro / 自适应RSI专业版
[! (img.shields.io)](www.tradingview.com)
[! (img.shields.io)](www.tradingview.com)
[! (img.shields.io)](opensource.org)
Dynamic overbought/oversold thresholds + Multi-Timeframe analysis + Divergence detection + Signal statistics.
根据每个标的实际历史分布动态计算超买/超卖阈值,结合多时间框架分析、背离检测和信号统计。
**Pine Script v6** | **Last Update: 2025-12-17** | **v6.2**
---
## Emoji Legend / 信号图例
### Chart Signals / 图表信号
#### Buy Signals / 买入信号 (底部显示)
| Emoji | Signal Name | Condition | Priority | Action |
|-------|-------------|-----------|----------|--------|
| 🌟 | MTF + Extreme | 3+ timeframes oversold + Z<−2σ | ★★★★★ | **STRONG BUY** 强力买入 |
| 💎 | Divergence + Extreme | Bullish divergence in Z<−2σ zone | ★★★★☆ | **BUY** 买入 |
| 🔥 | Extreme Oversold | Z-Score crosses below −2σ (≈P2) | ★★★☆☆ | **BUY** 买入 |
| ⬆️ | Normal Oversold | Z-Score crosses below −1.5σ (≈P7) | ★★☆☆☆ | Consider buy 考虑买入 (默认隐藏) |
| ↗️ | Bullish Divergence | Price↓ RSI↑ (not in extreme zone) | ★☆☆☆☆ | Watch 观察 (潜在底部) |
#### Sell Signals / 卖出信号 (顶部显示)
| Emoji | Signal Name | Condition | Priority | Action |
|-------|-------------|-----------|----------|--------|
| 🌟 | MTF + Extreme | 3+ timeframes overbought + Z>+2σ | ★★★★★ | **STRONG SELL** 强力卖出 |
| 💎 | Divergence + Extreme | Bearish divergence in Z>+2σ zone | ★★★★☆ | **SELL** 卖出 |
| ❄️ | Extreme Overbought | Z-Score crosses above +2σ (≈P98) | ★★★☆☆ | **SELL** 卖出 |
| ⬇️ | Normal Overbought | Z-Score crosses above +1.5σ (≈P93) | ★★☆☆☆ | Consider sell 考虑卖出 (默认隐藏) |
| ↘️ | Bearish Divergence | Price↑ RSI↓ (not in extreme zone) | ★☆☆☆☆ | Watch 观察 (潜在顶部) |
> **Priority System / 优先级系统**: Only the highest priority signal is shown to prevent overlapping.
> 只显示最高优先级信号,避免叠加。
---
### Dashboard Status / 仪表盘状态
| Emoji | Status | Meaning |
|-------|--------|---------|
| 🟢 | EXTREME OVERSOLD | Z-Score < −2σ (≈P2.3), strong buy zone / 极端超卖区,强买区 |
| 🟡 | OVERSOLD | Z-Score < −1.5σ (≈P6.7), oversold / 超卖 |
| ⚪ | NEUTRAL | −1.5σ ≤ Z-Score ≤ +1.5σ, no signal / 中性,无信号 |
| 🟠 | OVERBOUGHT | Z-Score > +1.5σ (≈P93.3), overbought / 超买 |
| 🔴 | EXTREME OVERBOUGHT | Z-Score > +2σ (≈P97.7), strong sell zone / 极端超买区,强卖区 |
### MTF Status / 多周期状态
| Emoji | Meaning |
|-------|---------|
| 🟢 | Timeframe oversold / 该周期超卖 |
| 🔴 | Timeframe overbought / 该周期超买 |
| ⚪ | Timeframe neutral / 该周期中性 |
### Divergence Status / 背离状态
| Emoji | Meaning |
|-------|---------|
| 🟢 BULL DIV | Bullish divergence detected / 检测到看涨背离 |
| 🔴 BEAR DIV | Bearish divergence detected / 检测到看跌背离 |
| — | No divergence / 无背离 |
---
### Alert Emojis / 警报图标
| Emoji | Alert Type | Description |
|-------|------------|-------------|
| 🎯 | Smart Alert | V6 Unified Alert System / V6统一警报系统 |
---
## Overview / 概述
Traditional RSI uses fixed 30/70 thresholds, but different assets have different volatility characteristics.
传统RSI使用固定的30/70阈值,但不同标的有不同的波动特性。
**Solution**: Calculate thresholds using historical percentiles (P5-P95) + advanced features.
**解决方案**:使用历史百分位(P5-P95)计算阈值 + 高级功能。
---
## Features / 功能特性
### 🎯 Adaptive Thresholds / 自适应阈值
- **Z-Score Based Signals**: Uses statistical Z-Score (±2σ for extreme, ±1.5σ for normal) for consistent cross-asset performance
使用统计Z-Score(极端±2σ,普通±1.5σ)实现跨资产一致性
- **Percentile Lines**: Display P5/P10/P25/P50/P75/P90/P95 for visual reference
百分位线(P5-P95)作为视觉参考
- **Dual Display Modes**: Show Z-Score lines, Percentile lines, or both
双重显示模式:可选择显示Z值线、百分位线或两者
### 🔬 Auto-Adaptive Lookback / 自动自适应回看期
- **Statistical Formula**: Uses `n = (Z × σ / E)²` for optimal sample size calculation
统计公式:使用样本量公式自动计算最优回看期
- **Dual Volatility System**: Combines short-term (4× RSI length) and long-term volatility (configurable: 6M/1Y/2Y)
双重波动率系统:结合短期和长期波动率动态调整
- **Precision Control**: Choose High/Normal/Low precision (adjusts acceptable error margin)
精度控制:高/普通/低精度可选(调整统计误差容忍度)
- **Health Indicators**: Real-time validation of sample coverage, distribution spread, and statistical validity
健康度指标:实时验证样本覆盖率、分布宽度和统计有效性
### 📈 Auto-Adaptive Trend Filter / 自动自适应趋势过滤
- **Auto Mode**: Automatically selects optimal filter based on RSI volatility percentiles
自动模式:根据RSI波动率百分位自动选择最优过滤器
- **5 Filter Modes**: Fixed 50, Adaptive P50, SMA(RSI), BB(RSI), or Auto
5种过滤模式:固定50、自适应P50、RSI均线、布林带或自动
- **Smart Selection**: Low volatility → Fixed 50, Medium → Adaptive P50, High → BB(RSI)
智能选择:低波动→固定50,中波动→自适应P50,高波动→布林带
### 🌍 Multi-Timeframe RSI / 多时间框架RSI
- **3 Configurable Timeframes**: View RSI status across multiple timeframes (default: 1h/4h/D)
3个可配置时间框架:跨周期查看RSI状态(默认:1小时/4小时/日线)
- **Auto-Skip Duplicates**: Automatically detects and skips timeframes matching current chart
自动跳过重复:自动检测并跳过与当前图表相同的时间框架
- **Resonance Detection**: Triggers when 3+ valid timeframes agree (oversold/overbought)
共振检测:当3个以上有效时间框架一致时触发强信号
>
> **MTF Signal Confirmation Timing / 信号确认时机**
>
> - Current timeframe signals update in real-time, confirmed on bar close
> - Higher timeframe signals (e.g., Daily on 1H chart) only update after that timeframe's bar closes
> - **Best Practice**: Wait for current timeframe bar close before acting on MTF resonance signals
>
> - 当前图表周期的信号:实时更新,K线收盘确认
> - 高周期信号(如日线):仅在该周期K线收盘后更新
> - **最佳实践**:MTF共振信号建议在当前周期K线收盘后再做交易决策
### 💎 Auto-Adaptive Divergence Detection / 自动自适应背离检测
- **Auto Mode**: Automatically selects parameters based on asset volatility (using ATR)
自动模式:基于资产波动率(ATR)自动选择参数
- **4 Preset Modes**: Low Vol (3/40), Normal (5/60), High Vol (7/80), Crypto (10/120)
4种预设模式:低波动/普通/高波动/加密货币,分别对应不同的回看/范围参数
- **Extreme Zone Detection**: Distinguishes divergence in extreme zones (💎) vs normal zones (↗️↘️)
极端区域检测:区分极端区域背离(💎)和普通背离(↗️↘️)
- **Bullish/Bearish Divergence**: Price lower low + RSI higher low / Price higher high + RSI lower high
看涨/看跌背离:价格新低+RSI未新低 / 价格新高+RSI未新高
### 📊 Layered Signal Statistics / 分层信号统计
- **4-Tier Classification**: MTF Resonance (🌟) > Divergence+Extreme (💎) > Extreme Only (🔥❄️) > Normal (⬆️⬇️)
四层分级:多周期共振 > 背离+极端 > 仅极端 > 普通信号
- **Independent Tracking**: Each signal tier has separate count, average return, and win rate
独立跟踪:每层信号独立统计次数、平均收益、胜率
- **Signal Cooldown**: Optional cooldown period (default 5 bars) to prevent duplicate counting
信号冷却:可选冷却期(默认5根K线)防止重复计数
- **Real Forward Testing**: Calculates actual returns N bars after signal (configurable 5-100 bars)
真实前瞻测试:计算信号后N根K线的实际收益(可配置5-100)
---
## Z-Score 与 百分位:双重视角 / Dual Perspective
This indicator displays **both Z-Score and Percentile** to provide complementary views of the same RSI distribution.
本指标**同时显示Z-Score和百分位**,为同一RSI分布提供互补视角。
### Why Both? / 为什么同时显示?
**Fundamental Connection / 本质关联**:
两者都是描述RSI在历史分布中位置的统计方法。
Both are statistical methods describing RSI's position in historical distribution.
- **Z-Score(标准分数)**: `(RSI - 均值) / 标准差` - 基于正态分布假设
Based on normal distribution assumption.
- **百分位(Percentile)**: RSI在历史数据中的排名位置 - 不假设分布类型
RSI's ranking position in historical data - no distribution assumption.
**Complementary Advantages / 互补优势**:
| Dimension 维度 | Z-Score | Percentile 百分位 |
|------|---------|------------|
| **Cross-asset Consistency / 跨资产一致性** | ✅ Excellent 优秀 - BTC和SPY都用±2σ | ⚠️ Varies by volatility 因波动率不同而异 |
| **Statistical Rigor / 统计学严谨性** | ✅ Confidence intervals 置信区间、假设检验 | ⚠️ Non-parametric 非参数统计 |
| **Intuitive / 直观易懂** | ⚠️ Stats knowledge needed 需要统计学知识 | ✅ "Below 95% of history" "低于95%历史值" |
| **Use Case / 适用场景** | 📊 Quant backtesting 量化回测、信号触发 | 📈 Visualization 可视化、用户理解 |
### Conversion Reference / 转换对照表
**Quick Reference / 快速对照**(Assuming normal distribution / 假设正态分布):
| Z-Score | Percentile 百分位 | Meaning 含义 | Signal 信号类型 |
|---------|--------|---------------|----------|
| **±2.5σ** | **P0.6 / P99.4** | Extreme anomaly (outside 99% CI) / 极端异常(99%置信区间外) | Rare opportunity 罕见机会 |
| **±2.0σ** | **P2.3 / P97.7** | Extreme OB/OS (outside 95% CI) / 极端超买/超卖(95%置信区间外) | 🔥❄️ Extreme 极端信号 |
| ±1.5σ | P6.7 / P93.3 | Notable deviation / 显著偏离 | ⬆️⬇️ Normal 普通信号(默认) |
| ±1.0σ | P15.9 / P84.1 | Mildly strong/weak / 轻度偏强/偏弱 | — |
| 0σ | P50 | Median / 中位数 | — |
### Dashboard Dual Display / 仪表盘双重显示
**新版Dashboard已实现自动转换**:
```
┌─────────────────────────────────┐
│ ADAPTIVE RSI PRO 28.5 │
├─────────────────────────────────┤
│ Z-Score −2.15σ (≈P2) │ ← Z值 + 近似百分位
│ Percentile P5 (−1.5σ ~ −2σ) │ ← 百分位 + 对应Z值范围
│ Status 🟢 EXTREME OVERSOLD │
└─────────────────────────────────┘
```
**理解方式**:
- **从Z值看**:−2.15σ 表示超过95%置信区间,统计异常 → 对应约P2
- **从百分位看**:P5 表示低于95%历史值,极端超卖 → 对应约−1.5σ到−2σ之间
### Threshold Line Modes / 阈值线模式
**Unified Mode (Recommended) / Unified模式(推荐)** - Balances rigor and intuitiveness / 兼顾严谨性和直观性:
- Draws: Z-Score threshold lines (±2σ, ±1.5σ) / 绘制:Z-Score阈值线(±2σ、±1.5σ)
- Labels: Corresponding percentiles (≈P98, ≈P93, ≈P7, ≈P2) / 标注:对应百分位(≈P98、≈P93、≈P7、≈P2)
- Advantage: Instantly understand statistical meaning and historical position / 优势:一眼看懂统计意义和历史位置
**Other Modes / 其他模式**:
- `Z-Score`: Statistical threshold lines only / 仅显示统计学阈值线
- `Percentile`: Percentile lines only / 仅显示百分位线
- `Both`: Display both types (denser) / 同时显示两类线(较密集)
### Practical Examples / 实际应用示例
**Scenario 1: Identifying Extreme Opportunities / 场景1:识别极端机会**
```
Current RSI / 当前RSI: 25.3
Dashboard shows / Dashboard显示:
Z-Score: −2.35σ (≈P1)
Percentile: P5 (< −2σ)
Status: 🟢 EXTREME OVERSOLD
Interpretation / 解读:
• Statistical perspective / 统计学视角: Beyond 99% confidence interval (|Z| > 2.3) / 超过99%置信区间,极端异常
• Intuitive perspective / 直观视角: Lower than 99% of historical values / 低于99%的历史值都低,罕见超卖
• Conclusion / 结论: Strong buy signal 🔥 / 强力买入信号 🔥
```
**Scenario 2: Normal Signal Judgment / 场景2:普通信号判断**
```
Current RSI / 当前RSI: 63.8
Dashboard shows / Dashboard显示:
Z-Score: +1.52σ (≈P94)
Percentile: P90 (+1.5σ ~ +2σ)
Status: 🟠 OVERBOUGHT
Interpretation / 解读:
• Statistical perspective / 统计学视角: ~1.5 std dev, notably high but not extreme / 约1.5倍标准差,显著偏高但未极端
• Intuitive perspective / 直观视角: Higher than 90% of historical values / 高于90%的历史值,轻度超买
• Conclusion / 结论: Consider reducing position, not forced sell ⬇️ / 考虑减仓,非强制卖出 ⬇️
```
### Dashboard Display Logic / Dashboard显示逻辑
**Z-Score Row Display / Z-Score行显示**:
- Always shows current Z-value (2 decimal places) / 始终显示当前Z值(精确到2位小数)
- Auto-calculates approximate percentile: `≈P ` / 自动计算对应的近似百分位:`≈P `
- Uses Error Function for precise conversion / 使用误差函数(Error Function)精确转换
**Percentile Row Display / Percentile行显示**:
- Shows RSI's percentile range (P5, P10, P25, etc.) / 显示RSI所处的百分位区间(P5, P10, P25等)
- Labels corresponding Z-value range (e.g., `−1.5σ ~ −2σ`) / 标注对应的Z值范围(如:`−1.5σ ~ −2σ`)
- Helps understand what "P10" means statistically / 帮助理解"P10"的统计意义
**Color Association / 颜色关联**:
- Both rows use same status color (green/yellow/white/orange/red) / 两行使用相同的状态颜色(绿/黄/白/橙/红)
- Visually reinforces "same indicator, different expressions" / 视觉上强化"同一指标的不同表达"概念
---
### Dashboard Setups / 仪表盘配置
#### Full Mode (PC/Tablet)
Shows detailed stats, MTF status, and divergence info.
显示详细统计、MTF状态和背离信息。
#### Mobile Mode (Phone) / 手机模式
Simplified 3-row layout optimized for small screens.
极简3行布局,专为手机屏幕优化。
- Row 1: RSI Value / 第1行:RSI数值
- Row 2: Signal Status (Emoji) / 第2行:信号状态 (Emoji)
- Row 3: Trend/Filter Status / 第3行:趋势/过滤状态
### 📈 Dashboard Example / 面板示例
```
┌─────────────────────────────────┐
│ ADAPTIVE RSI PRO 35.2 │
├─────────────────────────────────┤
│ Status 🟢 EXTREME OVERSOLD │
│ Percentile P10 ↓ DOWN │
│ Lookback 456 ✅✅✅ │
├─────────────────────────────────├ (Full Mode Only)
│ ── MTF ── │
│ 1h | 4h | D 🟢 | ⚪ | 🟢 │
│ Resonance 🟢 3/4 OVERSOLD │
├─────────────────────────────────┤
│ Divergence 🟢 BULL (5/60) │
├─────────────────────────────────┤
│ ── STATS ── (20 bars) │
│ 🌟 MTF Buy(12) +4.2% | 83% │
│ 🌟 MTF Sell(8) +3.8% | 75% │
│ 💎 Div Buy(15) +3.5% | 80% │
│ 💎 Div Sell(11) +2.9% | 73% │
│ 🔥 Ext Buy(45) +2.1% | 67% │
│ ❄️ Ext Sell(38) +1.8% | 63% │
└─────────────────────────────────┘
```
**Health Indicators / 健康度指标**:
- ✅✅✅ = All healthy (所有健康): Sample coverage ≥ 80%, Distribution spread ≥ 15, Statistical validity ≥ 90%
- ⚠️ present = Warning (警告): One or more health checks failed, consider using Custom mode with larger lookback
---
## Chart Lines Guide / 图表线条指南
! (images/annotated_rsi_indicator.png)
### 📊 主要线条 / Main Lines
| 线条 | 颜色/样式 | 含义 | 作用 |
|------|----------|------|------|
| **RSI主线** | 黄色粗线 | 当前RSI值 | 实时跟踪相对强弱指标 |
| **P50 自适应中位数** | 白色阶梯线 | 动态中线 | 根据历史数据自动调整的中位数,比固定50更准确 |
### 🔴 超买阈值线 / Overbought Thresholds (上方红色)
| 线条 | Z-Score | 百分位 | 样式 | 信号 |
|------|---------|--------|------|------|
| **极端超买线** | +2σ | ≈P98 | 实线 | 触发 ❄️ 极端超买信号(强卖出) |
| **普通超买线** | +1.5σ | ≈P93 | 圆点虚线 | 触发 ⬇️ 普通超买信号(考虑卖出) |
### 🟢 超卖阈值线 / Oversold Thresholds (下方绿色)
| 线条 | Z-Score | 百分位 | 样式 | 信号 |
|------|---------|--------|------|------|
| **极端超卖线** | -2σ | ≈P2 | 实线 | 触发 🔥 极端超卖信号(强买入) |
| **普通超卖线** | -1.5σ | ≈P7 | 圆点虚线 | 触发 ⬆️ 普通超卖信号(考虑买入) |
### ⚪ 固定参考线 / Fixed Reference Lines
| 线条 | 位置 | 样式 | 作用 |
|------|------|------|------|
| **0线** | 底部 | 灰色点线 | RSI下边界 |
| **50线** | 中间 | 灰色点线 | 传统固定中线参考 |
| **100线** | 顶部 | 灰色点线 | RSI上边界 |
### 🎨 渐变填充区域 / Gradient Fill Zones
- **红色渐变**(上方):超买区域,颜色越深表示越极端
- P95-P90(深红)> P90-P75(中红)> P75-P50(浅红)
- **绿色渐变**(下方):超卖区域,颜色越深表示越极端
- P10-P5(深绿)> P25-P10(中绿)> P50-P25(浅绿)
### 💡 关键要点 / Key Points
**线条样式区分 / Line Style Distinction:**
- **实线** = 极端信号(±2σ),优先级高,统计上95%置信区间外
- **圆点虚线** = 普通信号(±1.5σ),优先级较低,显著偏离但未极端
**动态 vs 固定 / Dynamic vs Fixed:**
- **彩色线**(红/绿)= 根据历史波动动态调整,适应不同资产特性
- **灰色虚线** = 固定不变的参考线,用于传统RSI对比
**视觉层次 / Visual Hierarchy:**
- 线条粗细:RSI主线(最粗)> 极端阈值(粗)> 普通阈值(细)> 参考线(最细)
- 透明度:核心线条(不透明)> 百分位线(半透明)> 填充区(高透明)
---
## Settings / 设置
### RSI Settings / RSI设置
| Setting | Default | Description |
|---------|---------|-------------|
| RSI Length | 14 | RSI calculation period / RSI计算周期 |
| RSI Source | Close | Price source / 价格源 |
### Adaptive Settings / 自适应设置
| Setting | Default | Description |
|---------|---------|-------------|
| Lookback Mode | Auto | Auto (statistical formula) / Custom / 自动/自定义 |
| Custom Lookback | 252 | Only used in Custom mode / 仅自定义模式使用 |
| Precision | Normal | High/Normal/Low: Adjusts error tolerance / 精度等级 |
| History Depth | 1 Year | 6 Months / 1 Year / 2 Years for volatility calculation / 波动率历史深度 |
### Visual Settings / 视觉设置
| Setting | Default | Description |
|---------|---------|-------------|
| Threshold Line Mode | **Unified** | Unified(推荐)/Z-Score/Percentile/Both / 阈值线模式 |
| Show Gradient Fill | ON | Display background gradients / 显示背景渐变 |
| Show Dashboard | ON | Display dashboard panel / 显示仪表盘面板 |
| Dashboard Mode | Full | Full/Lite/Mobile(Phone) / 面板模式 |
| Dashboard Size | Normal | Tiny/Small/Normal/Large / 面板大小 |
| Dashboard Transparency | 30 | 0-100% transparency level / 透明度 |
| Bullish Color | #00E676 | Custom color for bullish signals / 牛市信号颜色 |
| Bearish Color | #FF5252 | Custom color for bearish signals / 熊市信号颜色 |
| RSI Line Color | #FFEB3B | RSI line color / RSI主线颜色 |
### Trend Filter / 趋势过滤
| Setting | Default | Description |
|---------|---------|-------------|
| Enable Trend Filter | OFF | Only trigger signals in trend direction / 趋势方向过滤 |
| Filter Mode | Auto | Auto/Fixed 50/Adaptive P50/SMA(RSI)/BB(RSI) / 过滤模式 |
### Alert Settings / 警报设置
| Setting | Default | Description |
|---------|---------|-------------|
| **🎯 Smart Alert** | **ON** | **V6 Unified Alert System** / V6统一警报系统 |
| Show Normal Signals | OFF | Display ⬆️⬇️ on chart / 图表显示普通信号 |
| Normal Signal Threshold | 1.5σ | Z-Score threshold (1.0-2.0σ) / 普通信号阈值 |
| Enable Signal Cooldown | ON | Prevent duplicate signal counting / 防止重复信号 |
| Cooldown Period | 5 bars | Bars between same signal type / 冷却K线数 |
### Multi-Timeframe / 多时间框架
| Setting | Default | Description |
|---------|---------|-------------|
| Enable | ON | Show MTF analysis / 显示MTF分析 |
| MTF Mode | **Auto** | **Auto** (Fractal Breakdown) / **Manual** (Fixed) / 自动/手动模式 |
| TF1/TF2/TF3 | 60/240/D | Timeframes (Manual mode only) / 时间框架(仅手动模式)|
### Signal Statistics / 信号统计
| Setting | Default | Description |
|---------|---------|-------------|
| Enable | ON | Track performance / 跟踪表现 |
| Forward Bars | 20 | Bars for return calculation / 收益计算K线数 |
### Divergence Detection / 背离检测
| Setting | Default | Description |
|---------|---------|-------------|
| Enable Detection | ON | Detect divergences / 检测背离 |
| Divergence Mode | Auto | Auto/Low Vol/Normal/High Vol/Crypto/Custom / 背离模式 |
| Custom Lookback | 5 | Only in Custom mode / 仅自定义模式使用 |
| Custom Range | 60 | Only in Custom mode / 仅自定义模式使用 |
**Auto Mode Presets / 自动模式预设**:
- Low Vol (蓝筹/ETF): Lookback 3, Range 40
- Normal (一般股票): Lookback 5, Range 60
- High Vol (成长股): Lookback 7, Range 80
- Crypto (加密货币): Lookback 10, Range 120
---
## Alerts / 警报
### 🎯 Smart Alert (V6 Unified System)
**The only alert method / 唯一的警报方式** - 自动聚合所有信号到一条富文本消息
Automatically aggregates all signals into a single rich-text message.
**Setup Steps / 设置方法**:
1. Keep "🎯 Smart Alert" enabled in indicator settings (default) / 指标设置中保持 "🎯 Smart Alert" 开启(默认)
2. When creating alert, select **"Any alert() function call"** / 创建警报时选择 **"Any alert() function call"**
3. Done! You'll receive real-time aggregated alerts / 完成!您会收到实时的聚合警报
**Message Example / 消息示例**:
```
AAPL: 🟢 BUY SIGNALS → 🌟MTF共振 💎背离 🔥极端 | RSI:25.3 Z:-2.1σ (≈P2)
AAPL: 🔴 SELL SIGNALS → ❄️极端 | RSI:78.5 Z:2.3σ (≈P98)
```
**Features / 特性**:
- ✅ **Real-time trigger / 实时触发** - Sends when condition met within bar / K线运行中触发条件即发送
- ✅ **Anti-flicker / 防闪烁** - Uses `varip` to prevent duplicate alerts from signal flickering within same bar / 使用 `varip` 防止信号闪烁导致同一K线内重复警报
- ✅ **Signal upgrade detection / 信号升级检测** - Alerts when stronger signal appears (e.g., 🔥Extreme → 🌟MTF) even on same bar / 同一K线内出现更强信号时也会触发(如:🔥极端 → 🌟MTF共振)
- ✅ **Full context / 完整上下文** - Includes RSI value, Z-Score, approximate percentile / 包含RSI值、Z-Score、近似百分位
- ✅ **Auto-aggregation / 自动聚合** - One message contains all triggered signals / 一条消息包含所有触发的信号
- ✅ **Buy/Sell independent tracking / 买卖独立追踪** - Buy and Sell alerts tracked separately / 买入和卖出警报独立追踪,互不干扰
**Signal Priority Levels / 信号优先级**:
| Level 等级 | Signal 信号 | Description 描述 |
|------------|-------------|------------------|
| 4 (Highest) | 🌟 MTF Resonance | Multi-timeframe agreement / 多周期共振 |
| 3 | 💎 Divergence | Divergence + Extreme zone / 背离+极端区 |
| 2 | 🔥❄️ Extreme | Extreme oversold/overbought / 极端超卖/超买 |
| 1 (Lowest) | ⬆️⬇️ Normal | Normal oversold/overbought / 普通超卖/超买 |
---
## Usage Tips / 使用建议
| Timeframe | Lookback | Use Case |
|-----------|----------|----------|
| Daily | 252 | Swing trading / 波段交易 |
| 4H | 1000 | Short-term / 短线 |
| 1H | 2000 | Day trading / 日内交易 |
**Best Practices / 最佳实践:**
1. Focus on 🌟 and 💎 signals (highest priority) / 优先关注 🌟 和 💎 信号(最高优先级)
2. Use MTF resonance for high-confidence entries / 使用 MTF 共振确认高置信度入场
3. Check win rate in stats before trading / 交易前查看统计胜率
---
## Changelog / 更新日志
### v6.2 - Smart Alert Anti-Flicker / 智能防抖警报 (Current / 当前版本)
- 🛡️ **Anti-flicker Mechanism / 防闪烁机制**: Fixed issue where signal flickering caused multiple duplicate alerts within same bar. Now uses `varip` to track alert status per bar. / 修复信号闪烁导致同一K线内发送多次重复警报的问题,使用 `varip` 追踪每根K线的警报状态。
- 📈 **Signal Upgrade Detection / 信号升级检测**: Tracks signal priority level (MTF=4, Divergence=3, Extreme=2, Normal=1). Sends new alert when stronger signal appears on same bar. / 追踪信号优先级等级。同一K线内出现更强信号时会发送新警报。
- 🔄 **Independent Buy/Sell Tracking / 买卖独立追踪**: Buy and Sell alerts are tracked independently, allowing direction changes within same bar. / 买入和卖出警报独立追踪,允许同一K线内捕捉方向变化。
### v6.1 - Mobile Experience / 移动端体验
- 📱 **Mobile Dashboard / 手机端面板**: Added simplified "Mobile" mode optimized for phone screens (RSI + Signal Emoji only). / 新增简化的"Mobile"模式,针对手机屏幕优化(仅显示RSI+信号Emoji)。
- 🔥 **Persistent Zone Status / 持续区域状态**: Mobile Dashboard now shows persistent extreme zone indicators when no new signal but RSI remains in zone: `🔥持续` (Extreme Oversold), `❄️持续` (Extreme Overbought), `⬆️区` (Oversold), `⬇️区` (Overbought). / 手机端面板现在显示持续极端区域指示器:无新信号但RSI仍在区域内时显示持续状态。
- 🔧 **UX Improvements / 用户体验优化**: Optimized font sizes and layout for small screens. / 优化字体大小和小屏幕布局。
### v6.0 - Alert System Simplification & V6 Optimization / 警报系统简化与V6优化
- 🎯 **Smart Alert System / 智能警报系统简化**:
- **Unified entry / 唯一警报入口**: Removed all legacy alertcondition, unified to V6 Smart Alert / 移除所有legacy alertcondition,统一为V6 Smart Alert
- **Real-time trigger / 实时触发**: Changed to `alert.freq_once_per_bar` for intra-bar response / 改为 `alert.freq_once_per_bar` 实现K线内实时响应
- **Smart dedup / 智能去重**: Rising edge detection (`signal and not signal `) / 上升沿检测,只在新信号出现时触发
- **Auto-aggregation / 自动聚合**: Single message with all signals + RSI + Z-Score + Percentile / 单条消息包含所有触发信号 + RSI + Z-Score + 百分位
- **Simplified settings / 简化设置**: Removed "Extreme Alerts" and "Normal Alerts", only Smart Alert toggle / 移除 "Extreme Alerts" 和 "Normal Alerts",只保留Smart Alert开关
- 🛠 **Performance Optimization / 性能优化**:
- Reduced `request.security` calls by 50% using Tuple Requests / 使用元组请求减少50%的`request.security`调用
- Implemented `str.format()` for cleaner and faster string processing / 实现`str.format()`使字符串处理更简洁高效
- 🧹 **Code Cleanup / 代码清理**:
- Refactored timeframe display and alert logic / 重构时间框架显示和警报逻辑
- Fixed plot limit issues and tuple assignment syntax / 修复绑点限制问题和元组赋值语法
- Unified plot titles with percentile annotations / 统一绑点标题与百分位标注
### v5.0 - Adaptive Fractal MTF / 自适应分形MTF
- 🧠 **Adaptive Fractal MTF / 自适应分形MTF**: New "Auto" mode automatically selects lower timeframes for precision structure analysis (Internal Fractal Resonance). / 新增"Auto"模式,自动选择更低时间框架进行精确结构分析(内部分形共振)。
- Daily Chart → Analyzes 1H & 4H / 日线图 → 分析1小时和4小时
- 1H Chart → Analyzes 5m & 15m / 1小时图 → 分析5分钟和15分钟
- 15m Chart → Analyzes 1m & 5m / 15分钟图 → 分析1分钟和5分钟
- 🛠 **Code Refactoring / 代码重构**: Implemented Pine Script v6 UDTs (Objects) and Methods for robust signal statistics. / 实现Pine Script v6 UDT(对象)和方法,增强信号统计的健壮性。
- 🎨 **Dashboard Optimization / 面板优化**: Enhanced string formatting using `str.format` for cleaner display. / 使用`str.format`优化字符串格式,显示更简洁。
### v4.0 - Pine Script v6 Upgrade / Pine Script v6升级
- 🚀 Upgraded entire codebase to **Pine Script v6** engine / 将整个代码库升级到 **Pine Script v6** 引擎
- ⚡ Optimization for better performance and future-proofing / 性能优化,面向未来
- 🛠 Maintenance updates for latest TradingView standards / 维护更新以符合最新TradingView标准
### v3.0 - Auto-Adaptive Systems / 自动自适应系统
- ✨ Auto-adaptive lookback using formula `n = (Z × σ / E)²` / 使用统计公式 `n = (Z × σ / E)²` 自动计算回看期
- ✨ Auto-adaptive trend filter with 5 modes / 5种模式的自动自适应趋势过滤器
- ✨ Auto-adaptive divergence detection with 4 presets / 4种预设的自动自适应背离检测
- ✨ Layered statistics (MTF/Divergence/Extreme/Normal) / 分层统计系统(MTF/背离/极端/普通)
- ✨ Signal cooldown to prevent duplicate counting / 信号冷却机制防止重复计数
- ✨ Health indicators for lookback validation / 回看期健康度指标验证
- ✨ Dashboard modes (Lite/Full) with customization / 面板模式(Lite/Full)支持自定义大小和透明度
- ✨ Dual volatility system (short + long-term) / 双重波动率系统(短期+长期)
### v2.1 - Signal Optimization / 信号优化
- ✨ Consolidated signals with priority system / 信号合并与优先级系统(无重叠)
- ✨ Emoji-based signal display / 基于Emoji的信号显示
- ✨ MTF timeframe auto-skip for duplicates / MTF时间框架自动跳过重复
### v2.0 - Pro Edition / 专业版
- ✨ Added Trend Filter, MTF RSI, Statistics, Divergence / 新增趋势过滤、MTF RSI、统计、背离检测
- ✨ Z-Score based signal triggering / 基于Z-Score的信号触发
### v1.0 - Initial Release / 初始发布
- ✨ Adaptive percentile-based thresholds / 自适应百分位阈值
---
## License
MIT License - Feel free to use, modify, and share.
EMA13-EMA21 Difference Indicator# EMA13-EMA21 Difference Indicator
## Description
This indicator calculates the difference between the 13-period Exponential Moving Average (EMA13) and the 21-period Exponential Moving Average (EMA21), helping traders visually assess short-term market momentum.
**Core Logic:**
- When the difference is positive (green), the short-term EMA is above the long-term EMA, indicating a bullish trend
- When the difference is negative (red), the short-term EMA is below the long-term EMA, indicating a bearish trend
- Crossovers of the zero line can serve as potential trend reversal signals
**Use Cases:**
- Trend direction identification
- Momentum strength analysis
- Entry and exit timing assistance
**Disclaimer:**
This indicator is for reference only. It is recommended to combine it with other technical analysis tools for comprehensive judgment. This does not constitute investment advice.
50-Point Psych Levels (Multiples of 50)50-Point Psychological Levels (Multiples of 50)
This indicator plots static psychological price levels at fixed point intervals (default every 50 points) across the chart. These levels are commonly watched by traders as natural areas of reaction, balance, support, and resistance, especially on index futures such as NQ, ES, YM, and RTY.
The script automatically centers the levels around the current market price and draws them across a configurable range above and below price. All levels extend across the entire chart and are drawn once only, keeping the display clean and preventing redraw lag.
Key Features
Plots horizontal levels at fixed point spacing (default: 50 points)
Automatically anchors around the latest price
Configurable range above and below price
Customizable line color, width, and style
Lightweight, non-repainting, static reference levels
Best Use Cases
Identifying psychological support and resistance
Confluence with VWAP, EMA structure, ORB levels, and volume
Futures trading (NQ, ES, YM, RTY), indexes, and large-tick instruments
N Days Back Session DividerThis Pine Script acts as a smart vertical marker that identifies exactly where a trading day began a specific number of sessions ago. It is designed to ignore "dead time" (like weekends or holidays) by focusing on actual market activity.






















