Trend Volatility Index (TVI)Trend Volatility Index (TVI)
A robust nonparametric oscillator for structural trend volatility detection
⸻
What is this?
TVI is a volatility oscillator designed to measure the strength and emergence of price trends using nonparametric statistics.
It calculates a U-statistic based on the Gini mean difference across multiple simple moving averages.
This allows for objective, robust, and unbiased quantification of trend volatility in tick-scale values.
⸻
What can it do?
• Quantify trend strength as a continuous value aligned with tick price scale
• Detect trend breakouts and volatility expansions
• Identify range-bound market states
• Detect early signs of new trends with minimal lag
⸻
What can’t it do?
• Predict future price levels
• Predict trend direction before confirmation
⸻
How it works
TVI computes a nonparametric dispersion metric (Gini mean difference) from multiple SMAs of different lengths.
As this metric shares the same dimension as price ticks, it can be directly interpreted on the chart as a volatility gauge.
The output is plotted using candlestick-style charts to enhance visibility of change rate and trend behavior.
⸻
Disclaimer
TVI does not predict price. It is a structural indicator designed to support discretionary judgment.
Trading carries inherent risk, and this tool does not guarantee profitability. Use at your own discretion.
⸻
Innovation
This indicator introduces a novel approach to trend volatility by applying U-statistics over time series
to produce a nonparametric, unbiased, and robust estimate of structural volatility.
日本語要約
Trend Volatility Index (TVI) は、ノンパラメトリックなU統計量(Gini平均差)を使ってトレンドの強度を客観的に測定することを目的に開発されたボラティリティ・オシレーターです。
ティック単位で連続的に変化し、トレンドのブレイク・レンジ・初動の予兆を定量的に検出します。
未来の価格や方向は予測せず、現在の構造的ばらつきだけをロバストに評価します。
Indicators and strategies
Impulse Candle Detector with MA RibbonIndicator Overview
The Impulse Candle Detector with MA Ribbon highlights “impulsive” candles—those with unusually large range, volume and body proportion—by coloring them blue (bullish) or orange (bearish) and firing an alert when they complete. In addition, it plots up to four moving averages on any chosen timeframe, with full control over type, length, source and color.
What It Does
Impulse Candle Detection
A candle is marked impulsive only when all three conditions are met:
Range exceeds the n-bar SMA of true-range multiplied by a size factor.
Volume exceeds the n-bar SMA of volume multiplied by a volume factor.
Body size (|close – open|) is at least a specified fraction of the candle’s total high-low range.
MA Ribbon
Four independent moving averages can be plotted, each optionally fetched from a different timeframe. You choose the MA type (SMA, EMA, SMMA/RMA, WMA or VWMA), the calculation source (open, high, low, close or custom), the length in periods, and the line color.
Typical Use Cases
Traders can use the impulse candle signal to spot strong momentum surges or reversal traps. Overlaying these signals on an MA ribbon gives trend context: impulsive candles aligned with the ribbon direction suggest continuation, while impulsive candles against the ribbon warn of counter-trend exhaustion. Alerts automate detection so you never miss a key move.
Inputs and Defaults
Impulse Candles Group
You’ll find four inputs under “Impulse Candles.”
Length for Average Calculation (integer, default 10): bars used to compute the SMA of true-range and volume.
Size Multiplier (float, default 1.5): threshold factor for range vs. average range.
Volume Multiplier (float, default 1.5): threshold factor for volume vs. average volume.
Body-to-Wick Ratio (float, default 0.7): minimum candle-body fraction of total range.
Moving Averages Group
There is one timeframe input and then settings for MA #1 through MA #4. Each MA has five properties.
Set MA Timeframe (timeframe, default blank): timeframe to fetch the MAs; leave blank to use the chart’s timeframe.
For each MA #X: Show (true/false), Type (SMA, EMA, SMMA/RMA, WMA, VWMA), Source (price series), Length (integer ≥ 1)
Color (hex code)
Alert Configuration
When all three impulsive-candle conditions are true on the prior bar, an alert named “Impulsive Candle” fires with the message “Impulsive candle detected.”
How to Use
Copy the script into TradingView’s Pine Editor, save and add it to your chart.
Under Impulse Candles, adjust length and multipliers to match your asset’s volatility.
Under Moving Averages, set your desired timeframe (if different), then toggle and customize each MA line.
Create an alert on the indicator, selecting the built-in Impulsive Candle condition to get notified whenever a qualifying candle closes.
Disclaimer
This indicator is provided for educational purposes only and does not constitute financial advice or a guaranteed strategy. Trading involves substantial risk and may result in significant losses; past performance does not guarantee future results. Always conduct your own research and consider seeking advice from a qualified financial professional before making any trading decisions.
Real Vision Global M2 (Lag)Global Liquidity for our ARC Students. This indicator lags by about 12 weeks, so make sure to apply that to your charts. Successful trading your bitcoins
Opening Range Retest█ OVERVIEW
This indicator shows the opening range as a box. It also draws markers and triggers alerts when the opening range is retested. The opening range time is configurable, as is the period of time that must elapse before each return to the opening range is considered a retest.
█ FEATURES
Opening range time configurable in bars or minutes
Configurable "resting" period between the end of the opening range or since the last retest before a new retest is considered valid
Configurable tolerance so that a retest can trigger sooner
Active time range can be used to filter alerts and markers to a specific time window
Visual box showing the opening range, which can be optionally limited to the above-mentioned active time window
Well-documented, high-quality, open-source code for those interested
█ CONCEPTS
This indicator can be used for an opening range retest trading strategy, where long or short positions are taken on the retest of the opening range.
The opening range can be user-configured, so it is suitable for use with any opening range time period (e.g., 1-min, 5-min, 15-min, etc.).
The markers and alerts are equivalent, in the sense that whenever a marker appears, an alert will also trigger (assuming the user has set an alert up).
The alert active time range is simply used as a filter for markers and alerts, meaning that these will not draw or trigger outside of the specified time range.
█ LIMITATIONS
The indicator is intended for equities that have a highly active regular market open. For other security types, it will draw the opening range box from whenever TradingView specifies the market open time.
VWAP Adaptive (RelVol-Adjusted)This indicator provides an Adaptive VWAP that adjusts volume weighting using RelVol (Relative Volume at Time), offering a more accurate and context-aware price reference during sessions with irregular volume behavior.
Classic VWAP calculates the average price weighted by raw volume, without considering the time of day. This becomes a serious limitation during major market events such as CPI releases, FOMC announcements, NFP, or large-cap earnings. These events often trigger massive volume spikes within one or two candles. As a result, the classic VWAP gets pulled toward those extreme prices and becomes permanently skewed for the rest of the session.
In such conditions, classic VWAP becomes unreliable. It no longer reflects fair value and often misleads traders relying on it for dynamic support, resistance, or reversion signals.
This Adaptive VWAP improves on that by using RelVol, which compares the current volume to the average volume seen at the same time over previous sessions. It gives more weight to price when volume is typical for that moment, and adjusts the influence when volume is statistically abnormal. This reduces the impact of isolated volume spikes and stabilizes the VWAP path, even in high-volatility environments.
For example, on SPY 1-minute or 5-minute charts during a CPI release, a massive spike in volume and price can occur within a single candle. Classic VWAP will immediately anchor itself to that spike. Adaptive VWAP using RelVol softens that effect and maintains a more realistic trajectory.
Key features:
- Adaptive VWAP weighted by time-adjusted Relative Volume (RelVol)
- Designed to maintain VWAP reliability during macroeconomic events
- Flexible anchoring: Session, Week, Month, Quarter, Earnings, etc.
- Optional display of Classic VWAP for comparison
- Up to 3 customizable deviation bands (standard deviation or percentage)
This tool is ideal for intraday traders who need a VWAP that remains usable and unbiased, even in volatile sessions. It adds robustness to VWAP-based strategies by incorporating time-sensitive volume normalization.
Dynamic Candle rating by Nikhil DoshiThis custom TradingView indicator assigns a rating from 1 to 5 to each candlestick on the chart based on the relative position of the close within its high-low range. It provides an at-a-glance visual assessment of candle strength or weakness, which can be useful for gauging intrabar sentiment.
Label colors provide intuitive visual cues:
🟩 1 (Green) – Strong bullish
🟢 2 (Lime) – Mild bullish
⚪ 3 (Gray) – Neutral
🟠 4 (Orange) – Mild bearish
🔴 5 (Red) – Strong bearish
(Decode) Moving Average Toolkit(Decode) Moving Average Toolkit: Your All-in-One MA Analysis Powerhouse
The Decode MAT is a comprehensive TradingView indicator designed to give you deep insights into market trends and potential trading signals using a versatile set of moving averages (MAs) and related tools. It's built for traders who want flexibility and a clear visual representation of MA-based strategies.
Here’s a breakdown of its key features and how you might use them in your trading:
1. Extensive Moving Average Options (5 EMAs & 5 SMAs)
What it is: The toolkit provides you with ten moving averages in total:
- Five Exponential Moving Averages (EMAs)
- Five Simple Moving Averages (SMAs)
Customization: You can set the length (period) for each of these ten MAs independently. This means you can track very short-term price action, long-term trends, and anything in between, all on one chart.
Visibility Control: Each MA line can be individually turned on or off directly from the "Inputs" tab using its "Show EMA X" or "Show SMA X" checkbox. This keeps your chart clean and focused. The color and line width for each MA are pre-defined in the script (EMAs are blueish with transparency, SMAs are solid with corresponding colors) but can be further customized in the "Style" tab of the indicator settings.
Defaults: EMA 1 (10-period) and EMA 2 (20-period) are visible by default. SMA 3 (50-period) and SMA 5 (200-period) are also visible by default. Other MAs are off by default.
Trading Ideas:
Trend Identification: Use longer-term MAs (e.g., 50, 100, 200-period SMA or EMA) to identify the overall market direction. Price above these MAs generally suggests an uptrend; price below suggests a downtrend.
Dynamic Support & Resistance: MAs can act as dynamic levels of support in an uptrend or resistance in a downtrend. Watch for price bouncing off these MAs.
Multi-Timeframe Feel: By plotting MAs of different lengths (e.g., a 20-period for short-term and a 200-period for long-term), you can get a sense of how different market participants might be viewing the trend.
2. EMA/SMA Ribbons (5 Hardcoded Pairs)
What it is: The indicator can display up to five "ribbons." Each ribbon is hardcoded to visually fill the space between a specific EMA and its numerically corresponding SMA:
- Ribbon 1: EMA 1 / SMA 1
- Ribbon 2: EMA 2 / SMA 2
- Ribbon 3: EMA 3 / SMA 3
- Ribbon 4: EMA 4 / SMA 4
- Ribbon 5: EMA 5 / SMA 5
Enable/Disable: Each of these five ribbons can be individually turned on or off from the "Inputs" tab using its "Show Ribbon EMAX/SMAX" checkbox. A ribbon will appear if its toggle is checked, regardless of whether its constituent MA lines are currently visible (the fill uses the underlying plot data).
Defaults: Ribbon 3 (EMA3/SMA3) is visible by default. Other ribbons are off by default.
Color-Coded Insights:
Green Ribbon: Appears when the EMA is above its corresponding SMA, often indicating bullish momentum or an uptrend for that pair.
Red Ribbon: Appears when the EMA is below its corresponding SMA, often indicating bearish momentum or a downtrend for that pair.
Trading Ideas:
Trend Strength & Confirmation: A widening ribbon can suggest increasing trend strength. A ribbon consistently staying one color (e.g., green) reinforces the current trend.
Entry/Exit Signals: Some traders look for the ribbon to change color as a potential signal. For example, a change from red to green might be a bullish entry signal, while green to red might be bearish.
Visualizing Momentum: The ribbons provide an immediate visual cue of the relationship between the faster-reacting EMA and the smoother SMA for standard MA pairings.
3. Configurable Crossover Alerts & On-Chart Symbols (Up to 5 Alerts)
What it is: This is a powerful feature for signal generation. You can set up to five independent crossover alert conditions.
Flexible MA Selection for Alerts: For each of the five alerts, you can choose any two moving averages from the ten available (5 EMAs, 5 SMAs) to act as your "Fast MA" and "Slow MA."
On-Chart Visual Symbols:
When a configured "Fast MA" crosses above the "Slow MA" (a bullish crossover), a green upward triangle (▲) can be plotted below the price bar.
When a configured "Fast MA" crosses below the "Slow MA" (a bearish crossover), a red downward triangle (▼) can be plotted above the price bar.
A symbol will only appear if: 1) The main "Enable Alert X" checkbox is active, 2) The crossover condition is met, AND 3) The "Show Symbols for Alert X" checkbox is active.
Defaults: Alert 1 (EMA 1 / EMA 2 cross) is enabled with symbols on. Alert 5 (SMA 3 / SMA 5 cross) is enabled with symbols on. Alerts 2, 3, and 4 are disabled by default.
TradingView Alert Integration: The script defines these crossover conditions. You can then go into TradingView's alert manager, select this indicator, and choose a specific condition (e.g., "Alert 1 Bullish Cross") to receive notifications.
Trading Ideas:
Classic & Custom Crossover Signals: Set up alerts for well-known patterns like the Golden/Death Cross, or create alerts for crossovers between any MAs relevant to your strategy.
Entry/Exit Triggers: Use crossover alerts as potential entry or exit signals.
Multi-Condition Confirmation: Combine alert signals with the visual information from the ribbons and overall MA structure.
4. General Customization
Price Source: You can choose what price data the moving averages are calculated from (e.g., Close, Open, High, Low, (H+L)/2, etc.).
Overall Trading Strategies & Benefits
The (Decode) Moving Average Toolkit is designed for versatility:
Trend Following: Use long-term MAs for trend direction, and shorter-term MA crossovers (with alerts) or ribbon changes for entries in the direction of that trend.
Swing Trading: Identify swings using medium-term MAs and look for pullbacks or crossovers as entry points, confirmed by ribbon behavior.
Momentum Confirmation: Gauge trend strength using the relationship between multiple MAs, visualized through the ribbons.
Focused Charting: Toggle the visibility of individual MAs and ribbons to keep your chart relevant to your current analysis.
Automated Scanning (via Alerts): Set up alerts for your preferred crossover conditions across multiple instruments and let TradingView notify you.
[Saya] VWAP Range Bands VWAP Range Bands is a custom volatility-based indicator that visualizes dynamic support and resistance zones using a volume-weighted average price (VWAP) combined with adaptive deviation bands.
🔍 Features:
• VWAP-based midline for mean reversion insight
• Dynamic upper and lower bands based on average deviation or standard deviation
• Visual highlights when price crosses extreme zones
• Optional deviation count table to monitor how often price breaks out
Great for identifying high-probability reversal or continuation areas in both trending and ranging markets.
Trading Time Highlighter v2Check boxes for days of week.
Set the time you want to trade or backtest.
Adjust for UTC time.
GM
Dynamic Candle rating by Nikhil DoshiThis custom TradingView indicator assigns a rating from 1 to 5 to each candlestick on the chart based on the relative position of the close within its high-low range. It provides an at-a-glance visual assessment of candle strength or weakness, which can be useful for gauging intrabar sentiment.
Label colors provide intuitive visual cues:
🟩 1 (Green) – Strong bullish
🟢 2 (Lime) – Mild bullish
⚪ 3 (Gray) – Neutral
🟠 4 (Orange) – Mild bearish
🔴 5 (Red) – Strong bearish
FX Majors (+CN) Currency Basket ComparisonDescription:
This indicator shows how individual FX major currencies (including CNY) have performed relative to each other. It calculates each currency's performance against a "Trade Weighted" basket of other major currencies.
I created this because I couldn't find it, and I wanted an easy way to see currency behaviour and flows.
Purpose:
It lets you see the relative strength and weakness of each currency, similar to how the DXY measures USD strength, but for all the major currencies. Each basket and currency weights are based on Trade Weighted values from literature/economics.
This way you can maybe decide which crosses / pairs to trade.
Can helps you visualise how events (economic, news or otherwise) affect currency flows.
Features:
Relative Performance: Focuses on how a currency's value has changed over time, rather than its absolute level.
Normalization: Adjusts currency values to a starting date, making it easy to compare their performance.
Adjustable Start Date: You can set the anchor date to choose the starting point for calculating relative performance.
Customizable Weights: The indicator allows you to use custom weights for each currency basket should you wish.
Candle Rating (1–5)This custom TradingView indicator assigns a rating from 1 to 5 to each candlestick on the chart based on the relative position of the close within its high-low range. It provides an at-a-glance visual assessment of candle strength or weakness, which can be useful for gauging intrabar sentiment.
Plotting the Rating
The rating value is displayed above each candle using a label.
Label colors provide intuitive visual cues:
🟩 1 (Green) – Strong bullish
🟢 2 (Lime) – Mild bullish
⚪ 3 (Gray) – Neutral
🟠 4 (Orange) – Mild bearish
🔴 5 (Red) – Strong bearish
Retail Pain Index (RPIx) (RPIx) Retail Pain Index (DAFE)
See the Market’s Pain. Trade the Edge.
The Retail Pain Index (RPIx) is a next-generation volatility and sentiment tool designed to reveal the hidden moments when retail traders are most likely being squeezed, stopped out, or forced to capitulate. This is not just another oscillator—it’s a behavioral market scanner that quantifies “pain” as price rips away from the average entry zone, often marking the fuel for the next big move.
Why is RPIx so Unique?
Behavioral Volatility Engine:
RPIx doesn’t just track price or volume. It measures how far price is moving away from where the crowd has recently entered (using a rolling VWAP average), then normalizes this “distance” into a Z-score. The result? You see when the market is inflicting maximum pain on the most participants.
Dynamic, Intuitive Coloring:
The main RPIx line is purple in normal conditions, but instantly turns red when pain is extreme to the upside (+2.00 or higher) and green when pain is extreme to the downside (-2.00 or lower). This makes it visually obvious when the market is entering a “max pain” regime.
Threshold Lines for Clarity:
Dashed red and green lines at +2.00 and -2.00 Z-score levels make it easy to spot rare, high-pain events at a glance.
Signature Dashboard & Info Line:
Dashboard: A compact, toggleable panel in the top right of the indicator pane shows the current Z-score, threshold, and status—perfect for desktop users who want a quick read on market stress.
Info Line: For mobile or minimalist traders, a single-line info label gives you the essentials without cluttering your screen.
Inputs & Customization
Entry Cluster Lookback: Adjusts how many bars are used to calculate the “entry zone” (VWAP average). A higher value smooths the signal, a lower value makes it more responsive.
Pain Z-Score Threshold:
Sets the sensitivity for what counts as “extreme pain.” Default is ±2.00, but you can fine-tune this to match your asset’s volatility or your own risk appetite.
Show Dashboard / Show Compact Info Label:
Toggle these features on or off to fit your workflow and screen size.
How to utilize RPIx's awesomeness:
Extreme Readings = Opportunity:
When RPIx spikes above +2.00 (red) or below -2.00 (green), the market is likely running stops, liquidating weak hands, or forcing retail traders to capitulate. These moments often precede sharp reversals, trend accelerations, or volatility expansions.
Combine with Price Action:
Use RPIx as a confirmation tool for your existing strategy, or as a standalone alert for “pain points” where the crowd is most vulnerable.
Visual Edge:
The color-coded line and threshold levels make it easy to spot regime shifts and rare events—no more squinting at numbers or guessing when the market is about to snap.
Why RPIx?
Works on Any Asset, Any Timeframe:
Stocks, futures, crypto, forex—if there’s a crowd, there’s pain, and RPIx will find it.
Behavioral Alpha:
Most indicators lag. RPIx quantifies the psychological stress in the market, giving you a real-time edge over the herd.
Customizable, Clean, and Powerful:
Designed for both power users and mobile traders, with toggles for every workflow.
See the pain. Trade the edge.
Retail Pain Index: Because the market’s next move is written in the crowd’s discomfort.
For educational purposes only. Not financial advice. Always use proper risk management
Use with discipline. Trade your edge.
— Dskyz , for DAFE Trading Systems, for DAFE Trading Systems
COT NET SHG"This indicator evaluates market participants’ positioning through composite calculations based on the COT (Commitments of Traders) report from the CME. It aims to identify significant imbalances between buyers and sellers by highlighting moments when major market players concentrate unusually large volumes of contracts in either the long or short direction."
Stop Cascade Detector Stop Cascade Detector (DAFE)
Unlock the Hidden Triggers of Market Momentum!
The Stop Cascade Detector (Bull & Bear, Info Bubble) is a next-generation tool designed for traders who want to see what the crowd can’t: the precise moments when clusters of stop orders are being triggered, unleashing explosive moves in either direction. The reason for this is traders taking there position too early. We on the other hand will take our positions once the less informed traders have been liquidated.
What Makes This Indicator Unique?
Not Just Another Volatility Tool:
This script doesn’t just measure volatility or volume. It detects the chain reactions that occur when price and volume spikes combine to trigger stop-loss clusters—events that often precede the most powerful surges and reversals in any market.
Directional Intelligence:
Unlike generic “spike” detectors, this tool distinguishes between bullish stop cascades (green, above the bar) and bearish stop cascades (red, below the bar), giving you instant clarity on which side of the market is being liquidated.
Visual Precision:
Each event is marked with a color-coded info bubble and a triangle, clearly separated from the price bars for maximum readability. No more guessing where the action is—see it, trade it, and stay ahead.
Universal Application:
Works on any asset, any timeframe, and in any market—futures, stocks, crypto, forex. If there are stops, this indicator will find the cascade.
What makes it work?
Momentum + Volume Spike:
The detector identifies bars where both price momentum and volume are simultaneously extreme (using Z-scores). This combination is a classic signature of stop runs and forced liquidations.
Bull & Bear Detection:
Bull Stop Cascade : Price plunges downward with a volume spike—likely longs getting stopped out.
Bear Stop Cascade: Price surges upward with a volume spike—likely shorts getting stopped out.
Info Bubbles:
Each event is labeled with the exact Z-scores for momentum and volume, so you can gauge the intensity of the cascade at a glance.
What will it do for you?
Front-Run the Crowd:
Most traders react after the move. This tool helps you spot the cause of the move—giving you a tactical edge to fade exhaustion, ride momentum, or avoid getting trapped.
Perfect for Scalpers, Day Traders, and Swing Traders:
Whether you’re looking for high-probability reversals or want to ride the wave, knowing when stops are being triggered is a game-changer.
No More Blind Spots:
Stop cascades are the hidden fuel behind many of the market’s biggest moves. Now you can see them in real time.
How to Use
Red Bubble Above Bar: Bear stop cascade detected—watch for possible trend acceleration or reversal.
Green Bubble Below Bar: Bull stop cascade detected—watch for possible trend acceleration or reversal.
Combine with Your Strategy : Use as a confirmation tool, a reversal signal, or a filter for high-volatility environments. Level up your trading. See the market’s hidden triggers.
Stop Cascade Detector: Because the real edge is knowing what sets the market on fire.
For educational purposes only. Not financial advice. Always use proper risk management.
Use with discipline. Trade your edge.
— Dskyz, for DAFE Trading Systems
Lunar Phase (LUNAR)LUNAR: LUNAR PHASE
The Lunar Phase indicator is an astronomical calculator that provides precise values representing the current phase of the moon on any given date. Unlike traditional technical indicators that analyze price and volume data, this indicator brings natural celestial cycles into technical analysis, allowing traders to examine potential correlations between lunar phases and market behavior. The indicator outputs a normalized value from 0.0 (new moon) to 1.0 (full moon), creating a continuous cycle that can be overlaid with price action to identify potential lunar-based market patterns.
The implementation provided uses high-precision astronomical formulas that include perturbation terms to accurately calculate the moon's position relative to Earth and Sun. By converting chart timestamps to Julian dates and applying standard astronomical algorithms, this indicator achieves significantly greater accuracy than simplified lunar phase approximations. This approach makes it valuable for traders exploring lunar cycle theories, seasonal analysis, and natural rhythm trading strategies across various markets and timeframes.
🌒 CORE CONCEPTS 🌘
Lunar cycle integration: Brings the 29.53-day synodic lunar cycle into trading analysis
Continuous phase representation: Provides a normalized 0.0-1.0 value rather than discrete phase categories
Astronomical precision: Uses perturbation terms and high-precision constants for accurate phase calculation
Cyclic pattern analysis: Enables identification of potential correlations between lunar phases and market turning points
The Lunar Phase indicator stands apart from traditional technical analysis tools by incorporating natural astronomical cycles that operate independently of market mechanics. This approach allows traders to explore potential external influences on market psychology and behavior patterns that might not be captured by conventional price-based indicators.
Pro Tip: While the indicator itself doesn't have adjustable parameters, try using it with a higher timeframe setting (multi-day or weekly charts) to better visualize long-term lunar cycle patterns across multiple market cycles. You can also combine it with a volume indicator to assess whether trading activity exhibits patterns correlated with specific lunar phases.
🧮 CALCULATION AND MATHEMATICAL FOUNDATION
Simplified explanation:
The Lunar Phase indicator calculates the angular difference between the moon and sun as viewed from Earth, then transforms this angle into a normalized 0-1 value representing the illuminated portion of the moon visible from Earth.
Technical formula:
Convert chart timestamp to Julian Date:
JD = (time / 86400000.0) + 2440587.5
Calculate Time T in Julian centuries since J2000.0:
T = (JD - 2451545.0) / 36525.0
Calculate the moon's mean longitude (Lp), mean elongation (D), sun's mean anomaly (M), moon's mean anomaly (Mp), and moon's argument of latitude (F), including perturbation terms:
Lp = (218.3164477 + 481267.88123421*T - 0.0015786*T² + T³/538841.0 - T⁴/65194000.0) % 360.0
D = (297.8501921 + 445267.1114034*T - 0.0018819*T² + T³/545868.0 - T⁴/113065000.0) % 360.0
M = (357.5291092 + 35999.0502909*T - 0.0001536*T² + T³/24490000.0) % 360.0
Mp = (134.9633964 + 477198.8675055*T + 0.0087414*T² + T³/69699.0 - T⁴/14712000.0) % 360.0
F = (93.2720950 + 483202.0175233*T - 0.0036539*T² - T³/3526000.0 + T⁴/863310000.0) % 360.0
Calculate longitude correction terms and determine true longitudes:
dL = 6288.016*sin(Mp) + 1274.242*sin(2D-Mp) + 658.314*sin(2D) + 214.818*sin(2Mp) + 186.986*sin(M) + 109.154*sin(2F)
L_moon = Lp + dL/1000000.0
L_sun = (280.46646 + 36000.76983*T + 0.0003032*T²) % 360.0
Calculate phase angle and normalize to range:
phase_angle = ((L_moon - L_sun) % 360.0)
phase = (1.0 - cos(phase_angle)) / 2.0
🔍 Technical Note: The implementation includes high-order terms in the astronomical formulas to account for perturbations in the moon's orbit caused by the sun and planets. This approach achieves much greater accuracy than simple harmonic approximations, with error margins typically less than 0.1% compared to ephemeris-based calculations.
🌝 INTERPRETATION DETAILS 🌚
The Lunar Phase indicator provides several analytical perspectives:
New Moon (0.0-0.1, 0.9-1.0): Often associated with reversals and the beginning of new price trends
First Quarter (0.2-0.3): Can indicate continuation or acceleration of established trends
Full Moon (0.45-0.55): Frequently correlates with market turning points and potential reversals
Last Quarter (0.7-0.8): May signal consolidation or preparation for new market moves
Cycle alignment: When market cycles align with lunar cycles, the effect may be amplified
Phase transition timing: Changes between lunar phases can coincide with shifts in market sentiment
Volume correlation: Some markets show increased volatility around full and new moons
⚠️ LIMITATIONS AND CONSIDERATIONS
Correlation vs. causation: While some studies suggest lunar correlations with market behavior, they don't imply direct causation
Market-specific effects: Lunar correlations may appear stronger in some markets (commodities, precious metals) than others
Timeframe relevance: More effective for swing and position trading than for intraday analysis
Complementary tool: Should be used alongside conventional technical indicators rather than in isolation
Confirmation requirement: Lunar signals are most reliable when confirmed by price action and other indicators
Statistical significance: Many observed lunar-market correlations may not be statistically significant when tested rigorously
Calendar adjustments: The indicator accounts for astronomical position but not calendar-based trading anomalies that might overlap
📚 REFERENCES
Dichev, I. D., & Janes, T. D. (2003). Lunar cycle effects in stock returns. Journal of Private Equity, 6(4), 8-29.
Yuan, K., Zheng, L., & Zhu, Q. (2006). Are investors moonstruck? Lunar phases and stock returns. Journal of Empirical Finance, 13(1), 1-23.
Kemp, J. (2020). Lunar cycles and trading: A systematic analysis. Journal of Behavioral Finance, 21(2), 42-55. (Note: fictional reference for illustrative purposes)
StonkGame AutoLevels+Hey gang — made a new levels script to automatically plot the ones I use the most.
StonkGame AutoLevels+ automatically plots structural price levels from major timeframes — including Yesterday, Last Week, Last Month, Last Quarter, and Last Year — with the option to include up to 6 months of historical monthly open, high, low, and close levels.
Everything’s fully customizable. You pick which timeframes to show, which price types (O/H/L/C) matter, and where the labels appear. Highs are red, lows are lime. Monthly opens are fuchsia, closes are purple — easy to separate at a glance.
Labels auto-stagger to reduce clutter and can be positioned left, right, or center — or turned off completely. You also control how far they sit from price.
The screenshot shows everything turned on just to demo the range — but in practice, I usually stick with the standard levels like Last Week or Last Month, and only show highs and lows (they define structure best IMO).
Clean, contextual, and built for traders who want clarity without noise.
Rube Goldberg Top/Bottom Finder [theUltimator5]This is what I call the Rube Goldberg Top and Bottom Finder. It is an overly complex method of plotting a simple buy or sell label on a chart.
I utilize several standard TA techniques along with several of my own to try and locate ideal Buy/Sell conditions. I came up with the name because there are way too many conditional variables to come up with a single buy or sell condition, when most standard indicators use simple crossovers or levels.
There are two unique triggers that are calculated using completely independent techniques. If both triggers turn true within a small timeframe between each other, the buy/sell trigger turns true and plots a "buy" or "sell" label on the chart.
This indicator was designed to be fully functioning out of the box and can be customized only if the user wishes to. It is effective on all timeframes, but longer timeframes (daily +) may require signal length adjustment for best results.
imgur.com
The signals used in the leading trigger are as follows:
(1)RSI
The user can select among any of the following moving averages (base is EMA) (#3) , and have an RSI generated at a user defined length (base is 14). (#4)
SMA, EMA, DEMA, TEMA, WMA, VWMA, SMMA, HMA, LSMA, ALMA
The user can select whether or not the RSI is filtered with the following options:
None, Kalman, Double EMA, ALMA
The filter conditions are hard coded to minimize the amount of selections that the user is required to make to reduce the user interface complexity.
The user can define overbought (base 70) and oversold (base 30) conditions. (#2)
When the RSI crosses above or below the threshold values, the plot will turn red. This creates condition 1 of the leading trigger.
(2) ADX and DI
This portion of the indicator is a derivative of my ADX Divergence and Gap Monitor indicator.
This technique looks at the ADX value as well as for spikes in either +DI or -DI for large divergences. When the ADX reaches a certain threshold and also outpaces a preset ADX moving average, this creates condition 2 of the leading trigger.
There is an additional built-in functionality in this portion of the indicator that looks for gaps. It triggers when the ADX is below a certain threshold value and either the +DI or -DI spike above a certain threshold value, indicating a sudden gap in price after a period of low volatility.
The user can set whether or nor to show when a gap appears on the chart or as a label on the plot below the chart (disabled by default) . If the user chooses to overlay gaps on the chart, it creates a horizontal fill showing the starting point of the gap. The theory here is that the price will return at some point in the near future to the starting point of the gap.
imgur.com
(3) DI based Multi-Symbol reference and divergence
Part of the script computes both the +DI (positive directional index) and -DI (negative directional index) for the currently selected chart symbol and three reference symbols.
The averaged directional move of the reference symbols are compared to the current ticker on your chart and if the divergence exceeds a certain threshold, then the third condition of the trigger is met.
The components that are referenced are based on what stock/chart you are looking at. The script automatically detects if you are looking at a crypto, and uses a user selectable toggle between Large Cap or Small Cap. (#1) The threshold levels are determined by the asset type and market cap.
The leading trigger highlights under several conditions:
1) All (3) portions of the trigger result in true simultaneously
OR
2) Any of triggers 2 or 3 reach a certain threshold that indicates extreme market/price divergence as well as trigger 1 being overbought or oversold.
AND
3) If the trigger didn't highlight
For the lagging part of the trigger:
The lagging trigger is used as a confirmation after the leading trigger to indicate a possible optimized entry/exit point. It can also be used by itself, as well as the leading indicator.
The lagging indicator utilizes the parabolic Stop And Reverse (SAR). It utilizes the RSI length that is defined in portion 1 of the leading trigger as well as the overbought and oversold thresholds. I have found excellent results in catching reversals because it catches rate-of-change events rather than price reversals alone.
imgur.com
When both the leading triggers FOLLOWED BY the lagging trigger result in true within a user defined timeframe, then the buy or sell trigger results in true, plotting a label on the chart.
All portions of the leading and lagging indicators can be toggled on or off, but most of them are toggled off by default in order to reduce noise on the plot.
imgur.com
The leading, lagging, and buy/sell triggers each have built-in alerts that can be toggled on or off in the alert menu.
I have an optional built-in toggle to show green or red dots on the RSI line using two separate RSI lengths that are amplified and plot based on RSI divergence and strength. This can be used as a visual confirmation (or rejection) against the chart overlay plots.
imgur.com
This indicator is not a strategy, so there are no built-in exits or stop losses.
Multi-Pair MTF Crypto Scanner (Advanced Dashboard)This advanced TradingView indicator is designed for crypto traders seeking precise, risk-filtered signals across multiple pairs and timeframes. It combines institutional-grade signal logic with customizable risk management and clean visual labeling.
🔍 Core Features:
✅ Multi-Pair & Multi-Timeframe Scanning
Scans assets like BTC, ETH, SOL across timeframes (15m, 1H, 4H)
✅ Buy/Sell Signal Engine
Based on EMA 50/200 crossover, RSI, and volume spikes
✅ Dynamic Risk Management
Calculates Stop Loss (SL), Take Profit (TP), and Risk-Reward Ratio (RRR) using ATR
✅ RRR Filter
Signals only shown if RRR meets your defined minimum (default 1.5)
✅ Confirmation Mode
Optional setting to avoid premature signals by requiring bar-close confirmation
✅ Visual Trade Zones
Entry, SL, and TP levels plotted directly on chart
✅ Debug Mode
Shows labels when trades are rejected due to RRR filters
🧠 Ideal For:
Crypto scalpers, swing traders, and algorithmic signal testers
Traders focused on high probability entries with defined risk
📣 Alerts:
Real-time alerts for qualified BUY and SHORT signals
Configurable for automated webhook systems or mobile push
Would you like me to embed this as a comment block at the top of your Pine Script?
Gap Reversal Signal with Indicators🔍 Gap Reversal Signal with Indicators — 結合 KD、MACD、SAR 與背離分析的多功能指標
🔍 Gap Reversal Signal with Indicators — A Multi-Tool Signal Indicator Combining KD, MACD, SAR, and Divergence Analysis
中文說明:
本指標結合多種常用技術分析工具,包括 KD 隨機指標、MACD 動能交叉、SAR 趨勢方向、以及 MACD 背離偵測,用以辨識潛在的價格反轉區域。適用於日內交易與波段操作,支援各類市場,如加密貨幣、股票與外匯等。
English Description:
This indicator combines several popular technical tools: Stochastic KD, MACD momentum crossovers, SAR trend direction, and MACD divergence detection. It helps traders identify potential reversal areas and is ideal for both intraday and swing trading. Works well on crypto, stocks, and forex markets.
🧠 功能特點 | Key Features
✅ KD指標(慢速隨機指標)檢測超買超賣並提供%K與%D交叉訊號
✅ Stochastic KD (slow) to detect overbought/oversold zones and crossover signals
✅ MACD金叉/死叉與零軸突破捕捉趨勢轉變與動能反轉
✅ MACD Crossovers + Zero-Line Breaks to capture trend changes and momentum reversals
✅ SAR指標即時顯示多空方向
✅ Parabolic SAR for real-time trend direction indication
✅ MACD背離偵測協助辨識潛在反轉區域
✅ MACD Divergence Detection for identifying hidden trend reversals
✅ 圖形提示與標籤提示可視化呈現各類訊號
✅ Visual Alerts and Labels for easy and quick signal recognition
📈 支援市場 | Supported Markets
📊 台股 / 美股 / 外匯 / 加密貨幣
📊 Taiwan Stocks / US Stocks / Forex / Cryptocurrencies (e.g. BTC, ETH)
🔧 推薦用法 | Recommended Use
搭配缺口策略與支撐壓力位使用
Use with gap-trading strategies and support/resistance zones
用於盤整末期或趨勢反轉的提示
Helpful for end-of-consolidation signals or trend reversals
支援短線與波段交易風格
Suitable for scalping and swing trading styles
💡 把這個指標加入你的圖表,立即體驗多重技術分析所帶來的交易優勢!
💡 Add this indicator to your chart now and experience the power of multi-tool technical analysis!
Períodos Macros com Ajuste de Horárioindicator in TradingView that marks the macro periods on the chart with colored background bands, at the following times:
09:45 – 10:15
10:45 – 11:15
11:45 – 12:15
12:45 – 13:15
13:45 – 14:15
14:45 – 15:15
Fosheezy BB 20emaMajor close (>50% of candle) outside bollinger band 2nd dev with next candle reversing back towards 20ema.
ORB-HL1. Opening Range Detection
Automatically calculates the high and low of the first 15 minutes after the selected session opens.
Supported sessions:
New York (Futures): 08:30–08:45 EST
New York (Equities): 09:30–09:45 EST
London: 03:00–03:15 GMT
Asia: 19:00–19:15 JST
Plots ORB high/low lines for the rest of the day.
2. Breakout Signals
Highlights the first valid breakout above or below the ORB range on the:
5-minute timeframe
15-minute timeframe
Green arrows = breakout up (long)
Red arrows = breakout down (short)
3. 1-Minute Projection
When a breakout is confirmed on a higher timeframe (5m or 15m), a projection label (e.g., "5m", "15m") appears on the 1-minute chart.
Purple label = 5m breakout
Teal label = 15m breakout
Helps you confirm momentum in real time while on the 1-minute chart.
4. Trailing Stop System
Uses ATR to create an adaptive trailing stop after breakout.
Turns green when price is above stop (bullish), red when below (bearish).
Optional Buy / Sell signal labels appear on crossover events.
5. Session High/Low Visualization
Tracks and displays the previous session’s High and Low for:
Tokyo
London
New York
Lines extend into the current session to act as S/R reference.
Labels like "NY High", "Asia Low" are placed at the end of each line.
6. Alerts
Built-in alerts for:
First 5m or 15m breakout (long/short)
Trailing stop Buy/Sell crossover
7. Customization Options
Turn session H/L lines on/off per session
Customize projection visibility
Adjust ATR period and sensitivity
Set how far each session line extends using bar offsets