TASC 2025.06 Cybernetic Oscillator█ OVERVIEW
This script implements the Cybernetic Oscillator introduced by John F. Ehlers in his article "The Cybernetic Oscillator For More Flexibility, Making A Better Oscillator" from the June 2025 edition of the TASC Traders' Tips . It cascades two-pole highpass and lowpass filters, then scales the result by its root mean square (RMS) to create a flexible normalized oscillator that responds to a customizable frequency range for different trading styles.
█ CONCEPTS
Oscillators are indicators widely used by technical traders. These indicators swing above and below a center value, emphasizing cyclic movements within a frequency range. In his article, Ehlers explains that all oscillators share a common characteristic: their calculations involve computing differences . The reliance on differences is what causes these indicators to oscillate about a central point.
The difference between two data points in a series acts as a highpass filter — it allows high frequencies (short wavelengths) to pass through while significantly attenuating low frequencies (long wavelengths). Ehlers demonstrates that a simple difference calculation attenuates lower-frequency cycles at a rate of 6 dB per octave. However, the difference also significantly amplifies cycles near the shortest observable wavelength, making the result appear noisier than the original series. To mitigate the effects of noise in a differenced series, oscillators typically smooth the series with a lowpass filter, such as a moving average.
Ehlers highlights an underlying issue with smoothing differenced data to create oscillators. He postulates that market data statistically follows a pink spectrum , where the amplitudes of cyclic components in the data are approximately directly proportional to the underlying periods. Specifically, he suggests that cyclic amplitude increases by 6 dB per octave of wavelength.
Because some conventional oscillators, such as RSI, use differencing calculations that attenuate cycles by only 6 dB per octave, and market cycles increase in amplitude by 6 dB per octave, such calculations do not have a tangible net effect on larger wavelengths in the analyzed data. The influence of larger wavelengths can be especially problematic when using these oscillators for mean reversion or swing signals. For instance, an expected reversion to the mean might be erroneous because oscillator's mean might significantly deviate from its center over time.
To address the issues with conventional oscillator responses, Ehlers created a new indicator dubbed the Cybernetic Oscillator. It uses a simple combination of highpass and lowpass filters to emphasize a specific range of frequencies in the market data, then normalizes the result based on RMS. The process is as follows:
Apply a two-pole highpass filter to the data. This filter's critical period defines the longest wavelength in the oscillator's passband.
Apply a two-pole SuperSmoother (lowpass filter) to the highpass-filtered data. This filter's critical period defines the shortest wavelength in the passband.
Scale the resulting waveform by its RMS. If the filtered waveform follows a normal distribution, the scaled result represents amplitude in standard deviations.
The oscillator's two-pole filters attenuate cycles outside the desired frequency range by 12 dB per octave. This rate outweighs the apparent rate of amplitude increase for successively longer market cycles (6 dB per octave). Therefore, the Cybernetic Oscillator provides a more robust isolation of cyclic content than conventional oscillators. Best of all, traders can set the periods of the highpass and lowpass filters separately, enabling fine-tuning of the frequency range for different trading styles.
█ USAGE
The "Highpass period" input in the "Settings/Inputs" tab specifies the longest wavelength in the oscillator's passband, and the "Lowpass period" input defines the shortest wavelength. The oscillator becomes more responsive to rapid movements with a smaller lowpass period. Conversely, it becomes more sensitive to trends with a larger highpass period. Ehlers recommends setting the smallest period to a value above 8 to avoid aliasing. The highpass period must not be smaller than the lowpass period. Otherwise, it causes a runtime error.
The "RMS length" input determines the number of bars in the RMS calculation that the indicator uses to normalize the filtered result.
This indicator also features two distinct display styles, which users can toggle with the "Display style" input. With the "Trend" style enabled, the indicator plots the oscillator with one of two colors based on whether its value is above or below zero. With the "Threshold" style enabled, it plots the oscillator as a gray line and highlights overbought and oversold areas based on the user-specified threshold.
Below, we show two instances of the script with different settings on an equities chart. The first uses the "Threshold" style with default settings to pass cycles between 20 and 30 bars for mean reversion signals. The second uses a larger highpass period of 250 bars and the "Trend" style to visualize trends based on cycles spanning less than one year:
사이클
Granger Causality Flow IndicatorGranger Causality Flow Indicator (GC Flow)
█ OVERVIEW
The Granger Causality Flow Indicator (GC Flow) attempts to quantify the potential predictive relationship between two user-selected financial instruments (Symbol X and Symbol Y). In essence, it explores whether the past values of one series (e.g., Symbol X) can help explain the current value of another series (e.g., Symbol Y) better than Y's own past values alone.
This indicator provides a "Granger Causality Score" (GC Score) for both directions (X → Y and Y → X). A higher score suggests a stronger statistical linkage where one series may lead or influence the other. The indicator visualizes this "flow" of potential influence through background colors and on-chart text.
Important Note: "Granger Causality" does not imply true economic or fundamental causation. It is a statistical concept indicating predictive power or information flow. This implementation also involves simplifications (notably, using AR(1) models) due to the complexities of full Vector Autoregression (VAR) models in Pine Script®.
█ HOW IT WORKS
The indicator's methodology is based on comparing the performance of Autoregressive (AR) models:
1. Data Preprocessing:
Fetches historical close prices for two user-defined symbols (X and Y).
Optionally applies first-order differencing (`price - price `) to the series. Differencing is a common technique to achieve a proxy for stationarity, which is an underlying assumption for Granger Causality tests. Non-stationary series can lead to spurious correlations.
2. Autoregressive (AR) Models (Simplified to AR(1)):
Due to Pine Script's current limitations for complex multivariate time series models, this indicator uses simplified AR(1) models (where the current value is predicted by its immediately preceding value).
Restricted Model (for Y → Y): Predicts the target series (e.g., Y) using only its own past value (Y ).
`Y = c_R + a_R * Y + residuals_R`
The variance of `residuals_R` (Var_R) is calculated.
Unrestricted Model (Proxy for X → Y): To test if X Granger-causes Y, the indicator examines if the past values of X (X ) can explain the residuals from the restricted model of Y.
`residuals_R = c_UR' + b_UR * X + residuals_UR`
The variance of these final `residuals_UR` (Var_UR) is calculated.
The same process is repeated to test if Y Granger-causes X.
3. Granger Causality (GC) Score Calculation:
The GC Score quantifies the improvement in prediction from adding the other series' past values. It's calculated as:
`GC Score = 1 - (Var_UR / Var_R)`
A score closer to 1 suggests that the "causing" series significantly reduces the unexplained variance of the "target" series (i.e., Var_UR is much smaller than Var_R), indicating stronger Granger causality.
A score near 0 (or capped at 0 if Var_UR >= Var_R) suggests little to no improvement in prediction.
The score is calculated over a rolling `Calculation Window`.
Pine Script® Snippet (Conceptual GC Score Logic):
// Conceptual representation of GC Score calculation
// var_R: Variance of residuals when Y is predicted by Y
// var_UR: Variance of residuals when Y's AR(1) residuals are predicted by X
score = 0.0
if var_R > 1e-9 // Avoid division by zero
score := 1.0 - (var_UR / var_R)
score := score < 0 ? 0 : score // Ensure score is not negative
4. Determining Causal Flow:
The calculated GC Scores for X → Y and Y → X are compared against a user-defined `Significance Threshold for GC Score`.
If GC_X→Y > threshold AND GC_Y→X > threshold: Bidirectional flow.
If GC_X→Y > threshold only: X → Y flow.
If GC_Y→X > threshold only: Y → X flow.
Otherwise: No significant flow.
█ HOW TO USE IT
Interpreting the Visuals:
Background Color:
Green: Indicates X → Y (Symbol 1 potentially leads Symbol 2).
Orange: Indicates Y → X (Symbol 2 potentially leads Symbol 1).
Blue: Indicates Bidirectional influence.
Gray: No significant Granger causality detected based on the threshold.
Data Window Plots: The actual GC Scores for X → Y (blue) and Y → X (red) are plotted and visible in TradingView's Data Window. A dashed gray line shows your `Significance Threshold`.
On-Chart Table (Last Bar): Displays the currently detected causal direction text (e.g., "BTCUSDT → QQQ").
Potential Applications:
Intermarket Analysis: Explore potential lead-lag relationships between different asset classes (e.g., commodities and equities, bonds and currencies).
Pair Trading Components: Identify if one component of a potential pair tends to lead the other.
Confirmation Tool: Use alongside other analyses to see if a move in one asset might foreshadow a move in another.
Considerations:
Symbol Choice: Select symbols that have a plausible economic or market relationship.
Stationarity: Granger Causality tests ideally require stationary time series. The `Use Differencing` option is a simple proxy. True stationarity testing is complex. Non-stationary data can yield misleading results.
Lag Order (p): This indicator is fixed at p=1 due to Pine Script® limitations. In rigorous analysis, selecting the optimal lag order is crucial.
Calculation Window: Shorter windows are more responsive but may be noisier. Longer windows provide smoother scores but lag more.
Significance Threshold: Adjust this based on your desired sensitivity for detecting causal links. There's no universally "correct" threshold; it depends on the context and noise level of the series.
█ INPUTS
Symbol 1 (X): The first symbol in the analysis.
Symbol 2 (Y): The second symbol (considered the target when testing X → Y).
Use Differencing: If true, applies first-order differencing to both series as a proxy for stationarity.
Calculation Window (N): Lookback period for AR model coefficient estimation and variance calculations.
Lag Order (p): Currently fixed at 1. This defines the lag used (e.g., X , Y ) in the AR models.
Significance Threshold for GC Score: A value between 0.01 and 0.99. The calculated GC Score must exceed this to be considered significant.
█ VISUALIZATION
Background Color: Dynamically changes based on the detected Granger causal flow (Green for X → Y, Orange for Y → X, Blue for Bidirectional, Gray for None).
GC Scores (Data Window):
Blue Plot: GC Score for X → Y.
Red Plot: GC Score for Y → X.
Significance Threshold Line: A dashed gray horizontal line plotted at the level of your input threshold.
On-Chart Table: Displayed on the top-right (on the last bar), showing the current causal direction text.
█ ALERTS
The indicator can generate alerts for:
Emergence of X → Y causality.
Emergence of Y → X causality.
General change or cessation of a previously detected causal relationship.
█ IMPORTANT DISCLAIMERS & LIMITATIONS
Correlation vs. Causation: Granger causality measures predictive power, not true underlying economic causation. A strong GC Score doesn't prove one asset *causes* another to move, only that its past values improve predictions.
Stationarity Assumption: While differencing is offered, it's a simplified approach. Non-stationary data can lead to spurious (false) Granger causality detection.
Model Simplification (AR(1)): This script uses AR(1) models for simplicity. Real-world relationships can involve more complex dynamics and higher lag orders. The fixed lag of p=1 is a significant constraint.
Sensitivity to Parameters: Results can be sensitive to the chosen symbols, calculation window, differencing option, and significance threshold.
No Statistical Significance Testing (p-values): This indicator uses a direct threshold on the GC Score itself, not a formal statistical test (like an F-test producing p-values) typically found in econometric software.
Use this indicator as an exploratory tool within a broader analytical framework. Do not rely on it as a standalone basis for trading decisions.
█ CREDITS & LICENSE
Author: mastertop ( Twitter: x.com )
Version: 1.0 (Released: 2025-05-08)
This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
© mastertop, 2025
Yield Curve Approximation
A yield curve is a graph that plots the yields (interest rates) of bonds with the same credit quality but different maturity dates. It helps investors understand the relationship between short-term and long-term interest rates.
🔹 Types of Yield Curves
1️⃣ Normal Yield Curve – Upward-sloping, indicating economic expansion.
2️⃣ Inverted Yield Curve – Downward-sloping, often a recession warning.
3️⃣ Flat Yield Curve – Suggests economic uncertainty or transition.
The yield curve is widely used to predict economic conditions and interest rate movements. You can learn more about it here. Would you like insights on how traders use the yield curve for investment decisions?
How to Trade Using This?
✅ If the yield curve is steepening (green) → Favor growth stocks, commodities, and high-risk assets.
✅ If the yield curve is flattening or inverting (red) → Consider bonds, defensive sectors, or hedging strategies.
✅ Pair with economic news and interest rate decisions to refine predictions.
Crosby RatioCrosby Ratio with Z-Score Indicator (Weekly on Daily)
Overview:
The Crosby Ratio is a technical indicator used to identify potential market tops and bottoms based on price action and volatility. It is derived from a smoothed Heikin Ashi close and a moving average of that close, and then adjusted by the Average True Range (ATR) to assess the magnitude of price movements relative to volatility.
The indicator is designed to be more accurate on the weekly timeframe for identifying significant turning points, but in this version, it is displayed on the daily chart, with the Crosby Ratio values calculated from weekly data.
A Z-score is calculated based on the Crosby Ratio values. The Z-score standardizes the Crosby Ratio, allowing traders to better assess extreme market conditions.
How the Crosby Ratio is Calculated:
Heikin-Ashi Close: The indicator starts with the Heikin-Ashi close, calculated as the average of the open, high, low, and close prices.
Heikin-Ashi Close
=
Open
+
High
+
Low
+
Close
4
Heikin-Ashi Close=
4
Open+High+Low+Close
Smoothing: The Heikin-Ashi close values are then smoothed over a specified period (default length is 30 bars).
Moving Average: The indicator calculates a simple moving average (SMA) of the smoothed Heikin-Ashi closes to determine the trend.
Height Calculation: The difference between the current moving average and the previous one is used to calculate the height, which indicates price momentum.
Atan Function: The height value is then adjusted using an arctangent (atan2) function that considers both the height and the Average True Range (ATR) over the period. This gives us the Crosby Ratio, which is normalized on a scale of -180 to 180 degrees.
Weekly Data: The Crosby Ratio is calculated on the weekly timeframe (using request.security) but displayed on the daily chart for ease of analysis.
Z-Score Calculation:
The Z-score is a statistical measure that shows how far a value is from the mean in terms of standard deviations. In this indicator:
Z-Score Max = 2 and Z-Score Min = -2 are the predefined limits for the Z-score.
The Z-score is calculated linearly based on the Crosby Ratio values, with the formula:
𝑍
Score
=
𝐶
𝑟
𝑜
𝑠
𝑏
𝑦
Ratio
−
Crosby Min
Crosby Max
−
Crosby Min
×
(
Z-Score Max
−
Z-Score Min
)
+
Z-Score Min
ZScore=
Crosby Max−Crosby Min
CrosbyRatio−Crosby Min
×(Z-Score Max−Z-Score Min)+Z-Score Min
When the Crosby Ratio reaches a value of 23, the Z-score will be +2 (indicating extreme overbought conditions).
When the Crosby Ratio reaches a value of -16, the Z-score will be -2 (indicating extreme oversold conditions).
How to Read the Indicator:
Crosby Ratio Line: The line represents the value of the Crosby Ratio over time. Higher values indicate strong bullish momentum, while lower values indicate strong bearish momentum.
Z-Score Table: The Z-score is displayed in the table in the upper right corner of the chart. It helps to understand how far the current Crosby Ratio is from its predefined limits:
Z-Score > 1: The market is in a potentially overbought condition, signaling that a reversal could be near.
Z-Score < -1: The market is in a potentially oversold condition, suggesting a potential reversal or bounce.
Z-Score near 0: The market is within a neutral range, indicating no extreme conditions.
Upper and Lower Bands: The upper and lower bands represent threshold levels for the Crosby Ratio, indicating where extreme conditions might occur:
Upper Threshold (20.285): If the Crosby Ratio approaches or exceeds this level, the market could be in a strong uptrend, signaling overbought conditions.
Lower Threshold (-18.250): If the Crosby Ratio falls to or below this level, the market could be in a downtrend, signaling oversold conditions.
Interpretation:
Crosby Ratio Above Upper Threshold (20.285): This suggests the market might be in an overbought condition, and a reversal or pullback could be imminent.
Crosby Ratio Below Lower Threshold (-18.250): This indicates the market might be oversold, and a reversal or bounce could occur.
Z-Score of +2: Extreme overbought conditions (Crosby Ratio = 23).
Z-Score of -2: Extreme oversold conditions (Crosby Ratio = -16).
How to Use:
Trend Reversals: Watch for significant changes in the Crosby Ratio and Z-score to spot potential trend reversals. A Z-score near +2 or -2 could indicate an overbought or oversold market, respectively.
Confirmation of Signals: The Z-score can be used to confirm the strength of the Crosby Ratio. For example, if the Crosby Ratio shows an extreme value with a corresponding Z-score of +2 or -2, it suggests a strong overbought or oversold condition.
Ma stratégieCME:6E1!
ANTHONY,
✅ KEY FEATURES:
VWAP Breakouts (Daily + Weekly), Midnight Open, and Initial Balance
PO3 Analysis Daily Only
Visible Absorption (Orange Zones)
Precise Entries Filtered by Institutional Volume
Global M2 YoY % Change (USD)+108 Days Daily ChartGlobal M2 YoY % Change pushed 108 days forward. Showing Global Liquidity as a proxy. It is the correlation between Global Liquidity and the bitcoin price after 108 Days. Be careful this proxy only works well on the Daily timeframe.
HONZ4 SessionsDisplaying sessions according to stock market opening times:
Stock exchanges: JPX (Tokyo), LSE (London), NASDAQ (New York).
Japan – 9:00 - 15:25 (UTC+9)
London – 8:00 - 16:30 (UTC / in summer UTC+1)
New York – 9:30 - 16:00 (UTC-5 / in summer UTC-4)
The conversion of these times to UTC as of May 2025 looks like this:
Japan – 0:00 - 6:25 (UTC)
London – 7:00 - 15:30 (UTC)
New York – 13:30 - 20:00 (UTC)
Benner Cycles📜 Overview
The Benner Cycles indicator is a visually intuitive overlay that maps out one of the most historically referenced market timing models—Samuel T. Benner’s Cycles—directly onto your chart. This tool highlights three distinct types of market years: Panic, Peak, and Buy years, based on the rhythmic patterns first published by Benner in the late 19th century.
Benner's work is legendary among financial historians and cycle theorists. His original charts, dating back to the 1800s, remarkably anticipated economic booms, busts, and recoveries by following repeating year intervals. This modern adaptation brings that ancient rhythm into your TradingView workspace.
🔍 Background
Samuel T. Benner (1832–1913) was an Ohioan ironworks businessman and farmer who, after losing everything in the Panic of 1873, sought to uncover the secrets of economic cycles. His work led to the famous Benner's Cycle Chart, which forecasts business activity using repeatable intervals of panic, prosperity, and opportunity.
Benner’s method was based on a combination of numerological, agricultural, and empirical observations—not unlike early forms of technical and cyclical analysis. His legacy survives through a set of three rotating intervals for each market condition.
George Tritch was the individual responsible for preserving and publishing Samuel T. Benner’s economic cycle charts after Benner's death. While Benner was the original creator of the Benner Cycle, Tritch is known for reproducing and circulating the Benner chart in the early 20th century, helping it gain broader recognition among traders, economists, and financial historians.
🛠️ Features
Overlay Background Highlights shades the chart background to reflect the current year's cycle type
Configurable Year Range defines your own historical scope using Start Year and End Year
Fully Customizable Colors & Opacity
Live Statistics Table (optional) displays next projected Panic, Peak, and Buy years as well as current year’s market phase
Cycle Phase Logic (optional) prioritizes highlighting in order of Panic > Peak > Buy if overlaps occur
📈 Use Cases
Macro Timing Tool – Use the cycle phases to align with broader economic rhythms (especially useful for long-term investors or cycle traders).
Market Sentiment Guide – Panic years may coincide with recessions or major selloffs; Buy years may signal deep value or accumulation opportunities.
Overlay for Historical Studies – Perfect for comparing past major market movements (e.g., 1837, 1929, 2008) with their corresponding cycle phase. See known limitations below.
Forecasting Reference – Identify where we are in the repeating Benner rhythm and prepare for what's likely ahead.
⚠️ Limitations
❗ Not Predictive in Isolation: Use in conjunction with other tools.
❗ Calendar-Based Only: This indicator is strictly time-based and does not factor in price action, volume, or volatility.
❗ Historical Artifact, Not a Guarantee
❗ Data Availability: This indicator's historical output is constrained by the available price history of the underlying ticker. Therefore, it cannot display cycles prior to the earliest candle on the chart.
Separador SemanalSeparate weekly, that's right, separate weekly but not only that but separate and I have to write this so that tw lets me publish it.
Helen Trend RegimeGreatness starts from a tiny step forward.
This indicator combines EMA as a directional signal, BBWP as a volatility signal, and Volume Z-score as an volume signal to mark the market status: either in up trend, down trend, range, or in transition.
RSI Phan Ky FullThe RSI divergence indicator is like a magnifying glass that spots gaps between price swings and momentum. When price keeps climbing but RSI quietly sags, it’s a flashing U‑turn sign: the bulls are winded, and the bears are lacing up their boots. Flip it around—price is sliding yet RSI edges higher—and you’ve got bulls secretly stockpiling. Hidden divergences shore up the trend; regular divergences hint at a pivot. Blend those signals with overbought/oversold zones, support‑resistance, and volume, and RSI divergence turns into a radar that helps traders jump in with swagger and bail out just in time.
Extended-hours Volume vs AVOL// ──────────────────────────────────────────────────────────────────────────────
// Extended-Hours Volume vs AVOL • HOW IT WORKS & HOW TO TRADE IT
// ──────────────────────────────────────────────────────────────────────────────
//
// ░ What this indicator is
// ------------------------
// • It accumulates PRE-MARKET (04:00-09:30 ET) and AFTER-HOURS (16:00-20:00 ET)
// volume on intraday charts and compares that running total with the stock’s
// 21-day average daily volume (“AVOL” by default).
// • Three live read-outs are shown in the data-window/table:
//
// AH – volume traded since the 16:00 ET close
// PM – volume traded before the 09:30 ET open
// Ext – AH + PM (updates in pre-market only)
// %AVOL – Ext ÷ AVOL × 100 (updates in pre-market)
//
// • It is intended for U.S. equities but the session strings can be edited for
// other markets.
//
// ░ Why it matters
// ----------------
// Big extended-hours volume almost always precedes outsized intraday range.
// By quantifying that volume as a % of “normal” trade (AVOL), you can filter
// which gappers and news names deserve focus *before* the bell rings.
//
// ░ Quick-start trade plan (educational template – tune to taste)
// ----------------------------------------------------------------
// 1. **Scan** the watch-list between 08:30-09:25 ET.
// ► Keep charts on 1- or 5-minute candles with “Extended Hours” ✔ checked.
// 2. **Filter** by `Ext` or `%AVOL`:
// – Skip if < 10 % → very low interest
// – Flag if 20-50 % → strong interest, Tier-1 candidate
// – Laser-focus if > 50 % → crowd favourite; expect liquidity & range
// 3. **Opening Range Breakout (long example)**
// • Preconditions: Ext ≥ 20 % & price above yesterday’s close.
// • Let the first 1- or 5-min bar complete after 09:30.
// • Stop-buy 1 tick above that bar (or pre-market high – whichever higher).
// • Initial stop below that bar low (or pre-market low).
// • First target = 1R or next HTF resistance.
// 4. **Red-to-Green reversal (gap-down long)**
// • Ext ≥ 30 % but pre-market gap is negative.
// • Enter as price reclaims yesterday’s close on live volume.
// • Stop under reclaim bar; scale out into VWAP / first liquidity pocket.
// 5. **Risk** – size so the full stop is ≤ 1 R of account. Volume fade or
// loss of %AVOL slope is a reason to tighten or exit early.
//
// ░ Tips
// ------
// • AVOL look-back can be changed in the input panel (21 days ⇒ ~1 month).
// • To monitor several symbols, open a multi-chart layout and sort your
// watch-list by %AVOL descending – leaders float to the top automatically.
// • Replace colour constants with hex if the namespace ever gets shadowed.
//
// ░ Disclaimer
// ------------
// For educational purposes only. Not financial advice. Trade your own plan.
//
// ──────────────────────────────────────────────────────────────────────────────
Smoothed ROC Z-Score with TableSmoothed ROC Z-Score with Table
This indicator calculates the Rate of Change (ROC) of a chosen price source and transforms it into a smoothed Z-Score oscillator, allowing you to identify market cycle tops and bottoms with reduced noise.
How it works:
The ROC is calculated over a user-defined length.
A moving average and standard deviation over a separate window are used to standardize the ROC into a Z-Score.
This Z-Score is further smoothed using an exponential moving average (EMA) to filter noise and highlight clearer cycle signals.
The smoothed Z-Score oscillates around zero, with upper and lower bands defined by user inputs (default ±2 standard deviations).
When the Z-Score reaches or exceeds ±3 (customizable), the value shown in the table is clamped at ±2 for clearer interpretation.
The indicator plots the smoothed Z-Score line with zero and band lines, and displays a colored Z-Score table on the right for quick reference.
How to read it:
Values near zero indicate neutral momentum.
Rising Z-Scores towards the upper band suggest increasing positive momentum, possible market tops or strength.
Falling Z-Scores towards the lower band indicate negative momentum, potential bottoms or weakness.
The color-coded table gives an easy visual cue: red/orange for strong positive signals, green/teal for strong negative signals, and gray for neutral zones.
Use cases:
Identify turning points in trending markets.
Filter noisy ROC data for cleaner signals.
Combine with other indicators to time entries and exits more effectively.
S&P 500 Estimated PE (Sampled Every 4)📊 **S&P 500 Estimated PE Ratio (from CSV)**
This indicator visualizes the forward-looking estimated PE ratio of the S&P 500 index, imported from external CSV data.
🔹 **Features:**
- Real historical daily data from 2008 onward
- Automatically aligns PE values to closest available trading date
- Useful for macro valuation trends and long-term entry signals
📌 **Best for:**
- Investors interested in forward-looking valuation
- Analysts tracking over/undervaluation trends
- Long-term timing overlay on price action
Category: `Breadth indicators`, `Cycles`
Gold ValuationGold Value Index
The Gold Value Index (GVI) is a macro-driven oscillator that estimates the relative value of gold based on real-time movements in the US Dollar Index (DXY) and the 10-Year US Treasury Yield (US10Y). It helps traders contextualize gold’s price within broader macroeconomic pressure — identifying when gold may be over- or undervalued relative to these key drivers.
How It Works – Macro Inputs:
DXY (US Dollar Index): Typically moves inversely to gold. A rising dollar suggests downward pressure on gold value.
US10Y Yield: Higher yields increase the opportunity cost of holding gold, often leading to weaker gold prices.
Both inputs are Z-score normalized and inverted to reflect their typical negative correlation with gold. When combined, they form a single, scaled index from 0 (undervalued) to 100 (overvalued).
Why Use This Tool?
Gold reacts to macro forces as much as technical ones. The GVI blends these inputs into a clear, visual gauge to:
Anticipate mean-reversion setups.
Avoid emotionally-driven trades in extreme macro conditions.
Enhance timing by understanding gold's macro context.
Important Notes:
Data sources include ICEUS:DXY and TVC:US10Y via TradingView.
Code is protected — this is a private, invite-only script.
Simplified STH-MVRV + Z-ScoreSimplified Short Term Holder MVRV (STH-MVRV) + Z-Score Indicator
Description:
This indicator visualizes the Short Term Holder Market Value to Realized Value ratio (STH-MVRV) and its normalized Z-Score, providing insight into Bitcoin’s market cycle phases and potential overbought or oversold conditions.
How it works:
The STH-MVRV ratio compares the market value of coins held by short-term holders to their realized value, helping to identify periods of profit-taking or accumulation by these holders.
The indicator calculates three versions:
STH-MVRV (MVRV): Ratio of current MVRV to its 155-day SMA.
STH-MVRV (Price): Ratio of BTC price to its 155-day SMA.
STH-MVRV (AVG): Average of the above two ratios.
You can select which ratio to display via the input dropdown.
Threshold Lines:
Adjustable upper and lower threshold lines mark significant levels where market sentiment might shift.
The indicator also plots a baseline at 1.0 as a reference.
Z-Score Explanation:
The Z-Score is a normalized value scaled between -3 and +3, calculated relative to the chosen threshold levels.
When the ratio hits the upper threshold, the Z-Score approaches +2, indicating potential overbought conditions.
Conversely, reaching the lower threshold corresponds to a Z-Score near -2, signaling potential oversold conditions.
This Z-Score is shown in a clear table in the top right corner of the chart for easy monitoring.
Data Sources:
MVRV data is fetched from the BTC_MVRV dataset.
Price data is sourced from the BTC/USD index.
Usage:
Use this indicator to assess short-term holder market behavior and to help identify buying or selling opportunities based on extremes indicated by the Z-Score.
Combining this tool with other analysis can improve timing decisions in Bitcoin trading.
Simplified Hashrate Oscillator + Z-ScoreIndicator Description for TradingView
Simplified Hashrate Oscillator + Z-Score (SHO + Z)
This indicator analyzes the Bitcoin network's mining hashrate data by comparing short-term and long-term moving averages of the hashrate to create an oscillator that reflects changes in mining activity.
How it works:
The indicator calculates two Simple Moving Averages (SMAs) of the Bitcoin network hashrate — a short-term SMA (default 21 days) and a long-term SMA (default 105 days).
The difference between these two averages is normalized and expressed as a percentage, forming the Hashrate Oscillator line.
Two user-defined threshold lines (default ±7%) are plotted as upper and lower reference levels on the oscillator.
When the oscillator approaches these levels, it indicates potential extremes in mining activity.
Z-Score Explanation:
The Z-Score is a normalized measure that translates the oscillator's current value into a standardized scale roughly ranging from -2 to +2.
It shows how far the current hashrate oscillator value deviates from the user-defined thresholds.
A Z-Score near +2 means the oscillator is close to or above the upper threshold (possible overbought conditions).
A Z-Score near -2 means the oscillator is near or below the lower threshold (possible oversold conditions).
This helps users assess the relative strength or weakness of the mining hashrate movement in a normalized context.
Data Source:
The hashrate data is sourced daily from the Bitcoin network hashrate dataset provided by Quandl (QUANDL:BCHAIN/HRATE), a reliable blockchain data provider.
The indicator requests daily hashrate values and calculates SMAs accordingly.
How to use:
Watch the Hashrate Oscillator line for movements towards or beyond the threshold lines as signals of miner capitulation or recovery phases.
Use the Z-Score displayed in the table to quickly gauge how extreme the current reading is relative to set thresholds.
Adjust the short and long SMA periods and threshold lines to suit your preferred sensitivity and trading timeframe.
SP 500 PE Ratio (Loose Date Match)📈 **S&P 500 PE Ratio (from Excel Data)**
This custom indicator visualizes the historical S&P 500 Price-to-Earnings (PE) Ratio loaded from Excel. Each data point represents a snapshot of the market valuation at a specific time, typically on an annual or quarterly basis.
🔹 **What it does:**
- Plots the PE ratio values on the chart aligned with historical dates
- Uses stepwise or linear rendering to account for missing trading days
- Helps identify valuation cycles and extremes (e.g., overvalued vs undervalued)
🔍 **Use case:**
- Long-term market analysis
- Compare PE trends with price performance
- Spot long-term entry/exit zones based on valuation
🛠️ Future plans:
- Add value zone highlighting (e.g., PE > 30 = red, PE < 15 = green)
- Support for dynamic datasets (via Google Sheets or Notion)
Category: `Breadth indicators`, `Cycles`
💡 Source: Manually imported data (can be replaced with any custom macro data series)
Opening Range 15 min (US Market Hours)📘 Opening Range 15 min
This script plots the Opening Range (OR) High and Low based on the first 15 minutes of the US regular session (9:30–9:45 EST), and extends those levels through the remainder of the trading day.
🔑 Key Features:
Displays OR lines on all timeframes using accurate 15-minute data
Extends horizontal lines from 9:30 to 16:00 (U.S. market hours)
Adds clear, auto-updating labels at the end of each line (ORH and ORL)
Fully customizable colors for lines, fill, borders, and labels