Volume Weighted CorrelationThis indicator analyzes the structural relationship between two
assets by decomposing the Total Correlation into two distinct,
interpretable components: "Between-Bar" (Inter-Bar) and
"Within-Bar" (Intra-Bar) correlation.
Key Features:
1. **Hybrid Copula Estimator:** Unlike standard correlation, which
often fails on High/Low range data, this indicator fuses two
metrics to ensure mathematical rigor:
- **Magnitude:** Derived from Rogers-Satchell Volatility.
- **Direction:** Derived from Log-Returns.
This allows for precise correlation estimates even on intra-bar data.
2. **Two-Component Correlation Decomposition:** The indicator
separates correlation based on the 'Estimate Bar Statistics' option.
- **Standard Mode (`Estimate Bar Statistics` = OFF):** Calculates
correlation based on the selected `Source` (Close-to-Close).
- **Decomposition Mode (`Estimate Bar Statistics` = ON):** The
indicator uses a statistical model ('Estimator') to
calculate *within-bar* correlation.
This separates the relationship into:
- **Between-Bar Correlation (Green/Red):** Correlation of the
price paths (means). Indicates if the macro movements of the
assets are aligned (Inter-Bar correlation).
- **Within-Bar Correlation (Blue):** Correlation of the
microstructure (Intra-Bar volatility/noise).
3. **Visual Decomposition Logic:** Total Correlation is the
primary metric displayed. Since Correlation Coefficients are not
linearly additive, this indicator calculates the *exact* Total
Correlation and partitions the area/ratios based on the additive
Covariance Decomposition (`CovTot = CovBtw + CovWtn`). This
ensures the displayed total correlation remains mathematically accurate.
4. **Dual Display Modes:** The indicator offers two modes to
visualize this decomposition:
- **Absolute Mode:** Displays the *Total Correlation* as the main
line, with the background filled by the stacked components
(Between vs. Within). Shows the *magnitude* of the relationship.
- **Relative Mode:** Displays the **Energy Ratios** (-1.0 to 1.0)
of each component using L1-Normalization. This isolates the
*structure/quality* of the relationship (e.g., "Is the correlation
driven by price movement or just by volatility coupling?").
5. **Calculation Options:**
- **Normalization:** An optional 'Normalize' setting
calculates an **Exponential Regression Curve** (log-space),
creating a constant percentage variance environment. Essential
for comparing assets with different scales (e.g., BTC vs EURUSD).
- **Volume Weighting:** An option (`Volume weighted`) applies
volume weighting to all mean and covariance calculations.
6. **Correlation Cycle Analysis:**
- **Pivot Detection:** Includes a built-in pivot detector
that identifies significant turning points (highs and lows) in
the *Total Correlation* line. (Note: This is only visible
in 'Absolute Mode').
- **Flexible Pivot Algorithms:** Supports various underlying
mathematical models for pivot detection provided by the
core library.
7. **Note on Confirmation (Lag):** Pivot signals are confirmed
using a lookback method. A pivot is only plotted *after*
the `Pivot Right Bars` input has passed, which introduces
an inherent lag.
8. **Multi-Timeframe (MTF) Capability:**
- **MTF Correlation Lines:** The correlation lines can be
calculated on a higher timeframe, with standard options
to handle gaps (`Fill Gaps`) and prevent repainting
(`Wait for...`).
- **Limitation:** The Pivot detection (`Calculate Pivots`) is
**disabled** if a Higher Timeframe (HTF) is selected.
9. **Integrated Alerts:** Includes comprehensive alerts for:
- Correlation magnitude (High Positive / High Inverse).
- Character changes (Inter-Bar vs. Intra-Bar dominance).
- Total Correlation pivot (High/Low) detection.
---
**DISCLAIMER**
1. **For Informational/Educational Use Only:** This indicator is
provided for informational and educational purposes only. It does
not constitute financial, investment, or trading advice, nor is
it a recommendation to buy or sell any asset.
2. **Use at Your Own Risk:** All trading decisions you make based on
the information or signals generated by this indicator are made
solely at your own risk.
3. **No Guarantee of Performance:** Past performance is not an
indicator of future results. The author makes no guarantee
regarding the accuracy of the signals or future profitability.
4. **No Liability:** The author shall not be held liable for any
financial losses or damages incurred directly or indirectly from
the use of this indicator.
5. **Signals Are Not Recommendations:** The alerts and visual signals
(e.g., crossovers) generated by this tool are not direct
recommendations to buy or sell. They are technical observations
for your own analysis and consideration.
אינדיקטורים ואסטרטגיות
MIZAN v15.5: KEMAL (Ontological Synthesis)Title: Mizan v15.5: KEMAL (Ontological Synthesis & Psi Score)
Description:
This indicator represents the culmination of the "Mizan" philosophy, combining a custom Physics Engine (Cosmic Cloud) with an Organic Soul Engine (Psi Score).
Key Concepts developed in this script:
Psi Score (Soul): Unlike traditional RSI, the Psi Score calculates the intrinsic energy of an asset using a unique "Ontological Half-Life" of 136 bars and a "Resonance Period" of 43 bars. This filters out market noise and reveals the true intent of price action.
Cosmic Cloud (Physics): A volume-weighted gravity model. The cloud expands based on uncertainty (Psi entropy) and projects future price direction based on mass (Volume) and spacetime curvature (VWAP).
The Synthesis: The strategy only takes trades when the Physics (Cloud position) and the Soul (Psi energy) are in alignment, protected by a Trend Shield.
How to Use:
Green Cloud: Bullish Gravity.
Red Cloud: Bearish Gravity.
Dashboard: Provides real-time data on Gravity (g), Psi Energy %, and Next Price Targets.
Developed by Murat Kavak
SLV Overlay on SIDraws SLV overlay on Silver Futures (SI)
Default overlay symbol: AMEX:SLV
Live session window: 04:00–20:00 NY, Mon–Fri
Outside the live session window, it holds the last ratio from the prior daily close
Updates lines after "min_move"
Draws $1 SLV levels (±N) projected into SI price space
Accumulation & Distribution Days HistogramWHAT IT TRACKS:
• Distribution Days (Selling Pressure): Price closes down >0.2% on higher volume than previous day
• Accumulation Days (Buying Pressure): Price closes up >0.2% on higher volume than previous day
HOW IT WORKS:
The histogram displays a rolling count of distribution and accumulation days within your chosen lookback period (default: 20 bars). Green bars show accumulation days above the zero line, while red bars show distribution days below the zero line. A white line plots the net difference (accumulation minus distribution) to show the overall balance.
SETTINGS:
• Lookback Period: Number of bars to count (default: 20)
• Price Threshold: Minimum % move required (default: 0.2%)
• Colors: Fully customizable histogram colors
USAGE:
Use this to gauge the balance between buying and selling pressure. When accumulation exceeds distribution, it suggests bullish pressure. When distribution exceeds accumulation, it suggests bearish pressure.
The indicator can also serve as a market health filter:
• 0-3 Distribution Days: Bullish market condition - healthy for long positions
• 4-5 Distribution Days: Cautious - monitor for potential trend change
• 6+ Distribution Days: Bearish signal - institutional selling intensifying
Other potential uses to explore:
• Divergence analysis: Price making new highs while distribution days cluster
• Sector rotation: Compare distribution/accumulation across different sectors
• Entry timing: Wait for accumulation to exceed distribution before entering
• Risk management: Reduce position size as distribution days increase
Experiment with different lookback periods and thresholds to match your trading timeframe and style.
If you discover effective ways to use this indicator, please share in the comments below - your insights could help others, enjoy.
Gold Sniper (Liquidity Sweep)Concept : Stop Hunting the "Smart Money" Way Most traders lose money because they enter exactly where "Smart Money" is looking to trigger Stop Losses. We have all been there: You buy at support, the price dips just below your stop loss, takes you out, and then rockets up without you.
Gold Sniper is designed to capitalize on this exact behavior . Instead of buying the support, this script waits for the Liquidity Sweep (the "Stop Hunt"). It identifies when price breaks a key structure level to trap sellers, and signals an entry only when the price reclaims that level with momentum.
How It Works (The Logic) This indicator looks for a specific "Perfect Storm" setup using a 4-step confirmation process:
Identifies Support (Yellow Dots): It tracks local pivot lows (default 10 bars) to visualize the "Floor" where retail traders likely have their stop losses.
Detects the Sweep: It waits for price to drop below these yellow dots. This is the "Trap" phase where liquidity is grabbed.
Confirms the Reclaim: It does NOT catch the falling knife. It waits for a candle to close back ABOVE the broken support level.
Momentum Check (RSI): It ensures internal strength (RSI) is rising compared to the previous low, confirming that the drop was a trap, not a genuine crash.
Visual Features
Yellow Dots: Dynamic Support Levels / Pivot Lows.
"SWEEP BUY" Label: Signals exactly when the trap is complete and the reclaim has occurred.
Red Line (Hard Stop): Automatically draws a Stop Loss level at the lowest point of the sweep candle.
How to Use This Strategy
Wait for the Setup: Do not trade if price is just drifting. Wait for price to challenge and break the Yellow Dots.
The Trigger: Enter immediately on the Close of the candle with the "SWEEP BUY" label.
Stop Loss: Place your Hard Stop at the Red Line provided by the indicator.
Rule: If price touches the Red Line, the setup has failed (it was a real crash, not a sweep). Exit immediately.
Best Timeframes: Optimized for 1-Minute and 5-Minute scalping on Gold (XAUUSD) and Futures, but works on all liquid assets.
Settings
Pivot Lookback: How many bars back to check for the support floor (Default: 10).
RSI Length: Sensitivity of the momentum filter (Default: 14).
Disclaimer : This tool is for educational purposes and market analysis only. It identifies high-probability "Liquidity Sweep" setups but does not guarantee future results. Always manage your risk.
Pattern Multi-TF Dashboardesigned to identify the three primary phases of price action: Contraction, Expansion, and Trend. By combining technical momentum (ADX) with price range volatility, this script provides a "top-down" view of the market, allowing traders to see how lower-timeframe price action fits into the broader market cycle.
Core Logic & Market Phases
The indicator classifies market conditions based on a proprietary blend of ADX (Average Directional Index) and price deviation from the Fair Market Value (FMV).
🟦 Contraction (Blue): Identified when ADX is low and price is consolidating within a narrow range relative to the FMV. This represents "market value" where orders are being accumulated.
🟧 Expansion (Orange): Triggered when ADX begins to rise and price pushes away from the FMV. This represents the initial breakout phase where the market is seeking a new value area.
🟩 Trend (Green): Confirmed when ADX remains high and price maintains direction. This is the "momentum" phase of the cycle.
⬜ Neutral (Gray): Default state when neither contraction nor strong momentum is detected.
Key Features
Multi-TF Dashboard: A dynamic, real-time table displaying the Phase, Bias (Bullish/Bearish), and FMV price for eight different timeframes (1m through Monthly).
Visual Bias Tracking: The "Bias" column is color-coded (Green for Bullish, Red for Bearish) based on whether price is trading above or below the Fair Market Value (Mid-point of the range).
On-Chart Inefficiencies (FVG): Automatically plots Green/Red triangles to highlight Fair Value Gaps, identifying areas of price imbalance where liquidity may be resting.
HTF FMV Overlay: Plots the Fair Market Value (Mid-line) of a user-defined Higher Timeframe (e.g., 4H) directly onto your current chart for easy trend reference.
Optimized Performance: Built specifically for Pine Script® v6, the dashboard is designed to update only on the most recent bar to ensure zero chart lag during manual scrolling.
How to Use
Identify the HTF Phase: Look at the background color of your chart to see the 4H or Daily phase.
Check for Alignment: Use the Dashboard to see if the 1m and 5m biases match the HTF bias.
Find Entry: Look for Inefficiencies (FVGs) that align with the Expansion or Trend phases for high-probability entry points.
M5_Bull/Bear BBOM5_ Bull/Bear BBO is a derivative oscillator built from LuxAlgo’s original Bollinger Bands Breakout Oscillator (BBO).
This version restructures the original breakout logic into a bull / bear adaptive oscillator, introduces inverted symmetry, and expands the visual system with dynamic level states and conditional color logic. The goal is to provide contextual momentum awareness rather than discrete trade signals.
A key design focus is the interaction between dominant pressure and the absence of opposing pressure. Buying and selling pressure may coexist, but moments where opposing pressure fully dissipates are treated as structurally significant — a “door opening” condition where price is no longer constrained by counter-pressure and is free to expand.
Pressure is explicitly mirrored from the opposite side, creating a symmetrical framework where each side’s expansion is reflected against the other. These mirrored structures are allowed to cross, not as directional signals, but as markers of peak intensity or exhaustion within an expanding pressure phase.
Transitional regimes — where one pressure fades before the other fully emerges — are intentionally left visible rather than smoothed away. These areas often produce late confirmation or no follow-through at all, and are presented as a challenging but informative market state rather than a condition to be optimized away.
The script is intended for visual analysis and context alignment, not as a standalone entry/exit system.
Credits & Licensing
Original concept and base implementation: LuxAlgo
Modifications, restructuring, and visual system: Metaltek5
License: Creative Commons Attribution–NonCommercial–ShareAlike 4.0 (CC BY-NC-SA 4.0)
This script is published as open source under the same license as the original work.
Non-commercial use only. Attribution and share-alike required.
Annotated example illustrating dominant pressure, mirrored behavior, and door opening conditions
EMA Slope Filter (ATR Threshold) + Supertrend WindowEMA Slope Filter (ATR Threshold) + Supertrend Window
This indicator highlights “trade-allowed” segments based on a mechanical EMA slope condition. It compares the current EMA value (user-defined length) to the EMA value N bars ago (user-defined lookback). A direction is allowed only if the EMA change exceeds an ATR-based threshold: ATR multiplier × ATR(length).
What it shows on the price chart
Green segments (background / EMA color / optional dots): long bias allowed.
Red segments: short bias allowed.
Neutral (gray/no background): filter not satisfied.
Start markers
L / S labels appear at the start of a new allowed segment.
Optional Supertrend delay: start labels can be delayed by X bars after a Supertrend direction switch (Supertrend ATR length and factor are configurable inside the script).
“STOP” wave marker
Define a Supertrend-based search window (e.g., bars 3…20 after a switch).
If the EMA slope filter never aligns with the Supertrend direction within that window, the script prints a STOP label on bar (max+1) to indicate the current wave is considered non-tradable (do not search for entries until the next Supertrend switch).
Extras
Key values (EMA diff, ATR, threshold, diff/ATR, bars since ST switch) are available in the Data Window for quick inspection.
CTR Weekly MA + 1D MA (v1)I built this simple pine script to help me trade on the lower timeframe (1d) while still showing my key weekly moving averages to help me trade with the macro trend.
Rules for trading...
Steps for taking a Short position:
1. Wait for all 3 weekly moving averages to be in alignment (8EMA<21SMA<50SMA). When these aligned the candles will change to bright red, meaning bearish.
2. Wait for a pullback to the 1 Day 21SMA. When a candle touches the 21SMA, that candle will change color to white. This will be your alert to get ready to enter into a short.
3. On the next candle you can then take a short position as long as that candle is below the 21SMA, if not, wait for the net daily candle to close. If that is below the 21SMA you can then enter into a short on the opening of the next daily candle.
I built this to trade the Bear Market but this same method can also work in a Bull Market but just do the opposite.
Core IC 2.0
## 📌 NIFTY Weekly Option Seller — Core Regime & Risk Framework
This indicator is designed for **systematic weekly option selling on NIFTY**, focused on **Iron Condors (IC), Put Credit Spreads (PCS), and Call Credit Spreads (CCS)**.
It is **not a scalping tool** and **not a signal generator**.
Instead, it provides a **structured decision framework** to help option sellers decide:
* *What structure to deploy* (IC / PCS / CCS)
* *How aggressive to be* (position size & distance)
* *When to adjust* (defend / harvest / regime change)
---
## 🔍 What the Indicator Does
### 1️⃣ Market Regime Detection
The script continuously evaluates the market and classifies it into one of three regimes:
* **IC (Range / Mixed)** – neutral, mean-reverting conditions
* **PCS (Trend Up)** – bullish trend continuation
* **CCS (Trend Down)** – bearish trend continuation
Regime selection is based on:
* EMA structure
* ADX (trend strength)
* VWAP positioning
* Higher timeframe (daily) trend alignment
---
### 2️⃣ Independent Conviction Scores
The indicator computes **three independent scores (0–5)**:
```
IC / PCS / CCS
```
These scores represent **conviction strength**, not trade signals.
* Higher score = stronger suitability for that structure
* All three scores are always visible for transparency
Only **one active score** (based on the current regime) is used for:
* Position sizing
* Strike distance suggestions
* Risk management logic
---
### 3️⃣ Risk-First Position Guidance
Based on the active score, the indicator suggests:
* **Position Size** (100% / 50% / 25%)
* **Short strike distance** (ATR-based, dynamic)
* **Defend / Harvest conditions**
* **Regime change alerts**
This helps traders remain **consistent and disciplined**, especially during volatile weeks.
---
### 4️⃣ Visual Decision Panel
A compact panel displays all key information at a glance:
* Regime (IC / PCS / CCS)
* ATR & ADX
* Suggested size
* Suggested short distance
* IC / PCS / CCS scores
* Key reference levels (H3 / L3, VWAP)
No guesswork, no over-trading.
---
## 🕒 Recommended Usage
* **Best timeframe:** 1H or 4H
* **Ideal style:** End-of-day or limited-check traders
* **Designed for:** Weekly option sellers (not intraday scalpers)
Adjustments are intended to be made **at fixed checkpoints**, not every candle.
---
## ⚠️ Important Notes
* This is **not financial advice**
* The indicator does **not place trades**
* Works best when combined with:
* Defined stop-loss rules
* Fixed risk-reward discipline
* Proper position sizing
---
## 🎯 Who This Is For
✔ Rule-based option sellers
✔ Traders focused on consistency over excitement
✔ Professionals who value structure and risk control
❌ Not for discretionary scalpers
❌ Not for beginners without options knowledge
Relative Strength Leadership Engine v2.0Relative Strength Leadership Engine v2.0OverviewThe Relative Strength Leadership Engine v2.0 is a context-first diagnostic tool designed to identify true market leadership. Instead of simple ratio lines, this script employs a multi-layered scoring model to determine if a symbol is truly outperforming its benchmark (e.g., SPY) or simply riding market beta.The Problem It SolvesMany relative strength indicators fail to distinguish between idiosyncratic leadership and market correlation. A stock might look strong simply because it is a high-beta names moving in lockstep with a rising index. This engine uses Pearson Correlation Filtering and Volatility Normalization to decouple these factors.How It Works (The Math)To ensure full transparency for the TradingView community, the "Leadership Score" (0–100) is calculated based on four proprietary technical pillars:Baseline Alignment (30 pts): Measures if the $Price / Benchmark$ ratio is above its 21-period EMA.Volatility-Normalized Momentum (25 pts): We calculate a Z-score of the RS slope and divide it by the asset's ATR % of price. This ensures momentum is measured by "clean" price action rather than high-beta volatility spikes.Beta-Decoupling (20 pts): Using ta.correlation, the script penalizes "Market Huggers." Points are awarded when a stock shows strength independent of the benchmark's immediate fluctuations.Freshness & Highs (25 pts): Points are awarded for proximity to 252-day relative strength highs, identifying stocks entering a "Power Zone" of leadership.Interpreting the StatesThe dashboard in the bottom-right identifies three distinct permission states:ENGAGE (Score 80+): Full leadership permission. The asset is outperforming with idiosyncratic strength and clean momentum (See FDX example in the gallery).OBSERVE (Score 50–79): Leadership is present but aging or overly correlated to the market (See MU example in the gallery).STAND DOWN (Score <50): Leadership is broken; the asset is a relative laggard (See CBLL example in the gallery).Technical FeaturesMulti-Timeframe Validation: Optional Weekly/Monthly RS confirmation to filter out "noise."Benchmark Timing Filter: A built-in gate that checks if the broader market (Benchmark) is in a "Risk-Off" regime.Non-Repainting: All security calls use lookahead=barmerge.lookahead_off to ensure historical accuracy.Customizable UI: Toggle the dashboard on/off via the "Style" menu for a cleaner workspace.DisclaimerThis script is an informational diagnostic tool and does not generate trade signals, entries, or exits. Educational use only.
BTC - Sentiment (Posts weighted) LSMABTC - Sentiment (Posts Weighted) LSMA | RM
Concept
In the current 2026 market regime, Bitcoin has transitioned into a mature institutional asset. However, retail "Social Liquidity" remains the primary driver of local volatility and blow-off tops. This script serves as a deterministic proxy for crowd conviction, utilizing the LUNARCRUSH:BTC_SENTIMENT feed to identify when social hype has decoupled from fundamental value.
Data Source: LunarCrush Integration
This model utilizes the native LunarCrush data prefix. Unlike simple "mention counts," the BTC_SENTIMENT metric is a percentage-based value (0-100%) representing the "Sentiment of positive posts weighted by interactions."
• Interactions vs. Volume: By weighting sentiment by interactions (likes, shares, comments), the data filters out bot-driven "spam" and focuses on what real participants are actually engaging with.
• Meaning of the Value: 100% indicates that every single interaction-weighted post is positive; 0% indicates total negativity. Historically, BTC sentiment rarely drops below 60% or stays above 90% for long, creating a predictable mean-reverting corridor.
Technical Architecture
• The LSMA Denoising Engine Raw social data is inherently "jittery." To extract a tradable signal, we apply a Least Squares Moving Average (LSMA) with a 28-day lookback.
• Mathematical Advantage: Unlike a Simple Moving Average (SMA), the LSMA calculates a linear regression line for each period to find the "best fit." This allows the indicator to track the velocity of sentiment shifts with significantly less lag, which is critical for identifying "Social Exhaustion" before a price reversal occurs.
• The Social Heat Index (SHI) Calculation: To align this data with the broader Rob Maths ecosystem, we normalize the LSMA output into a standardized 0–10 score using a Linear Feature Scaling (Min-Max) formula: SHI = ((Current LSMA - 65) / 25) * 10 ; This formula treats 65% as the "Floor" (Apathy) and 90% as the "Ceiling" (Hysteria). This 0–10 scale allows for immediate comparison against other institutional risk metrics.
Regime Audits & Usage
• Accumulation (Blue Zone / <72.5%): Social Despair. Retail interest is at a mathematical minimum. Historically, these periods of "Social Apathy" coincide with major local bottoms as institutional "Smart Money" absorbs the lack of retail demand.
• Neutral Zone (Grey): Sustainable growth. Sentiment is within the normal distribution.
• Distribution (Red Zone / >82.5%): Overheated. The crowd is in a state of maximum FOMO. When the SHI exceeds 8.5/10, the risk of a "Liquidity Flush" increases significantly.
Visual Scaling
To ensure the curve is readable, the indicator pane is hard-locked to a 65–90 scale. This prevents the "flat line" effect often seen in 0-100 oscillators and highlights the subtle divergences that occur at cycle peaks.
Disclaimer
Past performance does not guarantee future results. Social metrics are alternative data points and should be used in conjunction with price action and risk management. This is a mathematical model, not financial advice.
Tags
Rob Maths, Rob_Maths, robmaths, Bitcoin, Sentiment, LunarCrush, Quant, LSMA, OnChain, Social Liquidity
CTR Weekly MA TradingI built this simple pine script to help me trade on the lower timeframe (1d) while still showing my key weekly moving averages to help me trade with the macro trend.
Rules for trading...
Steps for taking a Short position:
1. Wait for all 3 weekly moving averages to be in alignment (8EMA<21SMA<50SMA). When these aligned the candles will change to bright red, meaning bearish.
2. Wait for a pullback to the 1 Day 21SMA. When a candle touches the 21SMA, that candle will change color to white. This will be your alert to get ready to enter into a short.
3. On the next candle you can then take a short position as long as that candle is below the 21SMA, if not, wait for the net daily candle to close. If that is below the 21SMA you can then enter into a short on the opening of the next daily candle.
I built this to trade the Bear Market but this same method can also work in a Bull Market but just do the opposite.
GLD Overlay on GCPlots GLD levels on GC
Uses live GLD + live GC during GLD premarket→after-hours (04:00–20:00 NY, Mon–Fri)
Outside that window, it holds the last ratio from the prior daily close
Updates lines after "min_move"
Draws a grid of GLD $1 levels (±N) mapped into GC space
ES SPX Pullback Engine (v1)this script is intended to provide clear long or short pullback entries, while /ES is leading the index
Pattern Atlas Smart Panel Alerts Toni Ventura MaltaThe Pattern Atlas in 1 Indicator
Not fool proof but helps understanding what the discord traders are talking about ;)
Fair Value Gaps [MattyBTradez]This indicator marks out every Fair Value Gap, and the colors are customizable.
DG Channel + Reversal Alerts//@version=5
indicator("Channel + Reversal Alerts", overlay=true)
//==================================================
// 1. НАСТРОЙКИ КАНАЛА
//==================================================
length = input.int(100, "Длина канала", minval=10)
// Канал по High / Low (надёжно и наглядно)
upper = ta.highest(high, length)
lower = ta.lowest(low, length)
// Рисуем канал
plot(upper, "Верхняя граница", color=color.red, linewidth=2)
plot(lower, "Нижняя граница", color=color.green, linewidth=2)
//==================================================
// 2. ЛОГИКА КАСАНИЙ
//==================================================
touchUpper = high >= upper
touchLower = low <= lower
touchUpper_first = touchUpper and not touchUpper
touchLower_first = touchLower and not touchLower
//==================================================
// 3. ПРОБОИ И РАЗВОРОТЫ
//==================================================
// Закрытие свечи вне канала
closeAbove = close > upper
closeBelow = close < lower
// Тень вышла за канал, а закрытие внутри
wickAbove = high > upper and close <= upper
wickBelow = low < lower and close >= lower
// Разворот = закрытие ИЛИ тень вне канала
reversalUpper = closeAbove or wickAbove
reversalLower = closeBelow or wickBelow
// Только первое появление, чтобы не спамило
reversalUpper_first = reversalUpper and not reversalUpper
reversalLower_first = reversalLower and not reversalLower
//==================================================
// 4. АЛЕРТЫ
//==================================================
// КАСАНИЕ
alertcondition(touchUpper_first, title="Upper touch", message="⬆️ касание")
alertcondition(touchLower_first, title="Lower touch", message="⬇️ касание")
// РАЗВОРОТ
alertcondition(reversalUpper_first, title="Upper reversal", message="⬆️ разворот")
alertcondition(reversalLower_first, title="Lower reversal", message="⬇️ разворот")
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.






















