Gold–Bitcoin Correlation (Offset Model) by KManus88This indicator analyzes the correlation between Gold (XAU/USD) and Bitcoin (BTC/USD) using a time-offset model adjustable by the user.
The goal is to detect cyclical leads or lags between both assets, highlighting how capital flows into Gold may precede or follow movements in the crypto market.
Key Features:
Dynamic correlation calculation between Gold and Bitcoin.
Adjustable offset in days (default: 107) to fine-tune the temporal shift.
Automatic labels and on-chart visualization.
Compatible with multiple timeframes and logarithmic scales.
Interpretation:
Positive correlation suggests synchronized trends between both assets.
Negative correlation signals divergence or rotation of liquidity.
The time-offset parameter helps estimate when a shift in Gold could later reflect in Bitcoin.
Recommended use:
For macro-financial and global liquidity cycle analysis.
As a complementary tool in cross-asset momentum strategies.
© 2025 – Developed by KManus88 | Inspired by monetary correlation studies and global liquidity cycles.
This script is for educational purposes only and does not constitute financial advice.
Ciclos
Adaptive Pulse Frequency & Amplitude TrendAdaptive Pulse Frequency & Amplitude Trend Indicator
This Pine Script indicator is designed to identify strong bullish or bearish trends by analyzing volume dynamics on a lower timeframe than the one currently displayed on the chart. It operates on the principle of detecting significant spikes in buying or selling pressure, referred to as "pulses," and then evaluating their frequency, strength, and dominance over the opposing market forces.
Core Concepts
Lower Timeframe Volume Analysis: The script requests up-volume and down-volume data from a more granular, lower timeframe (e.g., 1-minute data when on a 15-minute chart). This provides a higher-resolution view of the flow of buy and sell orders.
Adaptive Pulse Detection: A "pulse" is defined as a bar with an unusually high net volume (up volume minus down volume). Instead of using a fixed value, the indicator calculates an adaptive threshold based on the 90th percentile of net volume over a 100-bar lookback period. Any bar with a net volume exceeding this dynamic threshold is flagged as a pulse, categorized as either bullish (positive net volume) or bearish (negative net volume).
Frequency and Amplitude: The indicator measures two key aspects of these pulses over user-defined lookback periods:
Net Frequency: The number of bullish pulses minus the number of bearish pulses. A positive value indicates more buying pulses, while a negative value indicates more selling pulses.
Net Amplitude : The cumulative volume of bullish pulses minus the cumulative volume of bearish pulses. This measures the overall strength and conviction behind the pulses.
Primary Trend Signal
The indicator's primary signal comes from a strict dominance condition. It doesn't just look for more buying or selling pulses; it checks if these pulses are powerful enough to overwhelm the total opposite pressure in the market.
Bullish Dominance (Green Background): A strong bullish signal is generated when the total volume of all bullish pulses within a lookback period is greater than the total down-volume from all bars (not just pulses) in that same period.
Bearish Dominance (Red Background): A strong bearish signal is generated when the total volume of all bearish pulses is greater than the total up-volume from all bars in that period.
The chart background is colored green for bullish dominance and red for bearish dominance, providing a clear visual cue for when one side has taken decisive control.
Plotted Data
In addition to the background coloring, the indicator plots several lines in its own pane for more detailed analysis:
Net Frequency: Shows the trend in the number of bull vs. bear pulses.
Net Amplitude: Shows the trend in the strength of bull vs. bear pulses.
Bullish/Bearish Amplitude: The individual cumulative volumes for bull and bear pulses.
Dynamic Threshold: The adaptive value used to identify pulses.
By combining an adaptive detection method with a strict dominance condition, this tool aims to filter out market noise and highlight periods of genuinely strong, volume-backed trends.
Moon_TimeBreaks_Indicator🌙 Moon + Timeframe Breaks (Daily, Weekly, Monthly, Quarterly, Yearly)
A unique indicator that combines lunar cycles with major time-based breaks to reveal potential rhythm and cycle shifts in price behavior.
🔹 Features
Displays New Moon and Full Moon phases directly on the chart.
Highlights background color during lunar events.
Draws dynamic timeframe separators for Day, Week, Month, Quarter, and Year.
Helps identify cyclical turning points and time-based reactions in markets.
🔹 Customization
Toggle moon phases, background, or time breaks individually.
Adjust colors for each period (daily, weekly, etc.).
Works on all instruments and timeframes.
🔹 Use Case
Perfect for traders interested in time-price harmony, cyclical analysis, or astro-based market timing.
It pairs well with structure or liquidity tools to enhance timing accuracy.
EMA 3-6-50 Crossover (Lenin77)The 3-6-50 EMA Crossover indicator is based on the use of three exponential moving averages (EMAs) of different lengths:
3-6-50 EMA: reflects the most recent price movements (very sensitive).
6-6-50 EMA: slightly smooths out short-term fluctuations.
50-50 EMA: represents the overall medium-term market trend.
The main objective of this indicator is to detect trend changes by the crossing of the shorter moving averages (3-6-50 EMA) above or below the 50-50 EMA.
⚙️ Working Logic
Bullish Cross:
Occurs when the shorter EMAs (3-6-50 EMA) cross the 50-50 EMA from below.
This crossover suggests that price momentum is shifting toward an uptrend, so it may be an opportunity to enter a buy position.
Sell Signal (Bearish Cross):
Generated when the short EMAs cross the 50 EMA from above.
It indicates that bearish momentum dominates the market and could be a good entry or exit point for short.
Visual Representation:
The chart shows the three EMAs in different colors for easy reading (green, orange, and blue).
At the crossover points, labels appear with the text BUY or SELL, indicating potential entry zones.
Optionally, the background can be colored to highlight the trend change and trigger automatic alerts.
Historical Vertical Lines 17:00-20:30Historical Vertical Lines 17:00-20:30. These lines show this specific time. You can edit the times via pine script. Easy.
Cyclical Phases of the Market🧭 Overview
“Cyclical Phases of the Market” automatically detects major market cycles by connecting swing lows and measuring the average number of bars between them.
Once it learns the rhythm of past cycles, it projects the next expected cycle (in time and price) using a dashed orange line and a forecast label.
In simple terms:
The indicator shows where the next potential low is statistically expected to occur, based on the timing and depth of previous cycles.
⚙️ Core Logic – Step by Step
1️⃣ Pivot Detection
The script uses the built-in ta.pivotlow() and ta.pivothigh() functions to find local turning points:
pivotLow marks a local swing low, defined by pivotLeft and pivotRight bars on each side.
Only confirmed lows are used to define the major cycle points.
Each new pivot low is stored in two arrays:
cycleLows → price level of the low
cycleBars → bar index where the low occurred
2️⃣ Cycle Identification and Drawing
Every time two consecutive swing lows are found, the indicator:
Calculates the number of bars between them (cycle length).
If that distance is greater than or equal to minCycleBars, it draws a teal line connecting the two lows — visually representing one complete cycle.
These teal lines form the historical cycle structure of the market.
3️⃣ Average Cycle Length
Once there are at least three completed cycles, the script calculates the average duration (mean number of bars between lows).
This value — avgCycleLength — represents the dominant periodicity or cycle rhythm of the market.
4️⃣ Forecasting the Next Cycle
When a valid average cycle length exists, the model projects the next expected cycle:
Time projection:
Adds avgCycleLength to the last cycle’s ending bar index to find where the next low should occur.
Price projection:
Estimates the vertical amplitude by taking the difference between the last two cycle lows (priceDiff).
Adds this same difference to the last low price to forecast the next probable low level.
The result is drawn as an orange dashed line extending into the future, representing the Next Expected Cycle.
5️⃣ Forecast Label
An orange label 🔮 appears at the projected future point showing:
Text:
🔮 Upcoming Cycle Forecast
Price:
The label marks the probable area and timing of the next cyclical low.
(Note: the date/time calculation currently multiplies bar count by 7 days, so it’s designed mainly for daily charts. On other timeframes, that conversion can be adapted.)
📊 How to Read It on the Chart
Visual Element Meaning Interpretation
Teal lines Completed historical cycles (low to low) Show actual periodic rhythm of the market
Orange dashed line Projection of the next expected cycle Anticipated path toward the next cyclical low
Orange label 🔮 Upcoming Cycle Forecast Displays expected price and bar location
Average cycle length Internal variable (bars between lows) Represents the dominant cycle period
📈 Interpretation
When teal segments show consistent spacing, the market is following a stable rhythm → cycles are predictable.
When cycle spacing shortens, the market is accelerating (volatility rising).
When it widens, the market is slowing down or entering accumulation.
The orange dashed line represents the next expected low zone:
If the market drops near this line → cyclical pattern confirmed.
If the market breaks well below → cycle amplitude has increased (trend weakening).
If the market rises above and delays → a new longer cycle may be forming.
🧠 Practical Use
Combine with oscillators (e.g., RSI or TSI) to confirm momentum alignment near projected lows.
Use in conjunction with volume to identify accumulation or exhaustion near the expected turning point.
Compare across timeframes: weekly cycles confirm long-term rhythm; daily cycles refine short-term entries.
⚡ Summary
Aspect Description
Purpose Detect and forecast recurring market cycles
Cycle basis Low-to-Low pivot analysis
Visuals Teal historical cycles + Orange forecast line
Forecast Next expected low (price and time)
Ideal timeframe Daily
Main outputs Average cycle length, next projected cycle, visual cycle map
Fair Value Lead-Lag Model [BackQuant]Fair Value Lead-Lag Model
A cross-asset model that estimates where price "should" be relative to a chosen reference series, then tracks the deviation as a normalized oscillator. It helps you answer two questions: 1) is the asset rich or cheap vs its driver, and 2) is the driver leading or lagging price over the next N bars.
Concept in one paragraph
Many assets co-move with a macro or sector driver. Think BTC vs DXY, gold vs real yields, a stock vs its sector ETF. This tool builds a rolling fair value of the charted asset from a reference series and shows how far price is above or below that fair value in standard deviation units. You can shift the reference forward or backward to test who leads whom, then use the deviation and its bands to structure mean-reversion or trend-following ideas.
What the model does
Reference mapping : Pulls a reference symbol at a chosen timeframe, with an optional lead or lag in bars to test causality.
Fair value engine : Converts the reference into a synthetic fair value of the chart using one of four methods:
Ratio : price/ref with a rolling average ratio. Good when the relationship is proportional.
Spread : price minus ref with a rolling average spread. Good when the relationship is additive.
Z-Score : normalizes both series, aligns on standardized units, then re-projects to price space. Good when scale drifts.
Beta-Adjusted : rolling regression style. Uses covariance and variance to compute beta, then builds a fair value = mean(price) + beta * (ref − mean(ref)).
Deviation and bands : Computes a z-scored deviation of price vs fair value and plots sigma bands (±1, ±2, ±3) around the fair value line on the chart.
Correlation context : Shows rolling correlation so you can judge if deviations are meaningful or just noise when co-movement is weak.
Visuals :
Fair value line on price chart with sigma envelopes.
Deviation as a column oscillator and optional line.
Threshold shading beyond user-set upper and lower levels.
Summary table with reference, deviation, status, correlation, and method.
Why this is useful
Mean reversion framework : When correlation is healthy and deviation stretches beyond your sigma threshold, probability favors reversion toward fair value. This is classic pairs logic adapted to a driver and a target.
Trend confirmation : If price rides the fair value line and deviation stays modest while correlation is positive, it supports trend persistence. Pullbacks to negative deviation in an uptrend can be buyable.
Lead-lag discovery : Shift the reference forward by +N bars. If correlation improves, the reference tends to lead. Shift backward for the reverse. Use the best setting for planning early entries or hedges.
Regime detection : Large persistent deviations with falling correlation hint at regime change. The relationship you relied on may be breaking down, so reduce confidence or switch methods.
How to use it step by step
Pick a sensible reference : Choose a macro, index, currency, or sector driver that logically explains the asset’s moves. Example: gold with DXY, a semiconductor stock with SOXX.
Test lead-lag : Nudge Lead/Lag Periods to small positive values like +1 to +5 to see if the reference leads. If correlation improves, keep that offset. If correlation worsens, try a small negative value or zero.
Select a method :
Start with Beta-Adjusted when the relationship is approximately linear with drift.
Use Ratio if the assets usually move in proportional terms.
Use Spread when they trade around a level difference.
Use Z-Score when scales wander or volatility regimes shift.
Tune windows :
Rolling Window controls how quickly fair value adapts. Shorter equals faster but noisier.
Normalization Period controls how deviations are standardized. Longer equals stabler sigma sizing.
Correlation Length controls how co-movement is measured. Keep it near the fair value window.
Trade the edges :
Mean reversion idea : Wait for deviation beyond your Upper or Lower Threshold with positive correlation. Fade back toward fair value. Exit at the fair value line or the next inner sigma band.
Trend idea : In an uptrend, buy pullbacks when deviation dips negative but correlation remains healthy. In a downtrend, sell bounces when deviation spikes positive.
Read the table : Deviation shows how many sigmas you are from fair value. Status tells you overvalued or undervalued. Correlation color hints confidence. Method tells you the projection style used.
Reading the display
Fair value line on price chart: the model’s estimate of where price should trade given the reference, updated each bar.
Sigma bands around fair value: a quick sense of residual volatility. Reversions often target inner bands first.
Deviation oscillator : above zero means rich vs fair value, below zero means cheap. Color bins intensify with distance.
Correlation line (optional): scale is folded to match thresholds. Higher values increase trust in deviations.
Parameter tips
Start with Rolling Window 20 to 30, Normalization Period 100, Correlation Length 50.
Upper and Lower Threshold at ±2.0 are classic. Tighten to ±1.5 for more signals or widen to ±2.5 to focus on outliers.
When correlation drifts below about 0.3, treat deviations with caution. Consider switching method or reference.
If the fair value line whipsaws, increase Rolling Window or move to Beta-Adjusted which tends to be smoother.
Playbook examples
Pairs-style reversion : Asset is +2.3 sigma rich vs reference, correlation 0.65, trend flat. Short the deviation back toward fair value. Cover near the fair value line or +1 sigma.
Pro-trend pullback : Uptrend with correlation 0.7. Deviation dips to −1.2 sigma while price sits near the −1 sigma band. Buy the dip, target the fair value line, trail if the line is rising.
Lead-lag timing : Reference leads by +3 bars with improved correlation. Use reference swings as early cues to anticipate deviation turns on the target.
Caveats
The model assumes a stable relationship over the chosen windows. Structural breaks, policy shocks, and index rebalances can invalidate recent history.
Correlation is descriptive, not causal. A strong correlation does not guarantee future convergence.
Do not force trades when the reference has low liquidity or mismatched hours. Use a reference timeframe that captures real overlap.
Bottom line
This tool turns a loose cross-asset intuition into a quantified, visual fair value map. It gives you a consistent way to find rich or cheap conditions, time mean-reversion toward a statistically grounded target, and confirm or fade trends when the driver agrees.
NY 4H Wyckoff State Machine [CHE] NY 4H Wyckoff State Machine — Full (Re-Entry, Breakout, Wick, Re-Accum/Distrib, Dynamic Table) — One-Candle Wyckoff Re-Entry (OCWR)
Summary
OCWR operationalizes a one-candle session workflow: mark the first four-hour New York candle, fix its high and low as the session range when the window closes, and drive entries through a Wyckoff-style state machine on intraday bars. The script adds an ATR-scaled buffer around the range and requires multi-bar acceptance before treating breaks or re-entries as valid. Optional wick-cluster evidence, a proximity retest, and simple volume or RSI gates increase selectivity. Background tints expose regimes, shapes mark events, a dynamic table explains the current state, and hidden plots supply alert payloads. The design reduces random flips and makes state transitions auditable without higher-timeframe calls.
Origin and name
Method name: One-Candle Wyckoff Re-Entry (OCWR)
Transcript origin: The source idea is a “stupid simple one-candle scalping” routine: mark the first New York four-hour candle (commonly between one and five in the morning New York time), drop to five minutes, observe accumulation inside, wait for a manipulation move outside, then trade the re-entry back inside. Stops go beyond the excursion extreme; targets are either a fixed reward multiple or the opposite side of the range. Preference is given to several manipulation candles. This indicator codifies that workflow with explicit states, acceptance counters, buffers, and optional quality filters. Any external performance claims are not part of the code.
Motivation: Why this design?
Session levels are widely respected, yet single-bar breaches around them are noisy. OCWR separates range discovery from trade logic. It locks the range at the end of the window, applies an ATR-scaled buffer to ignore marginal oversteps, and requires acceptance over several bars for breaks and re-entries. Wick evidence and optional retest proximity help confirm that an excursion likely cleared liquidity rather than launched a trend. This yields cleaner transitions from test to commitment.
What’s different vs. standard approaches?
Baseline: Static session lines or one-shot Wyckoff tags without process control.
Architecture: Dual long and short state machines; ATR-buffered edges; multi-bar acceptance for breaks and re-entries; optional wick dominance and cluster checks; optional retest tolerance; direct and opposite breakout paths; cooldown after fires; distribution timeout; dynamic table with highlighted row.
Practical effect: Fewer single-bar head-fakes, clearer hand-offs, and on-chart explanations of the machine’s view.
Wyckoff structure by example — OCWR on five minutes
One-candle setup:
On the four-hour chart, mark the first New York candle’s high and low, then switch to five minutes. Solid lines show the fixed range; dashed lines show ATR-buffered edges.
Long path (verbal mapping):
Phase A, Stopping Action: Price stabilizes inside the range.
Phase B, Consolidation: Sustained balance while the window is closed and after the range is fixed.
Phase C, Test (Spring): Excursion below the buffered low with preference for several outside bars and dominant lower wicks, then a return inside.
Re-entry acceptance: A required run of inside bars validates the test.
Phase D, Breakout to Markup: Long signal fires; stop beyond the excursion extreme; objective is the opposite range or a fixed reward multiple.
Phase E, Trend (Markup) and Re-Accumulation: Advance continues until target, stop, confirmation back against the box, or timeout. A pause inside trend may register as re-accumulation.
Short path mirrors the above: A UTAD-style move forms above the buffered high, then re-entry leads to Markdown and possible re-distribution.
Variant map (verbal):
Accumulation after a downtrend: with Spring and Test, or without Spring; both proceed to Markup and may pause in Re-Accumulation.
Distribution after an uptrend: with UTAD and Test, or without UTAD; both proceed to Markdown and may pause in Re-Distribution.
Note: Phases A through E occur within each variant and are not separate variants.
How it works (technical)
Session window: A configurable four-hour New York window records its high and low. At window end, the bounds are fixed for the session.
ATR buffer: A margin above and below the fixed range discourages triggers from tiny oversteps.
Inside and outside: Users choose close-based or wick-based detection. Overshoot requirements are expressed verbally as a fraction of the range with an optional absolute minimum.
Manipulation tracking: The machine counts bars spent outside and records the side extreme.
Re-entry acceptance: After a return inside, a specified number of inside bars must print before acceptance.
Direct and opposite breakouts: Direct breakouts from accumulation and opposite breakouts after manipulation are supported, subject to acceptance and optional filters.
Targets and exits: Choose the opposite boundary or a fixed reward multiple. Distribution ends on target, stop, confirmation back against the range, or timeout.
Context filters (optional): Volume above a scaled SMA, RSI thresholds, and a trend SMA for simple regime context.
Diagnostics: Background tints for regimes; arrows for re-entries; triangles for breakouts; table with row highlights; hidden plots for alert values.
Central table (Wyckoff console)
The table sits top-right and explains the machine’s stance. Columns: Structure label, plain-English description, active state pair for long and short, and human phase tags. Rows: Start and range building; accumulation branch with Spring and Test as well as direct breakout; Markup and re-accumulation; distribution branch with UTAD and Test as well as direct short breakout; Markdown and re-distribution. Only the active state cell is rewritten each last bar, for example “L_ACCUM slash S_ACCUM”. Row highlighting is context-aware: accumulation, Spring or UTAD, breakout, Markup or Markdown, and re-accumulation or re-distribution checks can highlight independently so users see simultaneous conditions. The table is created once, updated only on the last bar for efficiency, and functions as a read-only console to audit why a signal fired and where the path currently sits.
Parameter Guide
Session window and time zone: First four hours of New York by default; time zone “America/New_York”.
ATR length and buffer factor: Control buffer size; larger reduces sensitivity, smaller reacts faster.
Minimum overshoot (fraction and absolute): Demand meaningful extension beyond the buffer.
Break mode: Close-based is stricter; wick-based is more reactive.
Acceptance counts: Separate counts for break, re-entry, and opposite breakout; higher values reduce noise.
Minimum bars outside: Ensures manipulation is not a single spike.
Wick detection and clusters (optional): Dominance thresholds and cluster size within a short window.
Retest required and tolerance (optional): Gate re-entry by proximity to the buffered edge.
Volume and RSI filters (optional): Simple gates on activity and momentum.
TP mode and reward multiple: Opposite range or fixed multiple.
Cooldown and distribution timeout: Rate-limit signals and prevent endless distribution.
Visualization toggles: Background phases, labels, table, and helper lines.
Reading & Interpretation
Solid lines are the fixed session bounds; dashed lines are buffers. Backgrounds tint accumulation, manipulation, and distribution. Arrows show accepted re-entries; triangles show direct or opposite breakouts. Labels can summarize entry, stop, target, and risk. The table highlights the active row and the current state pair.
Practical Workflows & Combinations
OCWR baseline: Each morning, mark the New York four-hour candle, move to five minutes, prefer multi-bar manipulation outside, then wait for a qualified re-entry inside. Stop beyond the excursion extreme. Target the opposite range for conservative management or a fixed multiple for uniform sizing.
Trend following: Favor direct breakouts with trend alignment and no contradictory wick evidence.
Quality control: When noise rises, increase acceptance, raise the buffer factor, enable retest, and require wick clusters.
Discretionary confluences: Fair-value gaps and trend lines can be added by the user; they are not computed by this script.
Behavior, Constraints & Performance
Closed-bar confirmation is recommended when you require finality; live-bar conditions can change until close. The script does not call higher-timeframe data. It uses arrays, lines, labels, boxes, and a table; maximum bars back is five thousand; table updates are last-bar only. Known limits include compressed buffers in quiet sessions, unreliable wick evidence in thin markets, and session misalignment if the platform time zone is not New York.
Sensible Defaults & Quick Tuning
Start with ATR length fourteen, buffer factor near zero point fifteen, overshoot fraction near zero point ten, acceptance counts of two, minimum outside duration three, retest required on.
Too many flips: increase acceptance, raise buffer, enable retest, and tighten wick thresholds.
Too slow: reduce acceptance, lower buffer, switch to wick-based breaks, disable retest.
Noisy wicks: increase minimum wick ratio and cluster size, or disable wick detection.
What this indicator is—and isn’t
A session-anchored visualization and signal layer that formalizes a Wyckoff-style re-entry and breakout workflow derived from a single four-hour New York candle. It is not predictive and not a complete trading system. Use with structure analysis, risk controls, and position management.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
CVD Divergence + Volume MarkerHere is a Pine Script concept to mark candlestick chart candles when cumulative delta is divergent to price action and volume is above average. Cumulative delta divergence typically occurs when the price forms new highs/lows while cumulative delta forms lower highs/lows (or vice versa). The script should include a marker only when this divergence occurs alongside above-average volume, increasing signal strength and filtering out weak setups.
Coding Concept
Calculate cumulative delta (approximation using price and volume if true bid/ask volume is unavailable, e.g., on spot).
Calculate moving average of volume.
Detect bullish divergence (price makes lower low, cumulative delta makes higher low) and bearish divergence (price makes higher high, cumulative delta makes lower high).
Mark candle with above-average volume when divergence is present.
Trading Lab 15m ORB Trading Lab: Sessions 15m ORB – Boxes + Breakout Entries/Exits (Tokyo/London/NY)
Torus Trend Bands — Windowed HammingTorus Trend Bands — Windowed Hamming
This TradingView indicator creates dynamic support and resistance bands on your chart. It uses the mathematical model of a torus (a donut shape) to generate cyclical and responsive channel boundaries. The bands are further refined with an advanced smoothing method called a Hamming window to reduce noise and provide a clearer signal.
How It Works
The Torus Model: The indicator maps price action onto a geometric torus shape. This is defined by two key parameters:
Major Radius (a): The distance from the center of the torus to the center of the tube. This controls the overall size and primary cycle.
Minor Radius (b): The radius of the tube itself. This controls the secondary, faster "breathing" motion of the bands.
Dual-Phase Engine: The behavior of the bands is driven by two different cyclical inputs, or "phases":
Major Rotation (φ): A slow, time-based cycle (φ period) that governs the long-term oscillation of the bands.
Minor Rotation (q): A fast, momentum-based cycle derived from the Relative Strength Index (RSI). This makes the bands react quickly to price momentum, expanding and contracting as the market becomes overbought or oversold.
Standard Technical Core : The torus model is anchored to the price chart using standard indicators:
Midline : A central moving average that acts as the baseline for the channel. You can choose from EMA, SMA, HMA, or VWAP.
Width Source: A volatility measure that determines the fundamental width of the bands. You can choose between the Average True Range (ATR) or Standard Deviation.
Hamming Window Smoothing: This is a sophisticated weighted averaging technique (a Finite Impulse Response filter) used in digital signal processing. It provides exceptionally smooth results with less lag than traditional moving averages. You can apply this smoothing to the RSI, the midline, and the width source independently to filter out market noise.
How to Interpret and Use the Indicator
Dynamic Support & Resistance: The primary use is to identify potential reversal or continuation points. The upper band acts as dynamic resistance, and the lower band acts as dynamic support.
Trend Identification: The color of the bands helps you quickly see the current trend. Teal bands indicate an uptrend (the midline is rising), while red bands indicate a downtrend (the midline is falling).
Volatility Gauge: When the bands widen, it signals an increase in market volatility. When they contract, it suggests volatility is decreasing.
Alerts: The indicator includes built-in alerts that can notify you when the price touches or breaks through the upper or lower bands, helping you stay on top of key price action.
Key Settings
Torus Parameters : Adjust Major radius a and Minor radius b to change the shape and cyclical behavior of the bands.
Phase Controls:
φ period: Controls the length of the main, slow cycle in bars.
RSI length → q: Sets the lookback for the RSI that drives the momentum-based cycle.
Midline & Width: Choose the type and length for the central moving average and the volatility source (ATR/StDev) that best fits your trading style.
Width & Bias Shaping:
Min/Max width ×: Control how much the bands expand and contract.
Bias ×: Shifts the entire channel up or down based on RSI momentum, helping the bands better capture strong trends.
Hamming Controls: Enable or disable the advanced smoothing on different parts of the indicator and set the Hamming length (a longer length results in more smoothing).
This indicator provides a unique and highly customizable way to visualize market cycles, volatility, and trend, combining geometry with proven technical analysis tools.
US Sentiment DashBoard [MaYsTrO]A fast, options-ready market dashboard that turns volatility, credit/liquidity, rotation, breadth, and macro tone into clear entries, risk triggers, and position size—without guesswork.
What it does
US Sentiment Board condenses the market’s moving parts into a single view designed specifically for call/put decisioning:
Regime & Core Trend – quick read on the major indices’ health.
Volatility + Structure Recommender – suggests Long Calls / Debit Spreads / Calendars based on IV state and term structure.
Liquidity Gate (PASS/WARN) – blends credit, USD, and rates into a single green-light.
Sector Rotation – shows where money is rotating so you focus long risk where it’s welcomed.
Breadth & Participation – gauges how many stocks are actually joining the move.
Macro & Safety – keeps a quiet eye on risk proxies without clutter.
Quick Alerts – simple “pay attention now” flags when conditions deteriorate.
Entry Checklist – one clean row that must be ✅ for new long calls.
Options Score → Position Size – converts the whole board into Full / Half / Probe / No Long Calls.
All logic is protected; the board shows results, not the recipe.
Who it’s for
Active traders who:
Trade single-name calls or index/sector options and want a pre-trade checklist.
Need a liquidity and volatility sanity check before pressing buy.
Prefer rules over vibes—with a dashboard that’s fast to read.
How to use it (quick start)
Glance at Market Mood and Core Trend to know if the wind is at your back.
Check Volatility and the Structure Recommender (calls vs. spreads vs. calendars).
Confirm the Liquidity Gate is PASS.
Make sure your target sector appears in Rotation (leaders > laggards).
Ensure Breadth supports the move.
Only enter when the Entry Checklist shows ✅.
Size the trade by the Options Score → Position Size row.
Works on
Any chart. Internally blends daily trend context with live data for “today” reads.
No user parameters needed; layout/visibility toggles are available for convenience.
Key notes
User must have the Ultimate TV plan in order of the indicator to work.
No repaint; signals confirm on bar close for the relevant timeframe.
The board does not place trades. It’s a decision aid for your own execution plan.
Data is subject to each symbol’s exchange feed and TradingView availability.
Support
Questions or access requests? DM MaYsTrO on TradingView.
Tags
sentiment, breadth, volatility, credit, rotation, options, risk, dashboard, liquidity
Disclaimer
This script is for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any security or derivative. Trading involves risk, including the risk of loss. Past performance does not guarantee future results. You are solely responsible for your trading decisions and risk management. The author assumes no liability for any losses or damages resulting from the use of this script.
Protected code. Redistribution, modification, re-uploading, or derivative works are prohibited without the author’s written permission.
Business Predictability | Robinhodl21Have you ever wondered why a company beats earnings estimates yet its stock barely moves—or even drops? It might be because the market already expected a beat. Companies that consistently outperform forecasts tend to attract higher expectations over time, so another “+20 % surprise” may no longer surprise anyone. In other cases, investors may weigh sales growth more heavily than earnings, especially in growth sectors where top-line momentum matters more than margin control.
This indicator was built to explore exactly that dynamic. It helps you quantify how predictable a business truly is, how consistently it beats (or misses) expectations, and how well management seems to understand and guide its own performance. It’s not a timing tool, but a quality lens for long-term stock pickers who want to identify stable, well-managed companies with disciplined forecasting and execution.
What the indicator is
its is designed to quantify how often and how well a company beats-or-misses expectations (earnings and sales) over multiple years, then map that into a “predictability” and “quantile” score that you can use to compare across stocks. Its core logic combines deviation from estimates, rolling history, and statistical ranking to highlight companies where the management and the business appear to be aligned, stable and reliable.
Key features:
(• Choice of financial data frequency: you can select FQ (quarterly) or FY (annual) mode so the indicator adapts to your preferred horizon.
(• Deviation calculation: earnings surprise and/or sales surprise can be combined via a weighted setup so you pick which metric drives the score.
(• History buffer: you choose how many “commit points” (i.e., past surprises) to include in the statistics and quantile calculations.
(• Quantile ranking: the tool computes how the company’s recent deviation stacks up versus its own history; in FY-mode we still use quarterly density for statistical robustness.
(• Predictability & volatility metrics: beyond the quantile, you get a predictability score (low recent deviation + low volatility) and a simple “moat” / management-quality overlay via the SLOAN ratio.
(• Status and CI table: the indicator comes with a visualization panel summarizing mean surprise, standard deviation, sample length, and your computed quantile and predictability grades.
(• Future box: optional forward-map showing the next earnings date, estimated deltas and flagged surprises.
What it is not
It is not a timing indicator (i.e., it won’t tell you when to buy or sell precisely). It does not predict short-term price movements. Instead, it is tuned for fundamental stock picking: look for companies that repeatedly deliver surprise results, for which you believe management and business model give an advantage. Use it to add an extra dimension of “earnings surprise stability & management forecasting quality” to your dashboard.
My usage case
I developed this indicator as part of a broader portfolio strategy: I screen for companies that are both highly predictable (i.e., rarely miss) and have the capacity to beat earnings by a meaningful margin, because I believe this reflects strong business execution and good internal alignment. Over time I plan to expand the dashboard with more indicators geared toward company quality and moat (quantitative metrics built from financial statement data). This version is still work in progress (there may be bugs), so consider the output as one more input—do not rely on it exclusively.
Important caveats
The code is relatively computation-intensive, especially with large lookback windows and quarterly frequency. On my Mac Pro it runs smoothly—but depending on your device and market data feed you may experience slower performance. Also: synchronising earnings release timing and sales release timing across companies is tricky—sometimes data lags or is updated later, so there may be discrepancies. Because of this the indicator’s output should be treated as a guide rather than a guarantee.
Empirical background
The academic literature supports the idea that consistent surprises and management execution can matter—but the relationship is complex. For example, research on post-earnings-announcement drift (PEAD) shows that markets often under-react to surprise earnings and that returns continue to drift in the direction of surprise for weeks or months.  At the same time, studies such as Skinner & Sloan (2000) show that when you control for growth expectations the relation of surprise to future returns becomes weaker.  In other words: just beating earnings by 20 % repeatedly does not guarantee outsized share-price gains, because market expectations adjust, estimates bake in the beat and other factors (discount rates, fundamentals) still dominate.
Final word
Use it as part of your fundamental stock-analysis toolkit to gauge how well a company consistently delivers relative to expectations, how volatile those surprises are, and whether you think management has a competitive edge in forecasting or executing. As mentioned, this is a work in progress and should not be your only tool—but used wisely, it can add a meaningful extra dimension to your decision-making. I’ll continue to improve it and add new quality-and-moat oriented indicators in future releases.
25.10.21차파동저항선When the first wave occurred, the resistance line appeared Find the neck pressed by the resistance level
Previous Day Volume Profile NQ!This indicator takes the previous U.S. regular trading session and maps its most actively traded price zone onto the next day. It draws a shaded box representing the Value Area (≈68% of prior-day volume), bounded by VAH (Value Area High) and VAL (Value Area Low). A line through the middle marks the POC (Point of Control), the single price with the most traded volume. The box projects 15.5 hours into the new day so you can see where today’s action sits relative to yesterday’s “fair value.”
To help with intraday decisions, the indicator also extends VAH/VAL/POC as dotted lines. These extensions act like “guide rails” for context into the next trading session.
How to read it
Inside the box: Market is back in yesterday’s fair value. Expect mean-reversion behavior, with price often rotating between VAL and VAH.
Re-entry signals: When price comes from outside and establishes back inside, the script can flag a Long Re-entry (from below, bias toward VAH) or Short Re-entry (from above, bias toward VAL). Optional target lines show the opposite edge as a practical objective.
Rejection signals: When price tests a boundary (VAH/VAL) and fails to establish inside, it can reject and push away—often a clue for potential price discovery beyond the box.
POC focus: The POC often behaves like a magnet during balance and a pivot during imbalance; the dotted extension keeps it visible even after the box window.
Use case
Ideal for day traders and short-term swing traders who want a clear, repeatable framework.
Quickly judge whether today is balancing (staying within yesterday’s value) or seeking new value (rejecting and exploring).
Pair the signals with your execution rules (e.g., 5-minute closes, buffers, or confirmation candles).
Everything is configurable—colors, opacities, and whether to show extensions or target lines—so you can tailor the visuals to your style without clutter.
Previous Cycle Range + SMTs [bilal x shpat]Inspired by ICT (Inner Circle Trader) concepts
Description made by ChatGPT
Thank you shpat.a for making the SMT option
📝 Overview
The Previous Cycle Range + SMTs indicator is a multi-timeframe tool designed to visualize key market structure levels derived from the previous trading cycle’s range — a concept heavily utilized in ICT-style analysis.
In addition to the traditional range levels, this indicator adds Smart Money Tool (SMT) detection, allowing traders to identify bullish or bearish divergences across multiple correlated assets, giving an edge in spotting potential turning points and liquidity imbalances.
It helps traders identify equilibrium levels, liquidity zones, and potential premium/discount areas based on the prior day (or any chosen period) high and low — now with intermarket divergence insights.
⚙️ Features
Custom Cycle Length: Define your own cycle in minutes (e.g., 1440 = 1 day, 10080 = 1 week).
Previous High/Low: Automatically plots the previous cycle’s high and low levels.
Equilibrium (EQ): Optional 50% midpoint line to highlight the market’s equilibrium.
Quarter Levels: Adds 25% and 75% range lines for refined premium/discount analysis.
Extended Ranges: Optional extended levels (e.g., -100%, +200%) to identify continuation or retracement targets.
Fib Levels (1.272 & 1.618): Adds ICT-style Fibonacci extension levels for confluence zones.
Smart Money Tool (SMT) Detection:
Detects bullish or bearish divergences between your main asset and up to two comparison symbols.
Highlights potential SMT zones with optional text labels for quick visualization.
Optional SMT summary table displays divergence status for all three assets.
Custom Styling: Full control over colors, line width, label style, and extension distance.
💡 How It Helps
This indicator aligns with ICT principles by making the previous day’s range visible and actionable, now with SMT divergence insights:
The previous day’s high/low often act as liquidity pools.
The equilibrium (EQ) represents fair value — useful for spotting premium/discount zones.
Quarter levels and Fibonacci extensions add precision when mapping market structure and potential reaction points.
SMT detection helps traders identify early divergence signals that may indicate upcoming bullish or bearish moves across correlated markets.
🔍 Example Uses
Identify where price is trading relative to the previous session’s range.
Use EQ and quarter levels to gauge premium vs. discount conditions.
Spot intermarket divergences using SMTs to anticipate potential reversal or continuation points.
Combine with other ICT-based tools (e.g., PD arrays, dealing ranges, or kill zones) for refined trade setups.
Manual Vertical Lines (ramlakshman das)This script is useful for traders who want to visually mark important past or upcoming events such as earnings announcements, market opens/closes, or economic dates directly on their price charts. Its manual input format offers maximal customization for each individual line without loops, making it straightforward to fine-tune each line’s parameters individually.
Key features include:
Manual control over up to multiple vertical lines.
Support for any date and time with precise timestamp inputs.
Customizable line colors.
Persistence of lines into the future.
Clear, user-friendly input naming for ease of use.
This indicator helps traders visually track crucial dates and prepare for events by highlighting them on their charts, improving decision-making and situational awareness during trading.
Merek Day Seperator
The indicator helps traders visualize daily sessions based on New York midnight, making it easier to track trading days and plan strategies around daily market opens/closes.
4h 相对超跌筛选器 · Webhook v2.0## 指标用途
用于你的「框架第2步」:在**美股 RTH**里,按**4h 收盘**(06:30–10:30 PT 为首根)筛出相对大盘/行业**显著超跌**且结构健康的候选标的,并可**通过 Webhook 自动推送**`symbol + ts`给下游 AI 执行新闻甄别(第3步)与进出场评估(第4步)。
## 工作原理(核心逻辑)
* **结构健康**:最近 80 根 4h 中,收盘 > 4h_SMA50 的占比 ≥ 阈值(默认 55%)。
* **跌深条件**:4h 跌幅 ≤ −4%,且近两根累计(≈8h)≤ −6%。
* **相对劣化**:相对大盘(SPY/QQQ)与相对行业(XLK/XLF/… 或 KWEB/CQQQ)各 ≤ −3%。
* **流动性与价格**:ADV20_USD ≥ 2000 万;价格 ≥ 3 美元。
* **只在 4h 收盘刻评估与触发**,历史点位全部保留,便于回放核验。
* **冷却**:同一标的信号间隔 ≥ N 天(默认 10)。
## 主要输入参数
* **bench / sector**:大盘与行业基准(例:SPY/QQQ,XLK/XLF/XLY;中概用 KWEB/CQQQ)。
* **advMinUSD / priceMin**:20 日美元成交额下限、最小价格。
* **pctAboveTh**:结构健康阈值(%)。
* **drop4hTh / drop8hTh**:4h/8h 跌幅阈值(%)。
* **relMktTh / relSecTh**:相对大盘/行业阈值(%)。
* **coolDays**:冷却天数。
* **fromDate**:仅显示此日期后的历史信号(图表拥挤时可用)。
* **showTable / tableRows**:是否显示右上角“最近信号表”及行数。
## 图表信号
* **S2 绿点**:当根 4h 收盘满足全部筛选条件。
* **右上角表格**:滚动列出最近 N 条命中(`SYMBOL @ yyyy-MM-dd HH:mm`,按图表本地时区)。
## Webhook 联动(生产用)
1. 添加指标 → 🔔 新建警报(Alert):
* **Condition**:`Any alert() function call`
* **Options**:`Once per bar close`
* **Webhook URL**:填你的接收地址(可带 `?token=...`)
* **Message**:留空(脚本内部 `alert(payload)` 会发送 JSON)。
2. 典型 JSON 载荷(举例):
```json
{
"event": "step2_signal",
"symbol": "LULU",
"symbol_id": "NASDAQ:LULU",
"venue": "NASDAQ",
"bench": "SPY",
"sector": "XLY",
"ts_bar_close_ms": 1754524200000,
"ts_bar_close_local": "2025-06-06 10:30",
"price_close": 318.42,
"ret_4h_pct": -5.30,
"ret_8h_pct": -7.45,
"rel_mkt_pct": -4.90,
"rel_sec_pct": -3.80
}
```
> 建议以 `symbol + ts_bar_close_ms` 做去重键;接收端先快速 `200 OK`,后续异步处理并交给第3步 AI。
## 使用建议
* **时间框架**:任意周期可用,指标内部统一拉取 240 分钟数据并仅在 4h 收盘刻触发。
* **行业映射**:尽量选与个股业务最贴近的 ETF;中国 ADR 可用 `PGJ/KWEB/CQQQ` 叠加细分行业对照。
* **回放验证**:Bar Replay **不发送真实 Webhook**;仅用于查看历史命中与表格。测试接收端请用 Alert 面板的 **Test**。
## 适配说明
* Pine Script **v5**。
* 不含成分筛查逻辑(请在你的 500–600 只候选池内使用)。
* 数字常量不使用下划线分隔;如需大数可用 `20000000` 或 `2e7`。
## 常见问题
* ⛔️ 报错 `tostring(...)`:Pine 无时间格式化重载,脚本已内置 `timeToStr()`。
* ⛔️ `syminfo.exchange` 不存在:已改用 `syminfo.prefix`(交易所前缀)。
* ⛔️ 多行字符串拼接报 `line continuation`:本脚本已用括号包裹或 `str.format` 规避。
## 免责声明
该指标仅供筛选与研究使用,不构成投资建议。请结合你的第3步新闻/基本面甄别与第4步执行规则共同决策。






















