Smart Money Pressure DifferentialPurpose
The Smart Money Pressure Differential (SMPD) is built to reveal the underlying tug‑of‑war between informed volume flows represented by NVI and reactive volume flows represented by PVI, using a clean statistical framework. Instead of relying on raw NVI or PVI, which drift over time and are not directly comparable, the script isolates pressure deviations by measuring how far each index moves away from its own long‑term expectation. By standardizing these deviations, SMPD produces a stable, volatility‑normalized spread that highlights accumulation, distribution, and regime transitions with far greater clarity than traditional volume indicators.
How It Works
The script computes NVI and PVI, scales them, and subtracts their EMAs to extract deviation‑from‑trend pressure, with optional WMA smoothing to reduce micro‑noise. Each deviation series is then standardized independently using rolling mean and standard deviation, ensuring both NVI and PVI operate on equal statistical footing. Their difference becomes the SMPD spread, a normalized measure of which side is exerting more pressure. A second layer applies log‑ROC to capture acceleration rather than level, and these acceleration signals can be plotted as dotted lines. Standard deviation reference levels at 0, 1, 2, and 3 provide a consistent frame for interpreting extreme pressure events.
Rationale
This architecture solves structural weaknesses found in most volume‑based tools, particularly scale drift, volatility collapse, and the instability of cumulative indicators. Standardizing before differencing prevents one index from overpowering the other, ensuring the spread reflects true pressure imbalance rather than structural bias. The log‑ROC layer adds a stable acceleration measure that avoids the distortions of classic ROC when values approach zero. The result is a regime‑independent engine, producing signals that remain comparable across assets, timeframes, and market conditions. SMPD therefore becomes a robust diagnostic tool for identifying when smart‑money pressure is building, fading, or reversing, without relying on arbitrary thresholds or bounded oscillators that distort signal strength.
Sentiment
Gold Intelligence - Final Sniper v12 by Herman Sangivera(Papua)🚀 Gold Intelligence - Final Sniper v12 by Herman Sangivera ( Papua )
Overview
Gold Intelligence - Final Sniper v12 is a cutting-edge technical indicator specifically engineered for high-volatility instruments like XAU/USD (Gold). This indicator merges advanced Price Action candlestick recognition algorithms with institutional volume analysis and real-time market sentiment to deliver precision entry signals.
The primary goal of this tool is to filter out market "noise" and highlight only High Probability Setups that meet strict technical criteria.
🛡️ Key Features
Smart Pattern Recognition: Automatically identifies high-impact patterns: Pin Bars (psychological rejection) and Engulfing Candles (institutional dominance).
Probability Scoring: Every signal is assigned a percentage (%) score based on volume confirmation and price intensity. Signals only trigger when they exceed the minimum threshold (default 75%).
Real-Time Sentiment Dashboard: An exclusive on-chart panel that monitors the balance of Buy/Sell pressure instantly.
Dynamic Risk Management: Automatically projects Take Profit (TP) and Stop Loss (SL) boxes using Average True Range (ATR) calculations, ensuring your targets stay adaptive to current market volatility.
Institutional Volume Check: Validates entries by cross-referencing significant volume spikes (Smart Money footprints) to help you avoid market traps and fakeouts.
📖 How to Use (Trading Guide)
Identify the Signal: Wait for the "SNAPSHOT GOLD" label to appear on the chart.
🟢 Green Label: Buy Signal (Bullish).
🔴 Red Label: Sell Signal (Bearish).
Check Probability Score: It is highly recommended to only take signals with a score of >75%. A higher score indicates stronger technical confluence.
Execution & Targets:
Enter the trade at the close of the signal candle.
Target the Green transparent box for profit and use the Red box for risk management.
Dashboard Confirmation: Ensure the Sentiment percentage aligns with your trade direction (e.g., Sentiment > 60% Buy for Long positions).
⚙️ Input Parameters
Min Probability: The minimum accuracy threshold for a signal to be displayed.
TP & SL Multiplier: Customize your reward-to-risk ratio based on ATR multiples.
Alerts: Fully compatible with real-time notifications for Mobile, Email, or Webhooks.
⚠️ Disclaimer
This indicator is an analytical tool and does not guarantee profits. Gold trading involves significant risk. Always use proper money management and backtest on a demo account before trading live funds.
BTC vs US500: Normalized Trend Divergence Backtest StrategyOverview:
This strategy script provides a framework for testing the hypothesis that Bitcoin’s price movements are heavily influenced by global macro trends. It utilizes a unique normalization technique to overlay the S&P 500's momentum onto the Bitcoin chart.
This strategy is tailored for trading Bitcoin on higher timeframes to capture significant, macro-driven swings, rather than intraday noise.
Strategy Logic:
The core logic of the strategy is based on the relationship between the BTC price and a Normalized Moving Average of the S&P 500.
Target Asset: BTCUSD
Recommended Timeframe: 1D for the most effective backtest results.
Long Entry: Triggered when BTC price crosses ABOVE the Normalized US500 Moving Average.
Short/Exit Entry: Triggered when BTC price crosses BELOW the Normalized US500 Moving Average.
BTC vs US500: Normalized Trend DivergenceOverview:
In the financial landscape of 2026, the correlation between Bitcoin and traditional equity markets has reached institutional maturity. This indicator provides a sophisticated way to visualize this relationship by normalizing the US500 index directly onto the Bitcoin price scale.
This script is designed specifically for trading Bitcoin. We focus on anomalies where BTC either aligns with or diverges from the global market trend.
Key Features:
Target Asset: BTCUSD
Recommended Timeframe: 1D for reliable macro trend analysis.
Normalized US500 MA (Neon Blue): The primary signal line showing the 50-period trend of the S&P 500 adapted to BTC’s price.
Live Correlation Dashboard: Real-time data showing Market Status (Strong Risk-On, BTC Strength, etc.).
Crossover Signals: Visual alerts (triangles) when Bitcoin’s price breaks above or below the normalized US500 trend.
How to use:
Strong Risk-On: Price is above both MAs. Global markets and BTC are in sync.
BTC Strength (Divergence): BTC is above the US500 MA but US500 itself is lagging. This often signals institutional accumulation of BTC.
VWF Trend VWF Trend – Fear-Based Trend Detection
VWF Trend is a price-overlay indicator designed to detect trend direction and strength using a volatility-based approach derived from Williams Vix Fix (WVF).
Unlike classic momentum indicators, VWF Trend focuses on fear and pressure zones and projects them directly onto the price chart for intuitive trend reading.
Key Concept (Important)
When the VWF lines contract and stay close to each other, the trend is strong.
This contraction means:
Volatility is controlled
Price is moving with commitment
Trend continuation probability is high
When the distance between the lines expands, trend strength weakens and the market is more likely to enter consolidation or transition.
How It Works
The central VWF EMA line acts as a dynamic trend threshold
Upper and lower VWF bands define
define pressure boundaries
Price position relative to the VWF line determines trend bias
How to Read
🟢 Bullish Trend
Price stays above the VWF line
VWF bands remain tight and compressed
Indicates strong upward trend
🔴 Bearish Trend
Price stays below the VWF line
VWF bands remain tight and compressed
Indicates strong downward trend
⚠️ Weak or Transition Zone
Bands start expanding
Price oscillates around the VWF line
Trend strength is decreasing
Why VWF Trend?
Highlights trend strength visually
Helps identify early trend continuation
Filters noise during strong moves
Works well after high-volatility events
Clean and chart-friendly design
Note:
VWF Trend is best used as a trend strength and direction filter,
not as a standalone buy/sell signal.
It performs best when combined with price action, structure, or volume analysis.
Zen Lab ALL-IN-ONE🧠 Zen Lab All-In-One Trading Toolkit
The Zen Lab All-In-One indicator is built for traders who want structure, confluence, and volatility awareness in one clean system — without cluttering their charts with 10 different tools.
This combines news awareness, ATR volatility planning, session levels, trend context, and execution checklists into a single professional trading assistant.
📰 Smart News Filter (Stay Out of Chaos)
The indicator automatically highlights only the news events that actually move markets:
🔴 High-Impact Economic Events
⚪ Market Holidays
No low-impact noise. No unnecessary distractions.
Just the events most likely to cause volatility spikes.
✔️ On-chart vertical news markers
✔️ Optional news table
✔️ Designed for intraday and session traders
📏 Customizable ATR Volatility Tool
Trade based on real market movement, not guesswork.
The built-in ATR table lets you:
• View current ATR
• Calculate stop loss distance using ATR multipliers
This helps you size trades based on conditions, not emotions.
📋 Confluence Checklist (Execution Discipline)
Stay consistent with your trading rules.
The on-chart checklist allows you to track your confluences before entering a trade, helping reduce impulsive decisions and reinforcing discipline.
Great for traders who follow a structured system.
📈 Moving Average Trend Context
Includes a built-in moving average to help you quickly identify current trend direction and market bias without adding extra indicators.
Perfect for confirming lower timeframe direction
🌍 Session High & Low Identifier
Know where the real liquidity is.
Automatically marks key session ranges so you can:
✔️ Spot session breakouts
✔️ Trade liquidity sweeps
✔️ Identify expansion from consolidation
Designed for London, New York, and Asian session strategies.
5% D/ID or 15%W DropCan be used to trigger alerts for 5% daily drops or intra-day drops or 15% drops during the past 5 days. Useful for selling puts.
USDJPY Timing Composite (5-Component)Overview
A sophisticated multi-component oscillator designed specifically for intraday USDJPY trading. This indicator combines five key market drivers to provide high-probability timing signals by isolating true USD strength and JPY weakness from noise.
Components & Methodology
The indicator uses z-score normalization (default 20-period lookback) to make five distinct market signals comparable and combines them into a single composite reading:
Primary USD Strength Signals (60%):
-EURUSD (30%) - Inverted EUR/USD measures USD strength against the Euro
USDCHF (30%) - USD strength against the Swiss Franc
Yield Differential (25%):
US02Y (25%) - 2-Year Treasury yield captures Fed policy expectations and carry trade dynamics
JPY Weakness Confirmation (15%):
CHFJPY (7.5%) - CHF/JPY cross isolates JPY-specific weakness
EURJPY (7.5%) - EUR/JPY cross provides additional JPY context
Key Features
✅ Multi-Source Validation - Separates real USD strength from currency-specific noise
✅ JPY Context Filter - Confirms whether moves are driven by USD strength, JPY weakness, or both
✅ Alignment Indicator - Visual dots show when 4+ components agree (high-confidence setups)
✅ Mean-Reversion Zones - Overbought/oversold thresholds at ±1.5 standard deviations
✅ Clean Visualization - Candle-based display (no wicks) for easy interpretation
How to Use
Basic Signals:
Green candles = Bullish USDJPY pressure (USD strengthening / JPY weakening)
Red candles = Bearish USDJPY pressure (USD weakening / JPY strengthening)
Above +1.5 = Overbought zone → look for mean-reversion shorts
Below -1.5 = Oversold zone → look for mean-reversion longs
High-Confidence Setups (Alignment Dots):
Lime dot at top = 4+ components bullish → strong long bias
Magenta dot at bottom = 4+ components bearish → strong short bias
No dots = Mixed signals → reduce position size or wait for clarity
Divergence Trading:
USDJPY makes new high but composite doesn't confirm → potential reversal down
USDJPY makes new low but composite doesn't confirm → potential reversal up
Best Practices
Timeframes: 5-minute to 15-minute charts for intraday trading
Session Focus: London and New York overlap (peak liquidity)
Pair With: Support/resistance levels, volume profile, or session highs/lows
Risk Management: Use alignment indicator to size positions (larger size when dots present)
Weight Adjustments:
Fed data days (CPI, NFP, FOMC): Increase US02Y weight to 30-35%
Pure FX sessions: Increase -EURUSD/USDCHF weights to 35% each
Risk-off events: Monitor CHFJPY/EURJPY for safe-haven JPY flows
Technical Details
Calculation Method: Z-score normalization with configurable lookback period
Default Weights: -EURUSD 30% | USDCHF 30% | US02Y 25% | CHFJPY 7.5% | EURJPY 7.5%
Extreme Threshold: ±1.5 standard deviations (adjustable)
Alignment Trigger: 4 out of 5 components in agreement
Customizable Parameters:
Z-score lookback period (default: 20)
Individual component weights
Extreme threshold levels
Alignment indicator on/off
Advantages Over Simple Indicators
Unlike single-pair or DXY-based indicators, this composite:
Filters false signals - USD strength confirmed by two independent FX pairs
Identifies source of moves - Separates USD dynamics from JPY-specific flows
Reduces noise - JPY crosses prevent misreading EUR/CHF weakness as USD strength
Adapts to regimes - Adjustable weights for different market conditions
Suggested Complementary Analysis
Price action at key technical levels
Session opening ranges
Economic calendar (especially Fed events)
Correlation with US equity markets during risk-off periods
Intermarket analysis with JGB yields for JPY policy context
Disclaimer
This indicator is a technical analysis tool and does not guarantee profitable trades. Always use proper risk management, consider fundamental factors, and backtest any strategy before live trading. Past performance does not indicate future results.
US Stock Market Performance by Sector[Dots3Red]This indicator displays the annual performance of the U.S. stock market by sector.
Selected major sectors
IND – Industrials
TECH – Technology
HTH – Healthcare
FIN – Financials
COMM – Communication Services
CONSCYC – Consumer Cyclical
CONSSTAP – Consumer Staples
ENERGY – Energy
REAL ESTATE – Real Estate
BASMAT – Basic Materials
The data is presented in a table below the main chart.
Green cell — the sector was bullish during that year
Red cell — the sector was bearish during that year
The table automatically sorts sectors by performance, placing the best-performing sector at the top for each year.
NOTE:
Annual performance is calculated starting from 2020 by default (arbitrarily chosen) and can be adjusted by the user.
PEGY RatioThe basic metrics that all indicators descend from are for each bar the Open, High, Low, Close and Volume where the Close is often noted as Price. Then the Price/Earnings ratio entered trading. Price/Earnings is often noted as P/E ratio or PE.
The first major formalisation and widespread use of the P/E ratio came in 1934, when Benjamin Graham and David Dodd introduced it in their landmark book "Security Analysis". Their work established the P/E ratio as a core tool in fundamental analysis and value investing.
Graham’s influence was profound: he used the P/E ratio to help investors judge whether a stock was overpriced or underpriced, and his teachings shaped generations of value investors, including Warren Buffett.
The P/E ratio evolved into modern variants like forward P/E and Shiller CAPE.
There’s no single P/E cutoff that definitively marks a “growth” or “income” stock, but investors commonly treat P/E below about 10–15 as value/income oriented and P/E above about 20–25 as growth oriented. It is important to watch the P/E trend. If the P/E is a low value and reducing in value, then the company may be failing, and it is not good to invest in.
P/E is a relative signal, not an absolute rule. A high P/E usually means the market expects above average future earnings growth; a low P/E often signals lower growth expectations, higher current yield, or elevated risk. Benchmarks vary by sector and cycle: what’s “high” for utilities is low for software. Historical market averages (e.g., S&P 500) help frame whether a multiple is elevated or depressed.
The next step was the PEG ratio which was first introduced in 1969 by Mario Farina, who described it in his book "A Beginner’s Guide to Successful Investing in the Stock Market".
The concept later gained widespread popularity thanks to Peter Lynch, who championed it in his 1989 bestseller "One Up on Wall Street", arguing that a “fairly priced” company tends to have a PEG of about 1. Over 1 is overpriced and below is a bargain.
Later the PEGY ratio, a variation of the PEG ratio that added dividend yield into the valuation came into prominence so that mature, dividend paying companies are treated “fairly” . The PEGY ratio emerged in the 1990s as analysts and portfolio managers began adapting the PEG ratio for dividend paying companies. The concept is a natural extension of Peter Lynch’s PEG logic: If growth matters, and dividends matter, combine them into one valuation metric.
PEGY (Price/Earnings Growth% and Dividend Yield) is a straightforward modification of the PEG ratio that adds dividend yield to the growth term so that mature, dividend paying companies aren’t penalized by low growth rates alone. The formula is typically written as:
PEGY=(Price/Earnings)/(Earnings growth %+Dividend yield%)
Peter Lynch (One Up on Wall Street, 1989) is the most cited printed source that describes a dividend adjusted PEG concept and applies it as a practical screening rule for investors. PEGY is in Chapter “Some Fabulous Numbers”.
If earnings are negative, then the PEGY ratio will be negative, and it is best to invest in companies that make money. That is, positive PEGY ratio.
The PEGY ratio can have different ratios depending upon whether historical data is used (Mario Farina preference) or whether forward looking earnings (Peter Lynch preference) is used in the calculations.
Enough for the history lesson. You can quickly go through your watchlist and determine which stocks have a PEGY Ratio from 0 to 1 and eliminate the others. Then whittle down that list to find stocks travelling from bottom left to upper right on the page. Use any other indicators on that reduced list that your tradng plan uses and there you have your list of stocks in which to invest.
OIL (WTI) Pro: 1H Trend + Prob + Sessions + Candle TimerIndicator Features
📈 Multi-Timeframe Trend Detection (1H)
Identifies the main market trend from the 1-Hour timeframe
Displays the trend clearly as Bullish / Bearish / Sideways
Avoids trading against the higher-timeframe direction
🎯 Smart BUY & SELL Signals (On Candles)
Clear BUY and SELL signals directly on the candles
Signals are placed below lows (BUY) and above highs (SELL)
Uses ATR offset so signals are always visible and never hidden inside candles
📊 Separate Buy & Sell Probability
Calculates BUY Probability and SELL Probability independently
Probabilities are shown as percentages
Helps traders decide when to enter and when to wait
🧠 Pullback-Based Logic (No Chasing Price)
Signals are generated only after healthy pullbacks
Prevents entering trades when price is overextended
Displays a “Wait for Pullback” warning during strong trend extensions
Cumulative Buy/Sell Volume Ratio[MIT]Cumulative Volume Ratio
Description:
This dedicated indicator calculates and displays the ratio of cumulative buy volume to cumulative sell volume over the past n bars (Ratio = Cumulative Buy Volume / Cumulative Sell Volume).
Volume is split based on price movement:
Up bars (close > open) → All volume assigned to Buy
Down bars (close < open) → All volume assigned to Sell
Flat bars (close == open) → Configurable handling (Split 50/50, Ignore, All to Buy, or All to Sell)
Key Features:
Supports two display modes: Bars (柱状图) or Line (折线图)
Ratio > 1 shown in orange (strong buy pressure), Ratio < 1 shown in teal (strong sell pressure)
Built-in reference lines: 1:1 Equilibrium, Strong Buy (>1.5), Strong Sell (<0.67)
Optional debug label on the last bar showing current ratio value + raw buy/sell cumulative volumes
Inputs:
Lookback Period n: Number of bars for rolling cumulative calculation (default: 20)
Flat Bar Volume Handling: How to treat doji/flat bars (default: Split 50/50)
Display Ratio as Bars: true = Bars style, false = Line style
Show Current Ratio Value Label: Toggle debug label on last bar
Usage Tips:
Ratio > 1 indicates dominant buy pressure in recent volume → potential bullish momentum
Ratio < 1 indicates dominant sell pressure → potential bearish pressure
Best used in conjunction with price chart to spot divergences or confirmations
Performs best on stocks/instruments with active volume
累计成交量比率(Cumulative Volume Ratio)
本指标专门计算并显示过去 n 根 K 线的累计买入成交量与卖出成交量的比率(Ratio = 累计买入量 / 累计卖出量)。
根据 K 线价格走势对成交量进行拆分:
阳线(收盘 > 开盘)→ 全部成交量计入买入
阴线(收盘 < 开盘)→ 全部成交量计入卖出
平盘(收盘 = 开盘)→ 支持多种处理方式(50/50 平分、忽略、全部计买入、全部计卖出)
核心功能:
支持柱状图(Bars)或折线图(Line)两种显示方式
比率 > 1 时显示橙色(买方强势),比率 < 1 时显示青色(卖方强势)
内置关键参考线:1:1 均衡线、买方强势 (>1.5)、卖方强势 (<0.67)
可选在最后一根 K 线上显示调试标签,实时显示当前比率值及累计买/卖量数值
参数说明:
回看周期 n:累计计算的 K 线根数(默认 20)
平盘处理:如何处理收盘=开盘的 K 线(默认 50/50 平分)
比率显示为柱状图:开启为柱状图,关闭为折线图
显示当前比率数值标签:是否显示最后一根 K 线的数值标签(调试用)
使用建议:
比率 > 1 表示近期买入力量占优,适合关注潜在上涨动能
比率 < 1 表示卖出力量占优,可作为短线压力参考
建议与价格主图结合使用,观察比率与价格走势的背离或确认信号
在成交量活跃的个股上效果更明显
Cumulative Buy/Sell Volume[MIT]Cumulative Buy/Sell Volume - Stacked/Separate Mode
Description:
This indicator calculates and displays the cumulative buy and sell volume over the past N bars (lookback period). It splits volume based on price movement:
Up bars (close > open) → All volume assigned to Buy
Down bars (close < open) → All volume assigned to Sell
Flat bars (close == open) → Configurable handling (split 50/50, ignore, all to buy, or all to sell)
Key Features:
Two display modes:
Separate Display: Buy bars upward (green), Sell bars downward (red) — classic side-by-side comparison
Stacked Display: Both bars upward — visually stacked to show total volume and buy/sell dominance
Fully customizable colors for Buy and Sell bars (with high transparency for better stacking visibility)
Rolling window calculation (default 20 bars)
Optional debug label on the last bar showing exact Buy/Sell cumulative values
Inputs:
Lookback Period n: Number of bars to look back for cumulative volume (default: 20)
Flat Bar Volume Handling: How to handle doji/flat bars (Split 50/50, Ignore, All to Buy, All to Sell)
Display Mode: Separate Display or Stacked Display
Show Buy Volume / Show Sell Volume: Toggle visibility
Buy Bar Color / Sell Bar Color: Custom color picker
Usage Tips:
Use "Stacked Display" to quickly see which side (buy or sell) dominates the recent volume.
Use "Separate Display" for clear absolute strength comparison.
Higher transparency ensures overlapping bars in stacked mode remain distinguishable.
Best used on active stocks with sufficient volume.
Note: This is a non-overlay indicator (shows in a separate pane). Combine with price chart for better context.
指标名称: 累计买/卖成交量 - 叠加/分开模式
短标题: Cum BuySell Vol Custom
指标描述:
本指标计算并显示过去 N 根 K 线的累计买入量和卖出量。根据价格走势对成交量进行拆分:
阳线(收盘 > 开盘)→ 全部成交量计入买入
阴线(收盘 < 开盘)→ 全部成交量计入卖出
平盘(收盘 = 开盘)→ 可配置处理方式(50/50 平分、忽略、全部计买入、全部计卖出)
主要功能:
两种显示模式:
分开展示(Separate Display):买入柱向上(绿色),卖出柱向下(红色)——经典对比模式
叠加展示(Stacked Display):买入和卖出柱都向上绘制——视觉上堆叠,快速看出买/卖谁占主导
支持自定义买入柱和卖出柱颜色(内置高透明度,确保叠加时两种颜色都能看清)
滚动窗口计算(默认 20 根 K 线)
可选在最后一根 K 线上显示调试标签(显示精确的累计买入/卖出数值)
参数说明:
回看周期 n:累计计算的 K 线根数(默认 20)
平盘处理方式:如何处理收盘=开盘的 K 线(50/50 平分、忽略、全部计买入、全部计卖出)
显示模式:分开展示 或 叠加展示
显示买入量 / 显示卖出量:开关控制是否显示对应柱子
Buy Bar Color / Sell Bar Color:自定义柱子颜色(支持透明度调整)
使用建议:
叠加模式适合快速判断近期成交量中买方或卖方更强势(柱子谁高谁占优)。
分开模式适合清晰对比买/卖绝对力量差异。
高透明度设置确保叠加时两种颜色都能透出,不会完全覆盖。
建议用在成交活跃的个股上,效果更明显。
Smart Auto-Step Openndicator Name: 15m Reversal Strategy (Polymarket)
Short Description: A mean-reversion strategy designed for the 15-minute timeframe. It identifies overextended short-term trends and signals entries on the probability of a reversal candle.
DATA BOX - Market Overview (18 Key Assets)Market sentiment dashboard - know what's hot, what's not, instantly!
Real-time dashboard showing 18 key assets across Indices, Crypto, Metals, Bonds & Forex
📊 ONE GLANCE MARKET SENTIMENT
BTC, ETH, SOL, SPX, Nasdaq, DJ30, Russell2000, Gold, Silver, Nikkei, UK100, EU50, GER40, HK50, NIFTY, SSE Composite, US10Y, DXY
Current Prices - Live updating
Daily 50 SMA - Price above = 🟢 BULL | Below = 🔴 BEAR
4H SMA - Short-term trend direction - Price above = 🟢 BULL | Below = 🔴 BEAR
RSI Daily/4H - Momentum extremes highlighted
----------------------------------------------------------------------------------------------------------------------
🎨 VISUAL POWER RANKING
text
🟢 GREEN ROW = Both D50 + 4H Bullish (STRONG BUY)
🟠 ORANGE ROW = Mixed signals (CAUTION)
🔴 RED ROW = Both Bearish (STRONG SELL)
----------------------------------------------------------------------------------------------------------------------
⚙️ FULLY CUSTOMIZABLE
3 Sizes: Small/Medium/Large
6 Color Pickers: Bull/Bear/Mixed + Headers/RSI/Price BG
Toggle RSI columns independently
----------------------------------------------------------------------------------------------------------------------
🚀 PERFECT FOR:
Day traders needing a multi-asset overview
Swing traders checking daily trend alignment
Portfolio managers monitoring global risk.
Volume Ratio [MIT]Core Logic:
This indicator splits each bar's volume into "Buy Volume" and "Sell Volume" based on the relationship between close and open price, then calculates the rolling ratio of cumulative buy volume to sell volume over the past n bars, helping traders gauge short-term buying vs. selling pressure.
Volume Split Rules:
Bull bar (close > open): All volume assigned to Buy
Bear bar (close < open): All volume assigned to Sell
Flat bar (close == open): Handled by the "Flat bar volume" setting:
Split 50/50 (default): 50% Buy + 50% Sell
Ignore: Volume discarded (0 Buy, 0 Sell)
All to Buy: All volume to Buy
All to Sell: All volume to Sell
Calculation:
buySum = rolling sum of buy volume over last n bars
sellSum = rolling sum of sell volume over last n bars
Ratio = buySum / sellSum (na when sellSum = 0)
Ratio > 1: Buying pressure dominates (red line)
Ratio < 1: Selling pressure dominates (green line)
Visual Elements:
Green line: Rolling Buy Volume (n bars) – optional
Red line: Rolling Sell Volume (n bars) – optional
Colored line: Buy/Sell Ratio (red when >1, green when <1)
Horizontal line at 1.0: Neutral balance level
Typical Trading Use Cases:
Trend Confirmation: Ratio persistently > 1.2–1.5 while price rises → strong bullish confirmation
Divergence: Price makes higher high but ratio declines → potential top divergence
Breakout Filter: Breakout with rapidly rising ratio → higher probability breakout
Range Market Avoidance: Ratio oscillating between 0.8–1.2 → avoid choppy entries
Crypto Day/Swing Trading: Commonly used on 5m–1h charts, combined with price action or order flow
核心逻辑:
该指标基于K线的收盘价与开盘价的关系,将每根K线的成交量(volume)拆分为“买入量”(Buy Volume)和“卖出量”(Sell Volume),然后计算过去n根K线的累计买入量与卖出量的比率(Buy/Sell Ratio),用来判断短期内买卖力量的相对强弱。
成交量拆分规则:
阳线(close > open):全部成交量计入买入量
阴线(close < open):全部成交量计入卖出量
平线(close == open):根据“Flat bar volume”参数处理:
Split 50/50(默认):平分50%买入 + 50%卖出
Ignore:忽略该K线(都不计)
All to Buy:全部算买入
All to Sell:全部算卖出
计算方式:
滚动窗口n根K线内的累计买入量(buySum)和卖出量(sellSum)
比率 = buySum / sellSum(当sellSum=0时显示na)
比率 > 1:买入力量占优(红色)
比率 < 1:卖出力量占优(绿色)
图表显示:
绿色柱线:过去n根的累计买入量(可选显示)
红色柱线:过去n根的累计卖出量(可选显示)
彩色折线:买入/卖出比率(>1红色,<1绿色)
水平线1.0:平衡线(比率=1)
典型使用场景:
趋势确认:比率持续 > 1.2~1.5 且价格上涨 → 强势多头确认
背离信号:价格创新高但比率持续下降 → 潜在顶部背离
放量突破:突破关键位时比率同步快速拉升 → 突破有效性更高
震荡市过滤:比率在0.8~1.2区间反复震荡 → 避免频繁交易
币圈短线:常用于5分钟~1小时图,配合价格结构或订单流使用
BTC/XAU Correlation Crossing Delay PerformanceOVERVIEW
The BTC/XAU Correlation Crossing Delay Performance indicator is a specialized macro-tool designed to track the structural relationship between Bitcoin (Digital Gold) and Physical Gold. In institutional finance, these two assets represent the "Scarcity Complex." While they are often viewed as similar, they move in distinct Regime Shifts . This script identifies the exact moments of correlation decoupling—historically a lead indicator for major Bitcoin volatility and catch-up rallies.
THE IDEA: THE DECOUPLING SIGNAL
Traditional safe havens like Gold often act as a "Smoke Alarm" for geopolitical fear. Bitcoin, however, functions more as a "Fire Department" for global liquidity expansion. When the 52-week correlation between the two drops to zero or below, it signals a structural divergence.
Data from the past can suggest that such "Zero-Cross" events occur when Gold has front-run a price move, leaving Bitcoin at a relative valuation discount. This script marks these "Regime Shifts" (M-Markers) and measures the subsequent performance during a customizable Alpha Window .
CALCULATIONS & METHODOLOGY
The script utilizes the following logic to generate its data points:
• Purchasing Power Ratio: Calculated as Bitcoin Price divided by Gold Price. This shows exactly how many ounces of gold 1 BTC can buy.
• Pearson Correlation: A rolling 52-week calculation measuring the linear relationship between BTC and Gold prices.
• Zero-Cross Signal: A logic trigger/Marker that fires when the correlation value drops from a positive state to zero or a negative value.(M1 - M-n)
• Alpha Performance: A secondary calculation that captures the BTC price at the signal bar and compares it to the price exactly N-weeks later.
HOW TO READ THE CHART
• Orange Line: The current BTC/Gold ratio. A rising line means Bitcoin is gaining purchasing power against Gold.
• Orange Vertical Shapes (M-n): These mark the "M-Signals" where correlation broke (correlation ratio turned from positive to 0 or below on that bar). This is the "coiled spring" phase.
• Blue Vertical Shapes (Result): These appear after your defined Alpha Window (e.g., 12 weeks). They display the percentage change for both the Ratio and BTC/USD price since the M-n-signal.
• Blue Area (middle Lane): A visualization of the raw correlation value. When this cloud disappears toward the zero-level, a regime shift is in progress.
USER INPUTS
• Tickers: Choose your preferred Bitcoin and Gold sources (e.g., INDEX:BTCUSD or TVC:GOLD).
• Correlation Lookback: Default is 52 weeks, the institutional standard for measuring annual macro cycles.
• Alpha Window: Define the number of weeks (e.g., 12) you wish to track after a decoupling signal to verify historical catch-up trends.
TIMEFRAME
I view the data on the weekly timeframe. The script is optimized to run on this timeframe.
DISCLAIMER
This script is provided for educational and research purposes only. Correlation shifts are indicators of market structure changes and do not guarantee future price direction. Past performance of the BTC/Gold ratio is not an indicator of future results. Always use comprehensive risk management when trading high-volatility assets.
TAGS
Rob Maths, robmaths, Rob_Maths, Bitcoin, Gold, Ratio, Correlation, Macro
Mission Control Dashboard (AI, Crypto, Liquidity)Description: Mission Control Dashboard (AI, Liquidity) is a comprehensive macro-liquidity and cycle-analysis dashboard designed to track the "Flow of Funds" across traditional and crypto markets. Instead of looking at price action alone, this script monitors the fundamental "plumbing" of the global economy.
Key Metrics Tracked:
The Debt Wall: Monitors the US 10Y Yield and TLT price. It signals a "Critical" state if yields spike above 5% or TLT drops below $80, indicating high stress in the bond market.
Global Liquidity (MTF Stable): A proprietary calculation summing the balance sheets of the FED, ECB, BoJ, and PBoC, plus Stablecoin market cap. It calculates the Rate of Change (ROC) to see if the world is "printing" or "draining" money.
TGA Hidden Fuel: Tracks the Treasury General Account. A falling TGA is often bullish for risk assets as it injects liquidity into the banking system.
Universal Alt Season: Monitors TOTAL3 (Crypto market cap excluding BTC & ETH) for parabolic moves (>30% ROC).
AI Infra Capex: Real-time tracking of Capital Expenditures from MSFT, GOOG, AMZN, and META to gauge the health of the AI cycle.
How to use:
Green Status across the board: High probability for "Risk-On" environments (Alt season, Tech rallies).
Strategic Beta vs. Tactical Alpha: If Beta is draining but Alpha is accelerating, it suggests a "False Breakout" or a divergence in liquidity.
Uranium Trend: Used as a proxy for the energy transition and long-term industrial cycle strength.
Open Interest [OI] & Liquidation Flow█ THE DUAL-ENGINE ARCHITECTURE: A FUSION OF TWO CRITICAL FORCES
The power of this suite comes from its dual-engine design. It isolates and analyzes the two opposing forces that truly drive modern markets: the informed positioning of institutions and the often-misguided sentiment of the retail crowd. A high-probability trade signal is only generated at the precise moment these two forces come into critical conflict.
ENGINE 1: The Open Interest (OI) & Position Flow Engine
This is your lens into the institutional world. Its primary function is to track the flow of money into and out of the market, revealing the true intent of large players.
Live OI Integration: In a groundbreaking feature for TradingView, this engine includes a Smart Symbol Detector that automatically seeks and integrates LIVE Open Interest data for supported markets (CME, Binance, Bybit, etc.). When available, you are seeing a direct feed of net new positions entering the market.
12-Factor Synthetic OI Model: When live OI data is not available, the engine synthesizes a high-fidelity proxy by analyzing 12 distinct factors, including Cumulative Volume Delta (CVD), Absorption, Effort vs. Result, and Institutional Bias.
Curvature Analysis: We don't just look at the flow; we analyze its Velocity and
Acceleration . A sharp acceleration in bullish OI Flow is a powerful sign that institutions are aggressively building long positions.
INTERPRETATION: This engine tells you what the "smart money" is doing. A divergence—where price is falling but OI Flow is rising—is a classic sign that institutions are quietly absorbing retail panic, often preceding a violent reversal upwards.
ENGINE 2: The Liquidation Flow & Crowd Engine
This engine operates on a powerful contrarian philosophy: the market is designed to inflict maximum pain on the largest number of participants. It identifies when the retail "herd" is over-leveraged and positioned for a fall.
Crowd Positioning Model: It analyzes factors like extreme RSI levels, deviation from Fair Value (VWAP), and "chase behavior" (e.g., many consecutive bullish candles) to determine when the retail crowd is dangerously over-exposed.
Risk Analysis: It synthesizes multiple risk factors—crowding, momentum divergence, exhaustion—into a single, easy-to-read Liquidation Risk percentage .
Fear & Greed Skew: It measures the volatility skew in the options market to provide a direct gauge of market-wide fear and greed, adding a final layer of sentimental context.
HOW TO USE IT: This is your liquidation radar. When Liquidation Risk is HIGH and the Crowd is positioned heavily LONG, the market is primed for a long squeeze (a liquidation cascade downwards). Conversely, when the Crowd is heavily SHORT, a short squeeze is highly probable.
█ THE SECRET SAUCE: UNIVERSAL ADAPTABILITY
The genius of this engine lies in its ability to work on any asset, in any timeframe, without manual recalibration. This is achieved through Z-Score Normalization . Every piece of data is converted from a raw value into a statistical score representing its deviation from the "norm." A +2.0 sigma event represents an extreme outlier, whether it's on a 1-minute chart of a crypto asset or a daily chart of a stock. This makes the signals universally comparable and allows the engine to automatically adapt to the unique volatility and character of any market.
█ THE ARSENAL: MASTERING THE VISUALS & ON-CHART TOOLS
Every visual element is a data-rich component designed for rapid, intuitive interpretation.
The Lower Pane Visualizer
This is your primary intelligence dashboard, with four distinct modes to view the underlying market forces:
Classic Flow (Default): A multi-column view perfect for spotting divergences between price and the underlying flow of money and sentiment.
Heatmap Matrix: A color-density grid designed to identify "cluster" events where multiple engines light up simultaneously, signaling institutional consensus.
Oscillator Pro: A zero-centered line visualization for traders who prefer crossover and momentum-style analysis.
Delta Waterfall: A unique cascading visualization that shows the cumulative "weight" of the market, stacking the pressure from each engine to reveal the dominant force.
Main Chart Overlays
BUY/SELL Signals: These are the primary, high-conviction reversal signals. They are not simple crossovers; they are the result of a rigorous confirmation process where institutional OI Flow directly conflicts with a vulnerable retail Liquidation Flow.
Minor Triangles (▲▼): Secondary momentum signals that are excellent for scalping, confirming a trend, or adding to a winning position.
Supply/Demand Zones: When a strong, institutionally-backed signal fires, the script automatically plots a defended zone (Red for Supply, Green for Demand), highlighting future high-probability reversal areas.
Key Levels: Automatically extends lines from significant highs and lows where a major flow reversal occurred, highlighting critical support and resistance.
High Risk Diamonds (💎): A critical risk management tool. These markers appear when conditions are ripe for a liquidation cascade. This is an explicit warning to take profits or stand aside.
The Dashboard (HUD)
Your at-a-glance command center, displaying real-time, mission-critical data:
Z-Scores for OI Flow Velocity & Acceleration: See the raw, normalized momentum of the institutional flow.
Crowd Sentiment Status: Instantly know if the market is dangerously "CROWDED" or balanced.
Liquidation Risk %: A numerical gauge from 0-100% showing the probability of a violent flush.
Live Data Status: Confirms whether the engine is using LIVE OI data or the PRO synthetic model.
Optimizer Readout: When enabled, shows the backtest results of your current settings.
█ THE COMMAND CENTER: MASTERING THE INPUTS
This suite offers deep customization for the professional trader.
Analysis Length: The "memory" of the flow engine. Use shorter lengths (10-14) for scalping and longer lengths (21+) for swing trading.
Signal Sensitivity: A master control to switch between Conservative (fewer, higher-quality signals), Normal (balanced), and Aggressive (more frequent signals for scalping) modes.
Display Toggles: Individually enable or disable any of the core components in the lower pane to create your perfect analytical view.
Overlay Controls: Individually toggle all on-chart visuals and control the maximum number of Zones and Key Levels to maintain a clean workspace.
█ THE OPTIMIZER ENGINE: VALIDATE BEFORE YOU TRADE
Confidence comes from data. The built-in Optimizer Engine is a powerful backtester that runs on your chart's visible data. It allows you to rapidly test different ATR-based Take Profit and Stop Loss parameters, providing key metrics like Win Rate, Profit Factor, and a proprietary Stability Rating ( ROBUST, STABLE, FRAGILE, OVERFIT ) to help you find the most statistically sound settings for your specific asset and timeframe before risking capital.
█ DEVELOPMENT PHILOSOPHY
This indicator was born from a single, guiding principle: to win in modern markets, you must stop listening to the noise of price and start analyzing the signal of flow. Price is where amateurs look; flow is where professionals find their edge. This tool is our attempt to level the playing field, translating the opaque world of derivatives and institutional positioning into a clear, intuitive, and actionable intelligence system.
This tool is for the serious student of the market—the trader who seeks to understand the "why" behind the move, not just the "what."
█ DISCLAIMER AND BEST PRACTICES
THIS IS AN ADVANCED ANALYTICAL TOOL: This indicator provides intelligence, not financial advice. It should be used as a core component of a comprehensive trading strategy that includes your own analysis of market structure and risk management.
RISK MANAGEMENT IS PARAMOUNT: All trading involves substantial risk. Never risk more capital than you are prepared to lose. This indicator does not guarantee profits.
SIGNAL HIERARCHY IS KEY: Treat the main BUY/SELL labels as your primary signals. Use the minor triangles to add to positions or for scalping. Use the High Risk diamonds as a signal to reduce exposure and take profits.
MULTI-TIMEFRAME ANALYSIS: For the highest probability setups, use the indicator on a higher timeframe (e.g., 1H) to establish an institutional bias, then take signals on a lower timeframe (e.g., 5m) that align with that bias.
"The game of speculation is the most uniformly fascinating game in the world. But it is not a game for the stupid, the mentally lazy, the person of inferior emotional balance, or the get-rich-quick adventurer. They will die poor."
— Jesse Livermore
Taking you to school. - Dskyz, Trade with Open Interest. Trade with Liquidity. Trade with Open Interest & Liquidation Flow
BTC - Standard of Living BenchmarkerOVERVIEW
Most traders track their wealth in USD or EUR — currencies that are structurally designed to lose value. This is a "Money Illusion." To understand if you are truly becoming wealthier, you must measure your Bitcoin not against fiat, but against the Standard of Living assets you eventually want to buy.
The Standard of Living Benchmarker is a macro-ratio engine that swaps the denominator of your chart. It answers the only question that matters for long-term wealth: "Is my Bitcoin stack gaining ground against the real world?"
THE "Stuff" BENCHMARKS
I have pre-selected four critical pillars of a high standard of living (that can be switched/cycled in the settings window):
• Gold: The historical baseline for "Hard Money" (TVC:GOLD).
• Equities: The primary engine of global productivity (S&P 500).
• Real Estate: Measured via the Vanguard Real Estate ETF (VNQ).
• Energy: The fundamental cost of human progress (Crude Oil).
THE CORE CALCULATION
The calculation is a simple, non-manipulated ratio:
• The Formula: Ratio = BTC_Price / Asset_Price
• This means: We are looking at the direct barter-rate between Bitcoin and the asset. For example, when the "Energy" mode is selected, the chart doesn't show dollars; it shows exactly how many Barrels of Oil one single Bitcoin can buy at today's close.
THE LIFESTYLE BASKET (The 5th Denominator)
Individual ratios tell you how Bitcoin is doing against one asset, but life isn't lived in a single asset. To solve this, I introduced the Lifestyle Basket .
What is a "Lifestyle Share"? A synthetic "Life Token" that represents a diversified slice of human prosperity. It is an equal-weighted basket consisting of:
• 25% Gold (Inflation Hedge)
• 25% S&P 500 (Global Growth)
• 25% Real Estate (Shelter)
• 25% Crude Oil (Energy/Consumption)
HOW TO READ THE CHART
• How to interpret the ratio: If the dashboard shows that 1 BTC buys 50 Lifestyle Shares , it means your Bitcoin stack has the purchasing power to acquire 50 equal units of the world's most critical assets.
• The Purchasing Power Line (Orange): When this line moves UP, Bitcoin is outperforming the real world. You are getting "wealthier" in a tangible sense. When it moves DOWN, your Bitcoin is losing purchasing power against that specific asset class.
• The Opportunity Zones: We plot a 200-day Mean with Standard Deviation bands.
• Upper Band (Red): Bitcoin is historically "Expensive" compared to the asset. This has historically been a high-probability zone to swap BTC for "Stuff" (Real Estate, Gold, etc.).
• Lower Band (Green): Bitcoin is "Cheap" compared to the asset. This is the zone where "Stuff" should be sold to acquire more Bitcoin.
WHY THIS IS "FRESH"
Unlike standard indicators that use RSI or MACD to find price momentum, this is a Macro-Audit . It ignores the noise of the US Dollar and focuses on the Ratio of Reality . It allows the "Infinite Hodler" to know when they are overextended in Bitcoin and when it is mathematically time to diversify into hard real-world assets.
DISCLAIMER
This script is for educational and macro-analytical purposes only. It does not constitute financial advice. Benchmarks are proxies for asset classes and may not reflect individual local prices (e.g., local real estate).
Tags: bitcoin, macro, gold, realestate, oil, benchmark, purchasing power, wealth, satoshi, Rob Maths, robmaths, Rob_Maths
Breadth Ratio📊 Breadth Ratio (NYSE & NASDAQ)
Breadth Ratio is a market internals indicator that displays real-time Up Volume vs Down Volume ratios for both the NYSE and NASDAQ, helping traders quickly gauge institutional participation and overall market strength.
Instead of plotting noisy lines, this indicator presents the data in a clear, color-coded table, making it ideal for intraday and swing traders who want instant context without cluttering their chart.
🔍 How It Works
Uses official Up Volume (UVOL) and Down Volume (DVOL) data
Calculates a signed ratio:
Positive values = bullish volume dominance
Negative values = bearish volume dominance
Displays NYSE and NASDAQ breadth side-by-side
Automatically updates on the last bar only for optimal performance
🟢 Color Logic
Green background → Bullish volume pressure (Up Volume > Down Volume)
Red background → Bearish volume pressure (Down Volume > Up Volume)
💡 How to Use It
Trend confirmation – Strong ratios support price direction
Reversal warnings – Weak or diverging breadth can precede turns
Risk management – Avoid longs when breadth is strongly negative (and vice versa)
Market context – Excellent companion to price action, VWAP, and index futures
⚙️ Features
✔ NYSE & NASDAQ volume breadth
✔ Clean table-based display
✔ No chart clutter
✔ Works on all timeframes
✔ Ideal for futures, indices, and ETFs
⚠️ Disclaimer
This indicator is for educational and informational purposes only. It should be used as confluence, not as a standalone trading signal.
Smart RSI Candles [DotGain]Smart RSI Candles – Description
Smart RSI Candles is a minimalist yet powerful overlay indicator that visualizes RSI conditions directly on price candles. Instead of plotting a separate RSI oscillator, this tool colors the chart bars based on customizable RSI threshold levels, allowing traders to instantly identify overbought and oversold regimes within the price action itself.
The indicator is built on the classic Wilder RSI and supports up to three upper (overbought) and three lower (oversold) levels. Each level can be individually enabled or disabled, making the indicator fully modular and adaptable to different trading styles and market conditions.
Key Features
RSI-based candle coloring (no separate panel required)
Up to 6 customizable RSI levels
Individual On/Off toggle for each level
Extreme conditions highlighted in blue
Works on any market and timeframe
Clean, non-intrusive visual design
Color Logic
Overbought (Upper Levels)
Level 1: Light green → mild overbought
Level 2: Dark green → strong overbought
Level 3: Blue → extreme overbought
Oversold (Lower Levels)
Level 1: Light red → mild oversold
Level 2: Dark red → strong oversold
Level 3: Blue → extreme oversold
Neutral RSI values keep the original candle color.
How to Use
Use upper levels to identify potential exhaustion in bullish moves.
Use lower levels to spot potential panic or capitulation zones.
Combine with trend analysis, support/resistance, or volume for confirmations.
Disable specific levels to create conservative or aggressive RSI regimes.
Use Cases
Mean reversion strategies
Momentum exhaustion detection
Visual risk regime mapping
Multi-timeframe RSI context
Smart RSI Candles is designed for traders who want RSI information integrated directly into price, without clutter — fast, intuitive, and highly customizable.
Have fun :)
Disclaimer
This Smart RSI Candles indicator is provided for informational and educational purposes only. It does not, and should not be construed as, financial, investment, or trading advice.
This indicator is an independent implementation of a Relative Strength Index (RSI) based visualization tool and is not affiliated with, or endorsed by, any third-party trading systems, strategies, or trademarked methodologies. The colored candles displayed by this indicator are generated by a predefined set of algorithmic conditions based on RSI threshold levels. They do not constitute a direct recommendation to buy or sell any financial instrument.
All trading and investing in financial markets involves a substantial risk of loss. You may lose part or all of your invested capital. Past performance does not guarantee future results. This indicator highlights potential overbought and oversold market conditions and may produce false, lagging, or misleading signals. Market conditions can change rapidly and remain irrational longer than expected.
The creator DotGain assumes no responsibility or liability for any financial losses, damages, or decisions made based on the use of this indicator or the information it provides.You are solely responsible for your own trading and investment decisions. Always conduct your own research (DYOR), use proper risk management, validate signals with additional tools or analysis, and consider your personal financial situation and risk tolerance before entering any trade.
laurent//@version=5
indicator("Big Candle + Squeeze Dots (ATR + RSI + MACD + BB)", overlay=true, timeframe="", timeframe_gaps=true)
//---------------------------
// Inputs
//---------------------------
lenATR = input.int(14, "Période ATR")
multATR = input.float(2.5, "Grosse bougie : range > ATR * X", step=0.1)
lenBodyMA = input.int(20, "Période moyenne de corps")
useBodyMA = input.bool(true, "Filtrer par corps > moyenne")
// RSI / MACD
lenRSI = input.int(14, "Période RSI")
rsiOB = input.float(60, "RSI haussier min")
rsiOS = input.float(40, "RSI baissier max")
fastMACD = input.int(12, "MACD fast")
slowMACD = input.int(26, "MACD slow")
sigMACD = input.int(9, "MACD signal")
// Squeeze Bollinger
bbLen = input.int(20, "Période Bollinger")
bbMult = input.float(2.0, "Ecart-type Bollinger", step=0.1)
squeezeLen = input.int(20, "Période moyenne largeur BB")
squeezeMult = input.float(0.7, "Seuil squeeze (largeur BB < moyenne * X)", step=0.05)
// Filtres
requireMomentum = input.bool(true, "Exiger RSI + MACD")
requireSqueeze = input.bool(true, "Exiger un squeeze juste avant")
squeezeLookback = input.int(5, "Nb de bougies max depuis squeeze", minval=1, maxval=50)
//---------------------------
// Calculs de base
//---------------------------
atr = ta.atr(lenATR)
rangeC = high - low
body = math.abs(close - open)
// moyenne de corps
bodyMA = ta.sma(body, lenBodyMA)
// RSI
rsi = ta.rsi(close, lenRSI)
// MACD
macdVal = ta.ema(close, fastMACD) - ta.ema(close, slowMACD)
macdSig = ta.ema(macdVal, sigMACD)
macdHist = macdVal - macdSig
//---------------------------
// Bollinger Bands + Squeeze
//---------------------------
basis = ta.sma(close, bbLen)
dev = bbMult * ta.stdev(close, bbLen)
upper = basis + dev
lower = basis - dev
bbWidth = (upper - lower) / basis
bbWidthMA = ta.sma(bbWidth, squeezeLen)
// squeeze = largeur BB inférieure à une fraction de sa moyenne
isSqueeze = bbWidth < bbWidthMA * squeezeMult
// Nombre de barres depuis le dernier squeeze
barsSinceSqueeze = ta.barssince(isSqueeze)
// Condition : on considère qu'on sort d'une zone de squeeze récente
hadRecentSqueeze = barsSinceSqueeze >= 0 and barsSinceSqueeze <= squeezeLookback
//---------------------------
// Conditions Wide Range Candle
//---------------------------
// 1) Bougie large vs ATR
wideByATR = rangeC > atr * multATR
// 2) Bougie large vs moyenne de corps (optionnel)
wideByBody = useBodyMA ? body > bodyMA : true
wideCandle = wideByATR and wideByBody
//---------------------------
// Direction + momentum
//---------------------------
bullBody = close > open
bearBody = close < open
bullMomentum = (rsi > rsiOB) and (macdHist > 0)
bearMomentum = (rsi < rsiOS) and (macdHist < 0)
condMomentumBull = requireMomentum ? bullMomentum : true
condMomentumBear = requireMomentum ? bearMomentum : true
condSqueeze = requireSqueeze ? hadRecentSqueeze : true
bullCond = wideCandle and bullBody and condMomentumBull and condSqueeze
bearCond = wideCandle and bearBody and condMomentumBear and condSqueeze
//---------------------------
// Affichage des points discrets
//---------------------------
// Petit point vert sous la bougie = grosse bougie haussière
plotshape(bullCond, title="Big Bull Candle (Squeeze + Mom.)", style=shape.circle,
location=location.belowbar, color=color.new(color.lime, 0), size=size.tiny)
// Petit point rouge au-dessus de la bougie = grosse bougie baissière
plotshape(bearCond, title="Big Bear Candle (Squeeze + Mom.)", style=shape.circle,
location=location.abovebar, color=color.red, size=size.tiny)






















