Enhanced Gann Time-Price SquaresEnhanced Gann Time-Price Squares Indicator
A comprehensive Pine Script indicator that identifies and visualizes W.D. Gann's time-price square formations on your charts. This tool helps traders spot potential market turning points where time and price movements align according to Gann's legendary market theories.
Key Features:
Automatic Square Detection - Identifies completed squares where price movement equals time movement
Future Projections - Shows forming squares with projected completion points
Pivot Integration - Automatically detects pivot highs/lows as square starting points
Visual Clarity - Clean box outlines with customizable colors and styles
Smart Filtering - Prevents overlapping squares and includes minimum move thresholds
Real-time Status - Information table showing current square formations
How to Use:
The indicator draws boxes when price moves from pivot points equal the time elapsed (number of bars). Green squares indicate upward movements, red squares show downward movements. Dashed lines show forming squares, while dotted lines project where they might complete.
Settings:
Adjust pivot sensitivity and minimum price moves
Customize tolerance for time-price matching
Toggle projections, labels, and visual elements
Fine-tune colors and line styles
Perfect for Gann theory practitioners and traders looking for time-based market analysis. The squares often coincide with significant support/resistance levels and potential reversal points.
Compatible with all timeframes and instruments.
More updates to follow
วัฏจักร
Swing Structure [HH HL LH LL + 😎 + 👻]Tracks real-time swing structure (HH, HL, LH, LL) using confirmed pivot points. Shows ghost 👻 and cool 😎 emojis at key higher low setups. Great for identifying breakout retests and trend continuation zones. No repaint.
XAUUSD BOS + Retest Looser Bot//@version=5
indicator("SMC Map — BOS/CHoCH + PD + Liquidity + Killzones", overlay=true)
// === CONFIG ===
pd_tf = input.timeframe("240", "HTF for PD array")
show_killzone = input.bool(true, "Show Killzones")
// === HTF SWINGS ===
htf_high = request.security(syminfo.tickerid, pd_tf, high)
htf_low = request.security(syminfo.tickerid, pd_tf, low)
pd_mid = (htf_high + htf_low) / 2
// Plot PD midline
plot(pd_mid, title="PD 50%", color=color.gray, linewidth=2)
// === SWING STRUCTURE ===
var float swing_high = na
var float swing_low = na
is_swing_high = ta.highest(high, 3) == high and close < high
is_swing_low = ta.lowest(low, 3) == low and close > low
if (is_swing_high)
swing_high := high
if (is_swing_low)
swing_low := low
// === BOS / CHoCH ===
bos_up = not na(swing_high) and close > swing_high
bos_down = not na(swing_low) and close < swing_low
var int structure_dir = 0 // 0=neutral, 1=up, -1=down
choch_up = false
choch_down = false
if (bos_up)
choch_up := structure_dir == -1
structure_dir := 1
if (bos_down)
choch_down := structure_dir == 1
structure_dir := -1
// === PLOTS ===
plotshape(bos_up, title="BOS UP", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(bos_down, title="BOS DOWN", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
plotshape(choch_up, title="CHOCH UP", style=shape.labelup, location=location.belowbar, color=color.lime, size=size.tiny, text="CHOCH")
plotshape(choch_down, title="CHOCH DOWN", style=shape.labeldown, location=location.abovebar, color=color.maroon, size=size.tiny, text="CHOCH")
plot(swing_high, title="Swing High Liquidity", color=color.new(color.green, 50), style=plot.style_cross, linewidth=1)
plot(swing_low, title="Swing Low Liquidity", color=color.new(color.red, 50), style=plot.style_cross, linewidth=1)
// === KILLZONE ===
in_london = (hour >= 6 and hour < 11)
in_ny = (hour >= 12 and hour < 18)
bgcolor(show_killzone and in_london ? color.new(color.green, 90) : na)
bgcolor(show_killzone and in_ny ? color.new(color.blue, 90) : na)
EMA, DEMA (x2), SMMA (x2) Combo [V6]The averages of one EMA, two DEMA, and two SMMA are combined. parameters can be adjusted. The transaction is entered and exited according to the intersections.
Dynamic Gap Probability ToolDynamic Gap Probability Tool measures the percentage gap between price and a chosen moving average, then analyzes your chart history to estimate the likelihood of the next candle moving up or down. It dynamically adjusts its sample size to ensure statistical robustness while focusing on the exact deviation level.
Originality and Value:
• Combines gap-based analysis with dynamic sample aggregation to balance precision and reliability.
• Automatically extends the sample when exact matches are scarce, avoiding misleading signals on rare extreme moves.
• Provides real “next-candle” probabilities based on historical occurrences rather than fixed thresholds or untested heuristics.
• Adds value by giving traders an evidence-based edge: you see how similar past deviations actually played out.
How It Works:
1. Calculate gap = (close – moving average) / moving average * 100.
2. Round the absolute gap to nearest percent (X%).
3. Count historical bars where gap ≥ X% above or ≤ –X% below.
4. If exact X% count is below the minimum occurrences threshold, include gaps at X+1%, X+2%, etc., until threshold is reached.
5. Compute “next-candle” green vs. red probabilities from the aggregated sample.
6. Display current gap, sample size, green probability, and red probability in a table.
Inputs:
• Moving Average Type (SMA, EMA, WMA, VWMA, HMA, SMMA, TMA)
• Moving Average Period (default 200)
• Minimum Occurrences Threshold (default 50)
• Table position and styling options
Examples:
• If price is 3% above the 200-period SMA and 120 occurrences ≥3% are found, with 84 green next candles (70%) and 36 red (30%), the script displays “3% | 120 | 70% green | 30% red.”
• If price is 8% below the SMA but only 20 exact matches exist, the script will include 9% and 10% gaps until it reaches 50 samples, then calculate probabilities from that broader set.
Why It’s Useful:
• Mean-reversion traders see green-probability signals at extreme overbought or oversold levels.
• Trend-followers identify continuation likelihood when red probability is high.
• Risk managers gauge reliability by inspecting sample size before acting on any signal.
Limitations:
• Historical probabilities do not guarantee future performance.
• Results depend on timeframe and symbol, backtest with your data before trading.
• Use realistic slippage and commission when overlaying on strategy scripts.
minchang volume tradingCondition
Point color
Volume ≥ 3× MA(24)
Violet
Volume ≥ 1.5× MA(24)
Red
Volume < 1.5× MA(24) & bullish
White
Volume < 1.5× MA(24) & bearish
Black
Fast Fourier Transform [ScorsoneEnterprises]The SCE Fast Fourier Transform (FFT) is a tool designed to analyze periodicities and cyclical structures embedded in price. This is a Fourier analysis to transform price data from the time domain into the frequency domain, showing the rhythmic behaviors that are otherwise invisible on standard charts.
Instead of merely observing raw prices, this implementation applies the FFT on the logarithmic returns of the asset:
Log Return(𝑚) = log(close / close )
This ensures stationarity and stabilizes variance, making the analysis statistically robust and less influenced by trends or large price swings.
For a user-defined lookback window 𝑁:
Each frequency component 𝑘 is computed by summing real and imaginary projections of log-returns multiplied by complex exponential functions:
𝑒^−𝑖𝜃 = cos(𝜃)−𝑖sin(𝜃)
where:
θ = 2πkm / N
he result is the magnitude spectrum, calculated as:
Magnitude(𝑘) = sqrt(Real_Sum(𝑘)^2 + Imag_Sum(𝑘)^2)
This spectrum represents the strength of oscillations at each frequency over the lookback period, helping traders identify dominant cycles.
Visual Analysis & Interpretation
To give traders context for the FFT spectrum’s values, this script calculates:
25th Percentile (Purple Line)
Represents relatively low cyclical intensity.
Values below this threshold may signal quiet, noisy, or trendless periods.
75th Percentile (Red Line)
Represents heightened cyclical dominance.
Values above this threshold may indicate significant periodic activity and potential trend formation or rhythm in price action.
The FFT magnitude of the lowest frequency component (index 0) is plotted directly on the chart in teal. Observing how this signal fluctuates relative to its percentile bands provides a dynamic measure of cyclical market activity.
Chart examples
In this NYSE:CL chart, we see the regime of the price accurately described in the spectral analysis. We see the price above the 75th percentile continue to trend higher until it breaks back below.
In long trending markets like NYSE:PL has been, it can give a very good explanation of the strength. There was confidence to not switch regimes as we never crossed below the 75th percentile early in the move.
The script is also usable on the lower timeframes. There is no difference in the usability from the different timeframes.
Script Parameters
Lookback Value (N)
Default: 30
Defines how many bars of data to analyze. Larger N captures longer-term cycles but may smooth out shorter-term oscillations.
Altcoin Liquidity Flow Score - Big Moves Only//@version=6
indicator("Altcoin Liquidity Flow Score - Big Moves Only", overlay=false)
// Pull weekly macro data
walcl = request.security("FRED:WALCL", "W", close)
rrp = request.security("FRED:RRPONTSYD", "W", close)
tga = request.security("FRED:WDTGAL", "W", close)
hyg = request.security("AMEX:HYG", "W", close)
total3 = request.security("CRYPTOCAP:TOTAL3", "W", close)
usdt_d = request.security("CRYPTOCAP:USDT.D", "W", close)
// Calculate week-over-week change
delta_liquidity = ta.change(walcl + rrp - tga)
delta_rrp = ta.change(rrp)
delta_hyg = ta.change(hyg)
delta_total3 = ta.change(total3)
delta_usdt_d = ta.change(usdt_d)
// Compute raw score
raw_score = delta_liquidity - delta_rrp + delta_hyg + delta_total3 - delta_usdt_d
// Apply 3-week smoothing
score = ta.ema(raw_score, 3)
// Define threshold for major liquidity shift
threshold = 2.0
// Plot score + background for only strong signals
plot(score, title="Liquidity Flow Score (Smoothed)", color=color.teal, linewidth=2)
hline(0, "Zero Line", color=color.gray)
bgcolor(score > threshold ? color.new(color.green, 85) : score < -threshold ? color.new(color.red, 85) : na)
CipherMatrix Dashboard (MarketCipher B)Pre-compute MarketCipher-B values for each fixed timeframe (5 m, 15 m, 30 m, 60 m, 4 H, Daily).
Pass those values into plotRow() instead of calling request.security() inside the helper—removes the style warning.
Added explicit range parameters to table.clear(dash, 0, 0, 2, 6) to satisfy v6’s argument requirement.
This version should compile without the previous warnings/errors. Swap in your real MarketCipher-B histogram when you’re ready, and the dashboard is good to go!
Repeating Trend HighlighterThis custom indicator helps you see when the current price trend is similar to a past trend over the same number of candles. Think of it like checking whether the market is repeating itself.
You choose three settings:
• Lookback Period: This is how many candles you want to measure. For example, if you set it to 10, it looks at the price change over the last 10 bars.
• Offset Bars Ago: This tells the indicator how far back in time to look for a similar move. If you set it to 50, it compares the current move to what happened 50 bars earlier.
• Tolerance (%): This is how closely the moves must match to be considered similar. A smaller number means you only get a signal if the moves are almost the same, while a larger number allows more flexibility.
When the current price move is close enough to the past move you picked, the background of your chart turns light green. This makes it easy to spot repeating trends without studying numbers manually.
You’ll also see two lines under your chart if you enable them: a blue line showing the percentage change of the current move and an orange line showing the change in the past move. These help you compare visually.
This tool is useful in several ways. You can use it to confirm your trading setups, for example if you suspect that a strong rally or pullback is happening again. You can also use it to filter trades by combining it with other indicators, so you only enter when trends repeat. Many traders use it as a learning tool, experimenting with different lookback periods and offsets to understand how often similar moves happen.
If you are a scalper working on short timeframes, you can set the lookback to a small number like 3–5 bars. Swing traders who prefer daily or weekly charts might use longer lookbacks like 20–30 bars.
Keep in mind that this indicator doesn’t guarantee price will move the same way again—it only shows similarity in how price changed over time. It works best when you use it together with other signals or market context.
In short, it’s like having a simple spotlight that tells you: “This move looks a lot like what happened before.” You can then decide if you want to act on that information.
If you’d like, I can help you tweak the settings or combine it with alerts so it notifies you when these patterns appear.
Breakout LabelsThis script labels the highest price of the lowest candle over a period of time. It then labels any bullish breakouts where the close price is higher than the high of the lowest candle.
Panchak 369This indicator highlights Panchak Dates based on Vedic astrology, marking specific lunar dates (Tithis) that occur when the Moon transits from Dhanishta to Revati Nakshatra. These days are considered astrologically sensitive and are traditionally avoided for initiating important activities.
Nến Tô Màu Theo Volume / MA(21)Condition
Point color
Volume ≥ 3× MA(24)
Violet
Volume ≥ 1.5× MA(24)
Red
Volume < 1.5× MA(24) & bullish
White
Volume < 1.5× MA(24) & bearish
Black
Previous 10 Weekly Highs/Lows z s s bsf bsfd sfdv svdvvdsfvsdvsddvbadvvf zfvdzcxvdsfzv dfcvfdcxvsfdzvzdsfcx
15min intervalsindicator displays 4 15 minute intervals within the hour. this simple indicator can be used for effective scalping.
TVI-3 Z-Score: MA + VWAP + BB Composite🔧 Overview:
It combines:
Z-score of price relative to the 200-period simple moving average (MA)
Z-score of price relative to the 200-period VWAP (volume-weighted average price)
Z-score of Bollinger Band width
The result is an average of these three Z-scores, plotted as a composite indicator for identifying overvalued and undervalued conditions.
RSI For LoopTitle: RSI For Loop
SurgeQuant’s RSI with Threshold Colors and Bar Coloring indicator is a sophisticated tool designed to identify overbought and oversold conditions using a customizable Relative Strength Index (RSI). By averaging RSI over a user-defined lookback period, this indicator provides clear visual signals for bullish and bearish market conditions. The RSI line and price bars are dynamically colored to highlight momentum, making it easier for traders to spot potential trading opportunities.
How It Works
RSI Calculation:
Computes RSI based on a user-selected price source (Close, High, Low, or Open) with a configurable length (default: 5). Optional moving average smoothing refines the RSI signal for smoother analysis.
Lookback Averaging:
Averages the RSI over a user-defined lookback period (default: 5) to generate a stable momentum indicator, reducing noise and enhancing signal reliability.
Threshold-Based Signals:
Long Signal: Triggered when the averaged RSI exceeds the upper threshold (default: 52), indicating overbought conditions.
Short Signal: Triggered when the averaged RSI falls below the lower threshold (default: 48), indicating oversold conditions.
Visual Representation
The indicator provides a clear and customizable visual interface: Green RSI Line and Bars: Indicate overbought conditions when the averaged RSI surpasses the upper threshold, signaling potential long opportunities.
Red RSI Line and Bars: Indicate oversold conditions when the averaged RSI drops below the lower threshold, signaling potential short opportunities.
Neutral Gray RSI Line: Represents RSI values between thresholds for neutral market conditions.
Threshold Lines: Dashed gray lines mark the upper and lower thresholds on the RSI panel for easy reference.
Customization & Parameters
The RSI with Threshold Colors and Bar Coloring indicator offers flexible parameters to suit
various trading styles: Source: Select the input price (default: Close; options: Close, High, Low, Open).
RSI Length: Adjust the RSI calculation period (default: 5).
Smoothing: Enable/disable moving average smoothing (default: enabled) and set the smoothing length (default: 10).
Moving Average Type: Choose from multiple types (SMA, EMA, DEMA, TEMA, WMA, VWMA, SMMA, HMA, LSMA, ALMA; default: ALMA).
ALMA Sigma: Configure the ALMA smoothing parameter (default: 5).
Lookback Period: Set the period for averaging RSI (default: 5).
Thresholds: Customize the upper (default: 52) and lower (default: 48) thresholds for signal generation.
Color Settings: Transparent green and red colors (70% transparency) for bullish and bearish signals, with gray for neutral states.
Trading Applications
This indicator is versatile and can be applied across various markets and strategies: Momentum Trading: Highlights strong overbought or oversold conditions for potential entry or exit points.
Trend Confirmation: Use bar coloring to confirm RSI-based signals with price action on the main chart.
Reversal Detection: Identify potential reversals when RSI crosses the customizable thresholds.
Scalping and Swing Trading: Adjust parameters (e.g., RSI length, lookback) to suit short-term or longer-term strategies.
Final Note
SurgeQuant’s RSI with Threshold Colors and Bar Coloring indicator is a powerful tool for traders seeking to leverage RSI for momentum and reversal opportunities. Its combination of lookback-averaged RSI, dynamic threshold signals, and synchronized RSI and bar coloring offers a robust framework for informed trading decisions. As with all indicators, backtest thoroughly and integrate into a comprehensive trading strategy for optimal results.
Short-Term Holder MVRVThis script calculates and visualizes the Market Value to Realized Value (MVRV) ratio for Bitcoin, specifically focusing on short-term holders (STH). The MVRV ratio is a key on-chain metric that compares Bitcoin's market cap to its realized cap (the aggregate cost basis of all coins). It helps traders identify overbought and oversold conditions in the market.
Key Features
1. Moving Averages (Customizable)
The script allows users to apply different moving averages to smooth the MVRV data:
EMA (Exponential Moving Average)
SMA (Simple Moving Average)
SMMA/RMA (Smoothed/Rolling Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume-Weighted Moving Average)
HMA (Hull Moving Average)
2. Core Calculation
Fetches BTC_MVRV data from TradingView's security function.
Computes a moving average (default: 238-period WMA) of the MVRV values.
Calculates the Ratio_MVRV as:
text
Ratio_MVRV = Current MVRV / Moving Average of MVRV
A bullish signal is generated when Ratio_MVRV > 1 (market is heating up).
A bearish signal is generated when Ratio_MVRV < 1 (market is cooling down).
3. Visual Output
Main Plot:
A line chart showing Ratio_MVRV.
Orange when bullish (Ratio_MVRV > 1).
Purple when bearish (Ratio_MVRV < 1).
Horizontal Line:
A dotted white line at 1.0, acting as a threshold.
Table Display:
A small table in the top-right corner showing "↑ Bull" (green) or "↓ Bear" (red) based on the current market state.
4. Alerts
Triggers TradingView alerts when the market state changes between bullish and bearish.
Interpretation & Trading Signals
When Ratio_MVRV > 1 (Bullish):
Suggests Bitcoin is gaining momentum, possibly entering an overbought phase.
Could indicate a good time to hold or accumulate, but extreme highs may signal a potential top.
When Ratio_MVRV < 1 (Bearish):
Suggests Bitcoin is undervalued, possibly in an oversold phase.
Could indicate a buying opportunity, but prolonged lows may signal further downside.
Default Settings & Customization
Length: 238 (adjustable, default based on common long-term trend analysis).
Moving Average Type: WMA (Weighted Moving Average).
Users can modify these settings in the Inputs menu in TradingView.
Use Case
Helps traders identify market cycles by tracking short-term holder behavior.
Works best as a confirmation tool alongside other indicators (e.g., RSI, MACD).
Useful for swing traders and long-term investors looking for trend reversals.
Day and DateA simple indicator that show day and date at the start of each day. This is usefull in case you are downloading charts or get confused when studying past charts for expiry and non expiry day actions.
Previous 10 Weekly Highs/LowsNewer vweionnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Previous 10 Weekly Highs/LowscilcvieowhvioewfvhgweiofgheaoifgascvgaucgfvUfgiocfgacfbaofcgaeo8gfhhfioqlkea
BTC 现货与期货溢价指数█ Overview / 核心理念
This indicator measures the price difference between the Spot and Futures markets to reveal the true driver of market momentum.
本指标通过衡量现货与期货市场的价格差异,旨在揭示市场动能的真实驱动力。
It helps you answer a key question: Is the current trend driven by solid institutional spot buying or by speculative sentiment in the futures market?
它帮助您回答一个关键问题:当前趋势是由坚实的机构现货买盘驱动,还是由期货市场的投机情绪主导?
█ Core Logic & Calculation / 核心计算逻辑
The core logic is simple yet powerful: Premium = Spot Price - Futures Price.
其核心逻辑简单而强大:溢价 = 现货价格 - 期货价格。
Positive Value (Green Bars): "Spot Premium"
正值 (绿色柱): “现货溢价”
This means the spot price is higher than the futures price. It's a strong bullish signal, suggesting significant spot buying pressure, likely from institutions.
这意味着现货价格高于期货价格。这是一个强烈的看涨信号,通常意味着存在巨大的现货买盘压力,可能来自机构。
Negative Value (Red Bars): "Futures Premium"
负值 (红色柱): “期货溢价”
This means the futures price is higher than the spot price. It indicates that bullish sentiment is more concentrated in the futures market, or that there is selling pressure in the spot market.
这意味着期货价格高于现货价格。这表明看涨情绪更多地集中在期货市场,或现货市场存在抛售压力。
█ How to Read the Chart / 如何解读图表
Premium Histogram / 溢价柱状图
The height of the bars represents the magnitude of the price difference. Taller bars indicate a greater divergence between the two markets and more extreme sentiment.
柱体的高度代表了价格差异的大小。柱体越高,意味着两个市场之间的分歧越大,情绪越极端。
Zero Line / 零轴
This is the watershed between spot-led and futures-led dominance.
这是现货主导与期货主导的分水岭。
Info Panel / 信息面板
A real-time display in the top-right corner shows the current Spot Price, Futures Price, and the precise Premium value.
位于右上角的信息面板,实时显示当前的现货价格、期货价格以及精确的溢价数值。
█ Trading Strategies & Advanced Interpretation / 交易策略与高级解读
The essence of this indicator lies in analyzing the synergy and divergence between price action and premium changes to identify the dominant market force.
本指标的精髓在于结合价格行为与溢价变化,判断出当前主导市场是现货还是期货,从而进行同步或背离分析。
█ Alert System / 警报系统
The indicator includes two built-in alerts based on Bollinger Bands to catch extreme sentiment.
本指标包含两个基于布林带的内置警报,用以捕捉极端情绪。
Spot Premium Too High (Cross Up):
现货溢价过高 (向上突破):
Triggers when the green premium bar breaks above the upper Bollinger Band. It signals that spot buying has become excessively "euphoric" and may be due for a short-term cooldown.
当绿色溢价柱向上突破布林带上轨时触发。这标志着现货买盘已进入极度的“狂热”状态,短期内可能面临回调。
Futures Premium Too High / Spot Selling Pressure (Cross Down):
期货溢价过高 / 现货抛压 (向下突破):
Triggers when the premium bar breaks below the lower Bollinger Band (deeply negative). It signals intense spot selling pressure or panic, confirming strong bearish sentiment.
当溢价柱向下突破布林带下轨(负值极大)时触发。这标志着强烈的现货抛压或市场恐慌,是看跌情绪强烈的确认信号。
█ Disclaimer / 免责声明
This tool is based on the theory that the spot market has a dominant influence on major trends. Its effectiveness depends on this condition holding true.
本工具的理论基础是“现货市场对主要趋势具有主导影响力”。其有效性取决于该条件的成立。
This indicator is for educational and research purposes only. It does not constitute financial advice. Please use it in conjunction with your own trading system and risk management.
本指标仅用于教育和研究目的,不构成任何财务建议。请结合您自己的交易系统和风险管理进行使用。
Author ID:We1h0.eth
Author X:https://x.com/we1h0