Mean Reversion Indicator — Buy the (DCA) Dip Signal (unbiased)Description
The Mean Reversion Signal — Buy the Dip (unbiased) indicator is designed to detect high-probability reversion points within Bitcoin’s cyclical market structure. These signals only appear when momentum has either fully reset on the Stochastic RSI (SRSI) or when a positive momentum reversal is beginning to form.
It combines 6H Relative Strength Index (RSI) data with 2-Week Stochastic RSI (SRSI) dynamics to identify exhaustion and early accumulation phases.
Core logic:
A buy signal appears when the 6H RSI closes below 30, indicating local oversold conditions.
The 2W Stochastic RSI confirms momentum alignment when both K & D are below 20 (deep oversold), above 80 (strong ongoing rally), or when K crosses above D (positive reversal).
The indicator is cycle-aware — active only after a defined date (e.g., 2023-01-01) to ensure it aligns with current market structure and avoids noise from pre-cycle conditions.
Additionally, green signals from previous bull cycles (e.g., 2015, 2019, 2020) are also displayed to highlight historically similar accumulation phases, allowing for cross-cycle comparison.
Color zones:
🟩 High probability of a durable new rally
🟧 Moderate probability zone
🔴 Momentum already extended; potential continuation but weaker signal
Recommended combinations:
For a deeper confirmation framework, this signal pairs well with:
- CoinGlass: Derivatives Risk Index Chart (to assess market (de)leveraging and derivatives pressure)
- BTC Futures Sentiment Index (Axel Adler Jr.) — (to monitor directional sentiment shifts)
- CheckonChain: Bitcoin — Short-Term Holder SOPR (to track realized profit-taking activity)
- CheckonChain: Bitcoin — Short-Term Holder MVRV (to evaluate valuation risk relative to cost basis)
Use case:
This tool helps traders identify favorable mean-reversion opportunities while considering broader cycle context and momentum structure.
It is not financial advice — best used alongside macro structure analysis, derivatives positioning, and on-chain behavior for comprehensive decision-making.
Forecasting
Geometric Price-Time Triangle Calculator═══════════════════════════════════════════════════
GEOMETRIC PRICE-TIME TRIANGLE CALCULATOR
═══════════════════════════════════════════════════
Calculates Point C of a geometric triangle using different rotation angles from any selected price swing. Based on Bradley F. Cowan's Price-Time Vector (PTV) methods from "Four-Dimensional Stock Market Structures and Cycles."
📐 WHAT IT DOES
────────────────────────────────────────────────────
Select two points (A and B) on any swing, choose an angle, and the indicator calculates where Point C would be mathematically. It's just vector rotation applied to price charts.
This shows you where Point C lands in both price AND time based on pure geometry - not a prediction, just a calculation.
🎯 FEATURES
────────────────────────────────────────────────────
✓ 10 Different Angles
• Gann ratios: 18.435° (1x3), 26.565° (1x2), 45° (1x1), 63.435° (2x1), 71.565° (3x1)
• Other angles: 30°, 60°, 90°, 120°, 150°
✓ Visual Triangle
• Adjustable colors and opacity for points A, B, C
• Line styles: Solid, Dashed, Dotted
• Extend lines: None, Left, Right, Both
✓ Crosshair at Point C
• Shows where Point C is located
• Vertical line = bar position
• Horizontal line = price level
✓ Data Table
• Shows all calculations
• Price-to-Bar ratio
• Point C location (price and bars from A/B)
• Toggle on/off
🔧 HOW TO USE
────────────────────────────────────────────────────
1. Pick your swing start date (Point A)
2. Pick your swing end date (Point B) - make sure these dates capture the actual high/low of your swing
3. Choose an angle from the dropdown
4. Look at Point C - that's where the geometry puts it
Different angles = different Point C locations. Whether price actually goes there is up to the market.
📊 THE ANGLES
────────────────────────────────────────────────────
- 18.435° (1x3) - Shallow rotation
- 26.565° (1x2) - Moderate rotation
- 45° (1x1) - Gann's balanced ratio
- 60° - Equilateral triangle (default)
- 63.435° (2x1) - Steeper rotation
- 71.565° (3x1) - Very steep rotation
- 90° - Right angle
- 120°-150° - Obtuse angles
💡 PRACTICAL USE
────────────────────────────────────────────────────
→ See where geometric patterns would complete
→ Test if your market respects certain angles
→ Find where multiple angles converge
→ Compare projected Point C to actual price action
→ Use 90° to see symmetrical price/time relationships
→ Backtest historical swings to see what worked
⚙️ HOW IT WORKS
────────────────────────────────────────────────────
1. Takes your AB swing
2. Calculates the BA vector (reverse direction)
3. Normalizes price and time using Price-to-Bar ratio
4. Rotates the vector by your selected angle
5. Converts back to chart coordinates
Basic trigonometry. That's all it is.
📚 BACKGROUND
────────────────────────────────────────────────────
Based on Bradley F. Cowan's Price-Time Vector (PTV) concept from "Four-Dimensional Stock Market Structures and Cycles" and W.D. Gann's geometric angle analysis. Cowan observed that markets sometimes complete geometric patterns. This tool calculates where those patterns would complete mathematically. Whether price actually respects these geometric relationships is something you need to test yourself.
⚠️ IMPORTANT
────────────────────────────────────────────────────
- This is geometric calculation, not prediction
- Point C shows where the math puts it, not where price will go
- Some angles might work for your market, some won't
- Test it yourself on historical data
- Price-to-Bar Ratio stays constant regardless of angle
- Don't trade based on this alone
- Works on all timeframes and assets
🎨 CUSTOMIZATION
────────────────────────────────────────────────────
- Show/hide triangle
- Individual colors for A, B, C points
- Adjust opacity (0-100)
- Line styles for each triangle side
- Extend lines left/right/both/none
- Show/hide data table
- Crosshair color and width
- Customizable table colors
═══════════════════════════════════════════════════
OSOM WV"OSOM WV", plots volume-weighted moving average (VWMA) bands with ATR offsets to identify bullish/bearish/neutral trends based on price position relative to the bands. It includes optional low-lag mode, visual styles (cloud, band, line), buy/sell crossover signals with non-pyramiding, take-profit via Z-score/RSI overbought/oversold, re-entry on wick touches, and a smoothed forecast of trend duration (displayed as a label like "↑ 3/8" for current/probable bars).
Multi-Sigma Bands [fmb]Multi-Sigma Bands
What It Is
Multi-Sigma Bands is a volatility-based statistical channel that visualizes how far price deviates from its long-term mean in standard deviation (σ) units. It offers a high-signal, low-noise view of trend strength, volatility regimes, and statistical extremes directly on price, keeping the chart clean and focused without any secondary pane.
What It Does
The indicator calculates a central basis line—using SMA, EMA, RMA, or Linear Regression—and surrounds it with multi-sigma envelopes, typically at ±1σ, ±2σ, and ±3σ. These bands represent the statistically expected ranges of price movement. The blue zone (±1σ) reflects normal volatility where roughly two-thirds of price activity occurs. The yellow zone (±2σ) captures moderate extensions that account for most of the remaining moves, while the red zone (±3σ) marks rare extremes that fall outside the 99% probability boundary. Each region is color-coded for immediate visual interpretation, allowing you to see at a glance when price is trading in calm, stretched, or extreme conditions.
Why It Was Built
Conventional Bollinger Bands tend to compress and expand too aggressively over short windows, making it difficult to read structural volatility changes. Multi-Sigma Bands addresses this by providing a longer statistical view. It helps distinguish mean reversion from sustained breakouts, quantifies trend acceleration or exhaustion, and highlights when markets move into statistically unusual zones that often precede reversals or volatility resets. It is particularly effective on monthly or weekly charts for assessing where a market sits within its long-term distribution. For instance, when the S&P 500 trades above +2σ for several months, risk-reward conditions often tighten.
How It Works
You can choose your preferred basis type—SMA, EMA, RMA, or Linear Regression—and decide whether to force monthly data even on lower timeframes for consistent macro analysis. Adjustable parameters include length, sigma multipliers, and standard deviation smoothing for fine-tuning sensitivity. The script automatically fills the space between the bands, creating a layered color map that clearly shows each volatility zone.
How To Use
When price remains above +1σ, it often confirms strong upside momentum. Consistent rejections at ±2σ or ±3σ zones can suggest exhaustion and potential mean reversion. Narrowing bands often precede volatility expansion, signaling that a breakout or trend change may be near. Multi-Sigma Bands can be used on its own for macro context or as an overlay with directional systems to refine entries and exits.
Credits
Created by Fullym0bile
Enhanced with leading trend detection logic.
www.fullymobile.ca
Low and Preceding High (Breakout + Bullis fgv + Extending Fib)🚀 Last Low & Preceding High: Bullish Reversal Strategy
This indicator identifies high-probability long setups by confirming a Bullish Market Structure Shift (BMS) coupled with a strong momentum filter.
🧠 Indicator Logic (How It Works)
The core function of this tool is to automatically locate the key structural points that lead to a bullish bias:
Structure Identification: It first defines a Range between the two most recent Pivot Lows. Within this range, it finds the Preceding High (the highest close before the current low) and the true Low Anchor (the lowest low/tail of the pivot low).
Breakout and Momentum Filter: A valid signal requires two conditions to be met on the current bar:
Bullish Breakout: The price must close above the Preceding High.
Marubozu Confirmation: A strong Bullish Marubozu candle (minimal wicks) must be present in the impulse move from the low, filtering for institutional strength.
Fibonacci Discount Zones: Upon confirmation, the indicator calculates and plots the discount zones (0.50, 0.618, 0.786) using the true extremes (tail-to-tail anchors). These zones start extending from the breakout candle and represent high-value areas for potential entries.
🎯 Entry and Risk Management
The strategy provides clear rules for execution once the logic is confirmed:
Entry Execution:
Wait for Retracement: Enter a Long position when the price retraces back into the colored Discount Zones (0.50 to 0.786).
Risk Control:
🛑 Stop Loss (SL): Placed below the Low Line (the swing low that initiated the move).
✅ Take Profit (TP): Placed above the High Line (the high that was broken).
Final note
"Special thanks to Mr. Mazen (@dr0chart) for developing this strategy."
Local Hurst Slope [Dynamic Regime]1. HOW THE INDICATOR WORKS (Math → Market Edge)Step
Math
Market Intuition
1. Log-Returns
r_t = log(P_t / P_{t-1})
Removes scale, makes series stationary
2. R/S per τ
R = max(cum_dev) - min(cum_dev)
S = stdev(segment)
Measures memory strength over window τ
3. H(τ) = log(R/S) / log(τ)
Di Matteo (2007)
H > 0.5 → Trend memory
H < 0.5 → Mean-reversion
4. Slope = dH/d(log τ)
Linear regression of H vs log(τ)
Slope > 0.12 → Trend accelerating
Slope < -0.08 → Reversion emerging
LEADING EDGE: The slope changes 3–20 bars BEFORE price confirms
→ You enter before the crowd, exit before the trap
Slope > +0.12 + Strong Trend = Bullish = Long
Slope +0.05 to +0.12 = Weak Trend = Cautious = Hold/Trail
Slope -0.05 to +0.05 = Random = No Edge
Slope-0.08 to -0.05 = Weak Reversion = Bearish setup = Prepare Short
Slope < -0.08 = Strong Reversion = Bearish= Short
PRO TIPS
Only trade in direction of 200-day SMA
Filters false signals
Avoid trading 3 days before/after earnings
Volatility kills edge
Use on ETFs (SPY, QQQ)
Cleaner than single stocks
Combine with RSI(14)
RSI < 30 + Hurst short = nuclear reversal
Liquidity Regime OscillatorThe Liquidity Signal Line is a macro-driven confirmation tool designed to capture the underlying global liquidity regime in a single, smoothed oscillator. It measures the combined directional flow of monetary and financial conditions using high-impact macro data: Federal Reserve assets (WALCL), Treasury General Account (TGA), and the Overnight Reverse Repo facility (RRP) – adjusted by key market proxies such as the U.S. Dollar Index, credit spreads (HYG/LQD), and equity risk appetite (SPHB/SPHQ). These components are normalized, weighted, and then double-smoothed into a stable signal that translates complex liquidity dynamics into a simple 0–100 scale.
Liquidity expansion provides fuel for risk assets, while contraction drains leverage and risk appetite. The Signal Line acts as a confirmation overlay for trend and allocation strategies, showing whether systemic liquidity is broadly supportive or restrictive. Readings above 50 indicate an expansionary environment (risk-on bias), below 50 a contractionary one (risk-off bias). Because the calculation uses higher-timeframe macro data, it can be displayed on any chart to give traders a consistent, regime-aware signal that bridges macro policy and technical execution.
Simulated Fear & Greed (CNN-calibrated v2)🧭 Fear & Greed Index — TradingView Version (Simulated CNN Model)
🔍 Purpose
The Fear & Greed Index is a sentiment indicator that quantifies market emotion on a scale from 0 to 100, where:
0 represents Extreme Fear (capitulation, oversold conditions), and
100 represents Extreme Greed (euphoria, overbought conditions).
It helps traders assess whether the market is driven by fear (risk aversion) or greed (risk appetite) — giving a high-level view of potential turning points in market sentiment.
⚙️ How It Works in TradingView
Because TradingView cannot directly access CNN’s or alternative external sentiment feeds, this indicator simulates the Fear & Greed Index by analyzing in-chart technical data that reflect investor psychology.
It uses a multi-factor model, converting price and volume signals into a composite sentiment score.
🧩 Components Used (Simulated Metrics)
Category Metric Emotional Interpretation
Volatility ATR (Average True Range) High ATR = Fear, Low ATR = Greed
Momentum RSI + MACD Histogram Rising momentum = Greed, Falling = Fear
Volume Activity Volume Z-Score High positive deviation = Greed, Low = Fear
Trend Context SMA Regime Bias (50/200) Downtrend adds Fear penalty, Uptrend supports Greed
These elements are normalized into a 0–100 scale using percentile ranks (like statistical scoring) and then combined using user-adjustable weights.
⚖️ CNN-Style Calibration
The script follows CNN’s five sentiment bands for clarity:
Range Zone Colour Description
0–25 Extreme Fear 🔴 Red Panic, forced selling, capitulation risk
25–45 Fear 🟠 Orange Uncertainty, hesitation, early accumulation phase
45–55 Neutral ⚪ Gray Balanced sentiment, indecision
55–75 Greed 🟢 Light Green Optimism, trend continuation
75–100 Extreme Greed 💚 Bright Green Euphoria, risk of reversal
This structure aligns visually with CNN’s public gauge, making it easy to interpret.
Earnings CountdownAdd to a chart to show a text box with how long to next earnings.
Being updated to add functionality from original open source Pine script
Roboquant RP Profits NY Open Retest StrategyRoboquant RP Profits NY Open Retest Strategy A good strategy for CL
Combined Signal + Auto Day Plan + Volume🧠 Combined Signal + Auto Day Plan + Volume
Version: Pine Script v5
Category: Strategy / Signal & Levels Tool
Author: (you can add your TradingView nickname)
📋 Overview
The Combined Signal + Auto Day Plan + Volume indicator merges multiple professional trading concepts into one visual tool — helping traders identify momentum shifts, entry zones, and daily trading plans with volume confirmation.
It automatically detects trend direction, generates dynamic take-profit & stop-loss levels, and overlays key daily reference points such as VWAP, pivot, support, and resistance zones based on ATR and trend context.
⚙️ Main Components
1️⃣ Signal System
Detects trend bias using SMA-based logic.
Generates entry price, TP1–TP3, and SL dynamically from recent impulse ranges.
Updates signals automatically when trend bias changes or previous targets are hit.
Visual levels are drawn directly on the chart.
2️⃣ Volume Analysis
Compares current volume against a moving average (SMA).
Classifies volume as:
🟢 Strong (above 1.5× average)
🟡 Average
🔴 Weak (below 0.8× average)
Displays the current volume strength and trend bias in an on-chart table.
3️⃣ Auto Day Plan
Uses multi-timeframe ATR calculations to define:
Support / Resistance zones
Pivot & Balance areas
Daily VWAP
Auto Targets (ATR-based expansion levels)
Adapts automatically to selected base timeframe (1H, 4H, or Daily).
4️⃣ Trend Context
Dual EMA system (50 & 200) to confirm bullish/bearish structure.
Aligns expected direction with VWAP & pivot location for context-aware bias.
🎯 What You Get on Chart
📈 Automatic LONG/SHORT signals
🎯 TP1, TP2, TP3, and SL levels
📊 Volume strength meter
🧭 VWAP, pivot, support/resistance & balance zones
🎨 Clean visual layout for intraday and swing traders
🧩 Inputs
Parameter Description
lenImpulse Impulse range length
smaLen SMA length for trend bias
levelRatio SL/TP ratio multiplier
volLen Volume SMA length
baseTF Base timeframe for zones/VWAP
atrMult1 / atrMult2 ATR multipliers for target levels
fwdBars Extension range for future projection
💡 How to Use
Add the script to your chart and choose your preferred timeframe.
Observe signal direction (📈 LONG / 📉 SHORT) and TP/SL levels.
Confirm entries when:
Trend aligns with VWAP direction, and
Volume category shows Strong or Average.
Use Auto Day Plan levels (pivot, balance, VWAP) as intraday reaction zones.
Volumatic VIDYA – Pro+1. Professional & Clear (recommended for TradingView)
Volumatic VIDYA Pro+ combines a dynamic VIDYA trend filter, Delta Volume pressure, and automatic pattern recognition (Double/Triple Tops & Bottoms, Head & Shoulders).
A complete technical tool for detecting momentum shifts, trend reversals, and trade entries across multiple timeframes.
2. Short & Catchy
Adaptive VIDYA trendline + Delta Volume + Pattern detection in one tool.
Instantly visualize market bias, structure, and momentum strength.
3. Educational / Analytical
Analyze market dynamics with VIDYA-based trend filtering, volume delta analysis, and automated pattern recognition.
Ideal for traders who combine price action with quantitative confirmation.
[KF] Multi-Duration Rate Expectations IndicatorAfter last fed cut in Oct then following jump in rates, I was frustrated at not having access to good rate expectations vs actual because the market usually prices in prior to fed action. This indicator was developed to make futures market rate expectations accessible and interpretable without requiring professional bond analytics systems.
Summary
This Pine Script indicator reveals what the futures market expects for interest rates across three key durations: Fed Funds (overnight), 2-Year, and 10-Year Treasury yields. By comparing futures-implied rates against current spot yields, it provides a clear visual signal of whether the market expects rates to rise, fall, or remain steady.
Understanding Rate Futures
Fed Funds futures (ZQ1!) use a simple design where the expected rate equals 100 minus the futures price. If ZQ1! trades at 96.12, the market expects a 3.88% Fed Funds rate. Treasury futures work differently - they trade as bond prices (typically 102-115) that move inversely to yields. Converting Treasury futures to implied yields requires complex bond mathematics involving duration and conversion factors.
This indicator solves the Treasury futures complexity by implementing a self-calibrating sensitivity model. It observes the historical relationship between futures prices and yields, then uses this to project rate expectations. The model also compares front-month to next-month contracts to detect expected rate direction, automatically adapting as market conditions change.
How to Use
Add the indicator to any chart and select your desired duration in the settings. The display shows the futures-implied rate, current yield, and the difference between them. Green indicates the market expects higher rates, red means lower expectations, and gray shows expectations in line with current rates.
The indicator excels at identifying divergences between market expectations and current rates, which often precede rate movements or futures repricing. Comparing expectations across different durations reveals insights about yield curve positioning and Fed policy anticipation.
Technical Note
While Fed Funds futures provide exact rate expectations, Treasury futures conversions are sophisticated approximations that provide reliable directional signals and reasonable magnitude estimates sufficient for most trading applications.
High and low statisticsHigh/Low Pattern Analyzer (All Timeframes)
Ever wonder if there's a hidden pattern in the market?
Does the high of the week usually happen on a Tuesday?
Does the low of the month always form in the first week?
Which 15-minute candle really sets the high for the entire day?
This indicator is a powerful statistical tool designed to answer these questions by analyzing historical price action to find patterns in when the high and low of a period are formed.
The Core Idea: Daily High & Low of the Week
The simplest and most popular feature of this indicator is the "Daily high and low of the week" analysis.
What it does:
It looks back over your chosen number of weeks (e.g., the last 100) and finds out which day of the week (Monday, Tuesday, Wednesday, etc.) made the final high and which day made the final low for each of those weeks.
How to use it:
Go to the script settings.
Enable the "Daily High/Low of the Week" module.
Set your chart to the 1D (Daily) timeframe.
A table will appear on your chart (bottom-right by default) showing the exact count and percentage for each day. This lets you see at a glance if there's a strong tendency for the market you're watching.
Advanced Analysis: Other Timeframes
This script goes far beyond just the daily chart. It includes four other independent analysis modules:
1. 4-Hour High/Low of the Week
What it does: For intraday and swing traders. This module finds which 4-hour candle session (e.g., the 08:00 candle, the 16:00 candle) tends to form the high or low of the entire week.
Key Feature (DST Aware): This table is "season-aware." It knows that the 08:00 "summertime" (DST) candle is the same trading session as the 07:00 "wintertime" (STD) candle. It groups them together so your data is never split or messy.
2. Weekly High/Low of the Month
What it does: For a monthly perspective. This module finds which week of the month (Week 1, 2, 3, 4, or 5) is most likely to form the monthly high or low.
How to use: Enable it and set your chart to the 1W (Weekly) timeframe.
3. Monthly High/Low of the Year
What it does: The ultimate "big picture" view. This module finds which month (Jan, Feb, Mar, etc.) most frequently forms the high or low for the entire year.
How to use: Enable it and set your chart to the 1M (Monthly) timeframe.
The Power User Module: Custom Timeframe Analysis
This is the most powerful feature. It lets you analyze any timeframe combination you want.
What it does: It finds out which "Lower Timeframe" (LTF) candle made the high or low of any "Higher Timeframe" (HTF) you choose.
Example: Do you want to know which 15-minute candle makes the Daily high?
Set your chart to the 15M timeframe.
Go to the "Custom Timeframe Analysis" settings.
Set the "Higher Timeframe" to "1D".
The script will draw a "season-aware" table (just like the 4H module) showing you the exact 15-minute candles (09:15, 09:30, etc.) that are statistically most likely to form the day's high or low.
Other Features
Show Labels: Each module has an option to "Show labels," which will draw a label (e.g., "Daily High of the Week") directly on the chart at the exact bar that made the high or low.
Custom Dividers: Each module has its own optional, color-customizable divider (e.g., weekly, monthly) that you can toggle on to see the periods more clearly.
Clean Settings: All modules are disabled by default (except for "Daily") to keep your chart clean. You only need to enable the specific analysis you want to see.
This tool was built to turn your curiosity about market patterns into actionable, statistical data. Enjoy!
VIX/VVIX Spike RiskVIX/VVIX Spike Risk Analyzer
The VIX/VVIX Spike Risk Analyzer analyzes historical VIX behavior under similar market conditions to forecast future VIX spike risk.
By combining current VIX and VVIX levels as dual filters, it identifies historical precedents and calculates the probability and magnitude of VIX spikes over the next 1, 5, and 10 trading days.
IMPORTANT: This indicator must be applied to the VIX chart (CBOE:VIX) to function correctly.
Methodology
1. Dual-Filter Pattern Matching
The indicator uses both VIX and VVIX as simultaneous filters to identify historically analogous market conditions:
By requiring BOTH metrics to match historical levels, the indicator creates more precise market condition filters than using VIX alone. This dual-filter approach significantly improves predictive accuracy because:
VIX alone might be at 15, but VVIX can tell us if that 15 is stable (low VVIX) or explosive (high VVIX)
High VVIX + Low VIX often precedes major spikes
Low VVIX + Low VIX suggests sustained calm
2. Tolerance Settings
VIX Matching (Default: ±10% Relative)
Uses relative percentage matching for consistency across different VIX regimes
Example: VIX at 15 matches 13.5-16.5 (±10%)
Can switch to absolute tolerance (±5 points) if preferred
VVIX Matching (Default: ±10 Points Absolute)
Uses absolute point matching as VVIX scales differently
Example: VVIX at 100 matches 90-110
Can switch to relative percentage if preferred
3. Historical Analysis Window
The indicator scans up to 500 bars backward (limited by VVIX data availability) to find all historical periods where both VIX and VVIX were at similar levels. Each match becomes a "sample" for statistical analysis.
4. Forward-Looking Spike Analysis
For each historical match, the indicator measures VIX behavior over the next 1, 5, and 10 days
Display Metrics Explained
Average Highest Spike
Shows the average of the maximum VIX spikes observed.
Highest Single Spike
Shows the single largest spike ever recorded
Probability No 10% Spike
Shows what percentage of historical cases stayed BELOW a 10% spike:
Probability No 20% Spike
Shows what percentage of historical cases stayed BELOW a 20% spike:
Note : You'll see many more shaded bars than the sample count because each match creates up to 5 consecutive shaded bars (bars 1-5 after the match all "look back" and see it).
Short Volatility Strategies:
Enter when there's a LOW probability of big vol spikes based on today's metrics
Long Volatility Strategies
Enter when there's a HIGH probability of big vol spikes based on today's metrics
Sector Analysis [SS]Introducing the most powerful sector analysis tool/indicator available, to date, in Pine!
This is a whopper indicator, so be sure to read carefully to ensure you understand its applications and uses!
First of all, because this is a whopper, let's go over the key functional points of the indicator.
The indicator compares the 11 main sector ETFs against whichever ticker you are looking at.
The functions include the following:
Ability to pull technicals from the sectors, such as RSI, Stochastic and Z-Score;
Ability to look at the correlation of the sector ETF to the current ticker you are looking at.
Ability to calculate the R2 value between the ticker you are looking at and each sector.
The ability to run a Two Tailed T-Test against the log returns of the Ticker of interest and the Sector (to analyze statistically significant returns between sectors/tickers).
The ability to analyze the distribution of returns across all sector ETFs.
The ability to pull buying and selling volume across all sector ETFs.
The ability to create an integrated moving average using a sector ETF to predict the expected close range of a ticker of interest.
These are the highlight functions. Below, I will go more into them, what they mean and how to use them.
Pulling Technicals
This is pretty straight forward. You can pull technicals, such as RSI, Stochastic and Z-Score from all the sector ETFs and view them in a table.
See below for the example:
Pulling Correlation
In order to see which sector your ticker of interest follows more closely, we need to look first at correlation and then at R2.
The correlation will look at the immediate relationship over a specified time. A highly positive value, indicates a strong, symbiotic relationship, which the sector and the ticker follow each other. This would be represented by a correlation of 0.8 or higher.
A strong negative correlation, such as -0.8 or lower, indicates that the sector and the ticker are completely opposite. When one goes up, the other goes down and vice versa.
You can adjust your correlation assessment length directly in the settings menu:
If you want to use a sector ETF to find the expected range for a ticker of interest, it is important to locate the highest, POSITIVE, correlation value. Here are the results for MSFT at a correlation lookback of 200:
In this example, we can see the best relationship is with the ETF XLK.
Analysis of R2
R2 is an important metric. It essentially measures how much of the variance between 2 tickers are explained by a simple, linear relationship.
A high R2 means that a huge degree of variance can be explained between the 2 tickers. A low R2 means that it cannot and that the 2 tickers are likely not integrated or closely related.
In general, if you want to use the sector ETF to find the mean and trading range and identify over-valuation/over-extension and under-extension statistically, you need to see both a high correlation and a high R-Squared. These 2 metrics should be analyzed together.
Let's take a look at MSFT:
Here, despite the correlation implying that XLK was the ticker we should use to analyze, when we look at the R Squared, we see actually, we should be using XLI.
XLI has a strong positive relationship with MSFT, albeit a bit less than XLK, but the R2 is solid, > 0.9, indicating the XLI explains much of MSFT's variance.
Two Tailed T-Test
A two tailed T-test analyzes whether there is a statistically significant difference between 2 different groups, or in our case, tickers.
The T-Test is conducted on the log returns of the ticker of interest and the sector. You then can see the P value results, whether it is significant or not. Let's look at MSFT again:
Looking at this, we can see there is no statistically significant difference in returns between MSFT and any of the sectors.
We can also see the SMA of the log returns for more detailed comparison.
If we were to observe a significant finding on the T-Test metrics, this would indicate that one sector either outperforms or underperforms your ticker to a statistically significant degree! If you stumble upon this, you would check the average log returns to compare against the average returns of your ticker of interest, to see whether there is better performance or worse performance from the sector ETF vs. your ticker of interest.
Analyzing the Distribution
The indicator will also analyze the distribution of returns.
This is an interesting option as it can help you ascertain risk. Normally distributed returns imply mean reverting behavviour. Deviations from that imply trending behaviour with higher risk expectancy. If we look at the distribution statistics currently over the last 200 trading days, here are the results:
Here, we can see all show signs of trending, as none of the returns are normally distributed. The highest risk sectors are XLK and XLY.
Why are they the highest risk?
Because the indicator has found a heavy right tailed distribution, indicated sudden and erratic mean reversion/losses are possible.
Creating an MA
Now for the big bonus of the indicator!
The indicator can actually create a regression based range from closely correlated sectors, so you can see, in sectors that are strongly correlated to your ticker, whether your ticker is over-bought, oversold or has mean reverted.
Let's look at MSFT using XLI, our previously identified sector with a high correlation and high R2 value:
The results are pretty impressive.
You can see that MSFT has rode the mean of the sector on the daily timeframe for quite some time. Each time it over extended itself above the sector implied range, it mean reverted.
Currently, if you were to trade based on Pairs or statistics, MSFT is no trade as it is currently trading at its sector mean.
If you are a visual person, you can have the indicator plot the mean reversion points directly:
Green represents a bullish mean reversion and red a bearish mean reversion.
Concluding Remarks
If you like pair trading, following the link between sectors and tickers or want a more objective way to determine whether a ticker is over-bought or oversold, this indicator can help you.
In addition to doing this, the indicator can provide risk insights into different sectors by looking at the distribution, as well as identify under-performing sectors or tickers.
It can also shed light on sectors that may be technically over-bought or oversold by looking at Z-Score, stochastics and RSI.
Its a whopper and I really hope you find it helpful and useful!
Thanks everyone for reading and checking this out!
Safe trades!
Mum Formasyonları TespitiIt is used to detect candles.
It is designed to analyze all the candles that form.
The most frequently formed candles are displayed on the price chart.
Gann Astronomical Turning PointsThis is a comprehensive Pine Script that implements W.D. Gann's astronomical theories to identify potential market turning points. Here's a detailed breakdown of the script:
Overview
The script identifies and displays astronomical events (sun angles, moon phases, and Mercury retrogrades) that Gann theorists believe correlate with market turning points. It also analyzes historical price performance following these events to provide statistical significance.
Key Components
1. Input Parameters
Date Range: Users can set the analysis period (start and end dates)
Display Options: Toggle visibility of different astronomical events and tables
Analysis Settings: Configure the lookback period for price change analysis (1-20 days)
2. Astronomical Calculations
The script includes several functions to calculate celestial positions:
getDaysSinceEpoch(t): Calculates days since January 1, 2000 (reference point)
getSunLongitude(t): Computes the Sun's position in the ecliptic (0-360°)
getMoonPhase(t): Determines the Moon's phase angle relative to the Sun
getMercuryLongitude(t): Calculates Mercury's position in the ecliptic
3. Gann Critical Angles (Sun Events)
The script identifies when the Sun reaches four critical angles that Gann considered significant:
0° Aries (Spring Equinox)
90° Cancer (Summer Solstice)
180° Libra (Fall Equinox)
270° Capricorn (Winter Solstice)
These are detected by tracking when the Sun's longitude crosses these specific angles.
4. Moon Phases
Four key moon phases are identified:
New Moon: Moon passes between Earth and Sun
First Quarter: Moon is 90° east of Sun
Full Moon: Moon is opposite the Sun
Last Quarter: Moon is 270° east of Sun
5. Mercury Retrograde Periods
The script detects when Mercury appears to move backward in its orbit:
Identifies start and end dates of retrograde motion
Displays these periods as highlighted zones on the chart
6. Price Change Analysis
For each astronomical event, the script:
Calculates the percentage price change over a user-defined lookback period
Categorizes changes as positive or negative
Stores this data for statistical analysis
7. Statistical Significance
The script calculates several metrics for each event type:
Average Price Change: Mean percentage change following events
Up/Down Ratio: Number of positive vs. negative changes
Accuracy Percentage: How often the dominant direction occurred
8. Visual Elements
The script includes multiple display components:
Event Labels
Sun Angles: Orange sun symbols displayed above price bars
Moon Phases: Moon phase emojis displayed below price bars
Mercury Retrograde: Red boxes highlighting the retrograde periods
Information Tables
Events Table: Shows upcoming and recent astronomical events
Significance Analysis Table: Displays statistical performance of each event type
Forecast Section: Identifies the next upcoming event and predicted direction
9. Forecasting Functionality
The script predicts market direction for the next astronomical event based on:
Historical average price change for that event type
Statistical accuracy of previous similar events
Color-coded forecast (green for bullish, red for bearish)
This script offers an interesting implementation of Gann's astronomical theories, but should be used as part of a broader analysis rather than as a standalone trading system.
Disclaimer: This indicator is for educational purposes only. Past performance does not guarantee future results. Always conduct your own research and risk assessment before trading.
VIX Regime AnalyzerVIX Regime Analyzer
The VIX Regime Analyzer is an analytical tool that examines historical VIX patterns to provide insights into how your asset typically performs under similar volatility conditions.
Key Features:
Historical Pattern Matching: Automatically scans up to 1,000 bars of history to find all periods when VIX was at levels similar to today, using customizable tolerance ranges (absolute or percentage-based).
Forward-Looking Statistics: For each VIX regime match, calculates what actually happened to your asset over the next 1, 5, 10, and 20 trading days, providing both average returns and probability of positive outcomes.
Regime Classification System: Intelligently categorizes the current market environment as bullish or bearish: Visual Historical Context:
Background shading throughout your chart highlights every historical period when VIX matched current levels, color-coded by subsequent performance (green for gains, red for losses).
User Inputs:
VIX Level Tolerance (+/-): How closely VIX must match (default: ±5 points)
Use Relative Tolerance (%): Switch to percentage-based matching for consistency across different VIX levels
Lookback Period: How many bars to analyze
Highlight Historical VIX Matches: Toggle background highlighting of past matching periods
The Data Table
The statistics box appears in the right handside of your chart and contains three main sections:
Section 1: VIX REGIME
Current VIX: The live VIX closing price
Range: The tolerance band being searched (e.g., if VIX is 18 with ±5 tolerance, range is 13-23)
Historical Samples: Number of matching periods found in the lookback window (minimum 10 required for statistical validity)
Section 2: FORWARD RETURN
Shows the average percentage change in your asset over different timeframes following similar VIX levels:
Avg Next Day: What typically happened by the next trading session
Avg Next 5 Days: Average 5-day forward performance
Avg Next 10 Days: Average 10-day forward performance
Avg Next 20 Days: Average 20-day forward performance (approximately 1 month)
Section 3: PROBABILITY UP
Shows the win rate - the percentage of times your asset closed higher after VIX matched current levels:
Next Day: Probability of being up the next session
Next 5 Days: Probability of being up after 5 days
Next 10 Days: Probability of being up after 10 days
Next 20 Days: Probability of being up after 20 days
Colors:
🟢 Green: Bullish regimes (various strengths)
🔴 Red: Bearish regimes (various strengths)
🟡 Yellow: Choppy/uncertain regime
When "Highlight Historical VIX Matches" is enabled:
Scroll back through your chart and you'll see colored backgrounds highlighting every period when VIX matched today's level. The color tells you whether that match led to gains (green) or losses (red). This provides instant visual pattern recognition - you can quickly see if similar VIX levels historically led to bullish or bearish outcomes.
Practical Example:
If you see that most historical periods with similar VIX levels are highlighted in green, it suggests the current VIX level has historically been a bullish signal for your asset.
How The Indicator Makes Decisions
The regime classification uses both magnitude AND probability to avoid false signals:
Example of Strong Classification:
Average 5-day return: +1.5%
Win rate: 65%
Result: STRONG BULLISH (both high return and high probability)
Example of Weak Signal:
Average 5-day return: +2.0%
Win rate: 35%
Result: CHOPPY (high average but low consistency = unreliable)
This dual-factor approach ensures the indicator doesn't mislead you with regimes that had a few huge winners but mostly losers, or vice versa.
Best Practices
Combine with your existing strategy: Use this as a regime filter rather than standalone signals
Check sample size: More historical matches = more reliable statistics
Consider multiple timeframes: If 5-day and 20-day metrics disagree, proceed with caution
Asset-specific tuning: Different assets may require different tolerance settings
VIX spikes: The indicator is particularly useful during VIX spikes to understand if panic is justified
What Makes This Different
Unlike simple VIX indicators that just plot the fear index, this tool:
Quantifies the actual impact of VIX levels on YOUR specific asset
Provides probability-based forecasts rather than subjective interpretation
Shows historical context visually so you can see patterns at a glance
Uses rigorous statistical criteria to avoid false regime classifications
Trailing 12M % Gain/Lossthis script shows profit or loss for training 12 months, works only on daily time frame






















