HTF ReversalsHTF Reversals — Big Turtle Soup & Relief Patterns
A multi-timeframe reversal indicator based on the logic of how pivots form and how true reversals begin. Designed for traders who want to catch high-probability turning points on higher timeframes, with visual clarity and actionable signals.
“Reversals don’t start from nowhere — they begin with a failed expansion and a reclaim of a prior range. This script helps you spot those moments, before the crowd.”
How It Works
Detects High Timeframe (HTF) “CR” Candles:
The script scans for large-bodied candles (“CR” candles) on higher timeframes (Monthly, Weekly, 3-Day). These candles often mark the end of a trend expansion and the start of a potential reversal zone.
Looks for “Inside” Candles:
After a CR candle, the script waits for a smaller “inside” candle, which signals a pause or failed continuation. The relationship between the CR and inside candle is key for identifying a possible reversal setup.
Engulfing Confirmation (Optional):
If the inside candle doesn’t immediately trigger a reversal, the script can wait for an engulfing move in the opposite direction, confirming the failed expansion and increasing the probability of a reversal.
Entry & Target Calculation:
For each valid setup, the script calculates a retracement entry (using Fibonacci levels like 0.382 or 0.618) and a logical target (usually the CR candle’s high or low).
Visuals: Lines & Boxes:
Each signal is marked with a horizontal line (entry) and a colored box extending from the HTF close to the entry price, visually highlighting the reversal zone for the same duration as the signal’s expected play-out.
Dashboard & Alerts:
A dashboard table summarizes the latest signals for each timeframe. Custom alerts notify you of new setups in real time.
Why It Works
Pivot Logic:
Reversals often start when a strong expansion candle (pivot) is followed by a failed attempt to continue in the same direction. This script codifies that logic, looking for the “pause” after the expansion and the first sign of a reclaim.
Multi-Timeframe Edge:
By focusing on higher timeframes, the indicator filters out noise and highlights only the most significant reversal opportunities.
Objective, Repeatable Rules:
All conditions are clearly defined and repeatable, removing subjectivity from reversal trading.
Visual Clarity:
The combination of lines and boxes makes it easy to see where reversals are likely to start and where your risk/reward lies.
How to Use
Add the indicator to your chart and select your preferred timeframes (Monthly, Weekly, 3-Day).
Watch for new signals on the dashboard or via alerts.
Use the entry line and box as your trade zone; the target is also displayed.
Combine with your own confluence (price action, volume, etc.) for best results.
This indicator is best used as a framework for understanding where high-probability reversals are likely to occur, not as a standalone buy/sell tool. Always use proper risk management.
Forecasting
V2_Livermore-Seykota Breakout)V2_ Livermore-Seykota Breakout Strategy
Objective: Execute breakout trades inspired by Jesse Livermore, filtered by trend confirmation (Ed Seykota) and risk-managed with ATR (Paul Tudor Jones style).
Entry Conditions:
Long Entry:
Close price breaks above recent pivot high.
Price is above main EMA (EMA50).
EMA20 > EMA200 (uptrend confirmation).
Current volume > 20-period SMA (volume confirmation).
Short Entry:
Close price breaks below recent pivot low.
Price is below main EMA (EMA50).
EMA20 < EMA200 (downtrend confirmation).
Current volume > 20-period SMA.
Exit Conditions:
Stop-loss: ATR × 3 from entry price.
Trailing stop: activated with offset of ATR × 2.
Strengths:
Trend-aligned entries with volume breakout confirmation.
Dynamic ATR-based risk management.
Inspired by principles of three legendary traders.
Forex Algo-Trade ~ Ano_Jokamp354Forex Algo-Trade ~ Ano_Jokamp354
is a tool designed to assist traders around the world in analyzing the foreign exchange market, and even metals. By identifying the potential direction of future price movements, it helps you make more accurate trading decisions.
The developer of this tool is a young Indonesian trader known by the nickname Ano_Jokamp354 , who has been involved in the capital market since his school days.
Breakout/Fakeout Mum Tespitçisi🧠 How to Work?
Breakout Up (Y↑): The candle breaks the upper band up, continues above and the shadow is short.
Breakout Down (Y↓): The candle breaks the lower band down, continues above and the shadow is short.
Fakeout Up (F↑): The upper band closes again without opening (bull trap).
Fakeout Down (F↓): The lower band breaks but closes again (bear trap).
Breakout Scanner (VWAP+Volume+RSI)If the price is above the VWAP, there is an increase in volume and the RSI is > 60, it gives a breakout signal. Most Effective for Breakout
KAVAUSDT Gelişmiş Breakout/Support-Resistance Stratejisi🧠 Timeframe Matching:
🔹 Ideal: 15 Minutes & 1 Hour
🔹 Supporting: 5D (very short term scalp), 4s (for medium term confirmation)
Risk Calculator PRO — manual lot size + auto lot-suggestionWhy risk management?
90 % of traders blow up because they size positions emotionally. This tool forces Risk-First Thinking: choose the amount you’re willing to lose, and the script reverse-engineers everything else.
Key features
1. Manual or Market Entry – click “Use current price” or type a custom entry.
2. Setup-based ₹-Risk – four presets (A/B/C/D). Edit to your workflow.
3. Lot-Size Input + Auto Lot Suggestion – you tell the contract size ⇒ script tells you how many lots.
4. Auto-SL (optional) – tick to push stop-loss to exactly 1-lot risk.
5. Instant Targets – 1 : 2, 1 : 3, 1 : 4, 1 : 5 plotted and alert-ready.
6. P&L Preview – table shows potential profit at each R-multiple plus real ₹ at SL.
7. Margin Column – enter per-lot margin once; script totals it for any size.
8. Clean Table UI – dark/light friendly; updates every 5 bars.
9. Alert Pack – SL, each target, plus copy-paste journal line on the chart.
How to use
1. Add to chart > “Format”.
2. Type the lot size for the symbol (e.g., 1250 for Natural Gas, 1 for cash equity).
3. Pick Side (Buy / Sell) & Setup grade.
4. ✅ If you want the script to place SL for you, tick Auto-SL (risk = 1 lot).
5. Otherwise type your own Stop-loss.
6. Read the table:
• Suggested lots = how many to trade so risk ≤ setup ₹.
• Risk (currency) = real money lost if SL hits.
7. Set TradingView alerts on the built-in conditions (T1_2, SL_hit, etc.) if you’d like push / email.
8. Copy the orange CSV label to Excel / Sheets for journalling.
Best practices
• Never raise risk to “fit” a trade. Lower size instead.
• Review win-rate vs. R multiple monthly; adjust setups A–D accordingly.
• Test Auto-SL in replay before going live.
Disclaimer
This script is educational. Past performance ≠ future results. The author isn’t responsible for trading losses.
Morning Zone Marker — Sniper Trading System™️ Module📝 Short Description:
Visually defines the dealer setup range from 6 PM to 1 AM EST with subtle background shading and white boundary lines — a critical time window in the Sniper Trading System™️.
📄 Full Description (Long Description):
🔫 Morning Zone Marker — Sniper Trading System™️ Module
This indicator module is part of the Sniper Trading System™️ — a precision-based institutional trading framework built for traders who demand accuracy, structure, and edge.
🧠 Purpose
The Morning Zone Marker is engineered to visually isolate the critical dealer setup window that occurs from 6:00 PM to 1:00 AM EST each day. This time period often marks range-building and liquidity engineering by institutional dealers before the London and New York sessions open.
🎯 Key Benefits
Identifies potential false moves and Judas swings designed to trap retail traders.
Frames liquidity zones, consolidation ranges, and standard deviation boundaries for sniper entries.
Reinforces trading discipline by helping traders avoid premature entries outside sniper hours.
⚙️ How It Works
Uses time() to define the session from 6:00 PM to 1:00 AM EST.
Applies a light gray transparent background during this time.
Draws white vertical lines at the session’s start and end to simulate a clean "Morning Box" boundary.
✅ Sniper Trading System Integration
Integrates seamlessly with the full Sniper Trading System Indicator™️, including:
Dealer Range Mapping (2–8 PM EST)
Standard Deviation Target Zones
Morning Kill Zone Entries (2:15–5:00 AM EST)
New York Sniper Entries (7:15–10:00 AM EST)
Bias Candles, RSI Filters, and Liquidity Sweep Detection
Best used on 15-minute to 1-hour timeframes for Forex, Futures, and Indices trading.
DXY Monthly Return (+3M Lead)This indicator calculates the rolling monthly return (based on 21 trading days) for the U.S. Dollar Index (DXY), applying a +3-month forward shift (lead) to the series.
It is designed to help visualize the leading effect of USD strength or weakness on other macro-sensitive assets — particularly Bitcoin and crypto markets, which often react to changes in global dollar liquidity with a lag of approximately 10 weeks.
Note: This script does not invert the values directly. To match the inverted Y-axis visual used by Steno Research — where negative USD returns are displayed at the top — simply right-click the Y-axis in the chart panel and select “Invert Scale.”
💡 Use this tool for macro trend analysis, early crypto signal generation, or studying inverse correlations between USD and risk assets.
Source logic: Steno Research, Bloomberg, Macrobond.
Taylor Series ForecastThis indicator projects future price movement using a second-order Taylor Series expansion, calculated from a smoothed price (EMA). It models price momentum and acceleration to generate a forward-looking trajectory.
Forecast points are plotted continuously as connected line segments extending into the future. Each segment is color-coded based on slope:
Green indicates an upward slope (bullish forecast).
Red indicates a downward slope (bearish forecast).
The forecast adapts to current market conditions and updates dynamically with each new bar. Useful for visualizing potential future price paths and identifying directional bias based on recent price action.
Inputs:
Max Forecast Horizon: How many bars into the future the forecast extends.
EMA Smoothing Length: The smoothing applied to price before calculating derivatives.
This tool is experimental and should be used in conjunction with other analysis methods. It does not guarantee future price performance.
Futures Strategy: EMA + CPR + RSI (No OI)Strategy Logic:
✅ 20 EMA / 50 EMA crossover for trend direction
✅ CPR (Central Pivot Range) for support/resistance context
✅ Optional enhancements:
RSI filter to avoid overbought/oversold zones
Volume filter to avoid weak signals
EMA + CPR Buy/Sell Signalsautomated TradingView Pine Script for generating Buy/Sell signals based on the exact strategy you requested:
20 EMA & 50 EMA crossover
CPR levels (Pivot, Support, Resistance)
Optional: MACD & RSI filters
EMA + CPR Buy/Sell Signalsautomated TradingView Pine Script for generating Buy/Sell signals based on the exact strategy
20 EMA & 50 EMA crossover
CPR levels (Pivot, Support, Resistance)
Optional: MACD & RSI filters
UT Bot + Hull MA Confirmed Signal DelayOverview
This indicator is designed to detect high-probability reversal entry signals by combining "UT Bot Alerts" (UT Bot Alerts script adapted from QuantNomad - Originally developed by Yo_adriiiiaan and idea of original code for "UT Bot Alerts" from HPotter ) with confirmation from a Hull Moving Average (HMA) Developed by Alan Hull . It focuses on capturing momentum shifts that often precede trend reversals, helping traders identify potential entry points while filtering out false signals.
🔍 How It Works
This strategy operates in two stages:
1. UT Bot Momentum Trigger
The foundation of this script is the "UT Bot Alerts" , which uses an ATR-based trailing stop to detect momentum changes. Specifically:
The script calculates a dynamic stop level based on the Average True Range (ATR) multiplied by a user-defined sensitivity factor (Key Value).
When price closes above this trailing stop and the short-term EMA crosses above the stop, a potential buy setup is triggered.
Conversely, when price closes below the trailing stop and the short-term EMA crosses below, a potential sell setup is triggered.
These UT Bot alerts are designed to identify the initial shift in market direction, acting as the first filter in the signal process.
2. Hull MA Confirmation
To reduce noise and false triggers from the UT Bot alone, this script delays the entry signal until price confirms the move by crossing the Hull Moving Average (or its variants: HMA, THMA, EHMA) in the same direction as the UT Bot trigger:
A Buy Signal is generated only when:
A UT Bot Buy condition is active, and
The price closes above the Hull MA.
Or, if a UT Bot Buy condition was recently triggered but price hadn’t yet crossed above the Hull MA, a delayed buy is signaled when price finally breaks above it.
A Sell Signal is generated only when:
A UT Bot Sell condition is active, and
The price closes below the Hull MA.
Similarly, a delayed sell signal can occur if price breaks below the Hull MA shortly after a UT Bot Sell trigger.
This dual-confirmation process helps traders avoid premature entries and improves the reliability of reversal signals.
📈 Best Use Cases
Reversal Trading: This strategy is particularly well-suited for catching early trend reversals rather than trend continuations. It excels at identifying momentum pivots that occur after pullbacks or exhaustion moves.
Heikin Ashi Charts Recommended: The script offers a Heikin Ashi mode for smoothing out noise and enhancing visual clarity. Using Heikin Ashi candles can further reduce whipsaws and highlight cleaner shifts in trend direction.
MACD Alignment: For best results, trade in the direction of the MACD trend or use it as a filter to avoid counter-trend trades.
⚠️ Important Notes
Entry Signals Only: This indicator only plots entry points (Buy and Sell signals). It does not define exit strategies, so users should manage trades manually using trailing stops, profit targets, or other exit indicators.
No Signal = No Confirmation: You may see a UT Bot trigger without a corresponding Buy/Sell signal. This means the price did not confirm the move by crossing the Hull MA, and therefore the setup was considered too weak or incomplete.
⚙️ Customization
UT Bot Sensitivity: Adjust the “Key Value” and “ATR Period” to make the UT Bot more or less reactive to price action.
Use Heikin Ashi: Toggle between standard candles or Heikin Ashi in the indicator settings for a smoother trading experience.
The HMA length may also be modified in the indicator settings from its standard 55 length to increase or decrease the sensitivity of signal.
This strategy is best used by traders looking for a structured, logic-based way to enter early into reversals with added confirmation to reduce risk. By combining two independent systems—momentum detection (UT Bot) and trend confirmation (Hull MA)—it aims to provide high-confidence entries without overwhelming complexity.
Let the indicator guide your entries—you manage the exits.
Examples of use:
Futures:
Stock:
Crypto:
As shown in the snapshots this strategy, like most, works the best when price action has a sizeable ATR and works the least when price is choppy. Therefore it is always best to use this system when price is coming off known support or resistance levels and when it is seen to respect short term EMA's like the 9 or 15.
My personal preference to use this system is for day trading on a 3 or 5 minute chart. But it is valid for all timeframes and simply marks a high probability for a new trend to form.
Sources:
Quant Nomad - www.tradingview.com
Yo_adriiiiaan - www.tradingview.com
HPotter - www.tradingview.com
Hull Moving Average - alanhull.com
Supply & Demand (MTF) | Picaspec
Picaspec Supply and Demand Zone Indicator
*A multi-timeframe supply & demand zone detection tool for TradingView*
### 🧠 **Overview**
This indicator is designed to automatically identify and plot **supply and demand zones** across multiple timeframes on any TradingView chart. These zones are key areas where price has previously shown significant buying (demand) or selling (supply) interest — and where future price reactions are highly probable.
It simplifies the application of supply and demand trading concepts by visually marking potential reversal or continuation zones, helping traders spot high-probability trade opportunities with minimal effort.
---
### 🔍 **Key Features**
#### ✅ **Automatic Supply and Demand Zone Detection**
* The indicator identifies **strong price imbalances** based on previous price action.
* It plots **demand zones** where price moved away strongly after a base, indicating buying pressure.
* It plots **supply zones** where price dropped sharply after a base, indicating selling pressure.
* Zones are drawn based on classic supply/demand criteria (drop-base-rally, rally-base-drop, etc.).
#### 🕰️ **Multi-Timeframe Analysis**
* Detects zones from higher timeframes like **1H, 4H, Daily**, etc., and overlays them on lower timeframes.
* This helps traders combine intraday entries with broader context from higher timeframe zones.
#### 🎯 **Refinement and Filtering Options**
* **Mitigated zones** can be hidden or shown — once price revisits a zone, it’s marked as "used."
* **Zone strength** filters allow traders to focus only on the most relevant supply/demand areas.
* Traders can toggle visibility for each timeframe zone to reduce chart clutter.
#### 🎨 **Visual Clarity**
* **Color-coded zones**:
* Green for demand
* Red for supply
* Adjustable transparency and zone thickness.
* Labels for timeframes (e.g., "4H Supply") to clearly show origin.
#### 📐 **Dynamic Updates**
* Zones update in real-time as new supply/demand formations are detected.
* Outdated or invalid zones are removed, keeping charts clean and actionable.
---
### ⚙️ **Customization Options**
* Enable/disable zones by timeframe (e.g., only show Daily + 4H).
* Adjust zone style: color, line style, label visibility.
* Control how long zones remain on the chart after being mitigated.
* Turn on/off alerts when price enters a zone (optional).
---
### 💡 **Use Cases**
* **Swing Trading**: Use Daily and 4H zones for identifying macro-level turning points.
* **Intraday Trading**: Drop to 15m or 1H zones for scalping precise entries inside higher timeframe zones.
* **Confluence Trading**: Combine S\&D zones with price action, break of structure, or candlestick patterns for higher probability trades.
---
### 🧑💼 **Who Is This For?**
* Traders who follow **Supply & Demand** methodology.
* Price action traders looking to automate zone plotting.
* Beginners who want to visually learn how S\&D zones work.
* Advanced traders who need efficient multi-timeframe zone overlays.
Trade PlannerTrade planner - Input capital or No. of shares, entry price, target price, risk % and calculate your profit and risk
JPMorgan G7 Volatility IndexThe JPMorgan G7 Volatility Index: Scientific Analysis and Professional Applications
Introduction
The JPMorgan G7 Volatility Index (G7VOL) represents a sophisticated metric for monitoring currency market volatility across major developed economies. This indicator functions as an approximation of JPMorgan's proprietary volatility indices, providing traders and investors with a normalized measurement of cross-currency volatility conditions (Clark, 2019).
Theoretical Foundation
Currency volatility is fundamentally defined as "the statistical measure of the dispersion of returns for a given security or market index" (Hull, 2018, p.127). In the context of G7 currencies, this volatility measurement becomes particularly significant due to the economic importance of these nations, which collectively represent more than 50% of global nominal GDP (IMF, 2022).
According to Menkhoff et al. (2012, p.685), "currency volatility serves as a global risk factor that affects expected returns across different asset classes." This finding underscores the importance of monitoring G7 currency volatility as a proxy for global financial conditions.
Methodology
The G7VOL indicator employs a multi-step calculation process:
Individual volatility calculation for seven major currency pairs using standard deviation normalized by price (Lo, 2002)
- Weighted-average combination of these volatilities to form a composite index
- Normalization against historical bands to create a standardized scale
- Visual representation through dynamic coloring that reflects current market conditions
The mathematical foundation follows the volatility calculation methodology proposed by Bollerslev et al. (2018):
Volatility = σ(returns) / price × 100
Where σ represents standard deviation calculated over a specified timeframe, typically 20 periods as recommended by the Bank for International Settlements (BIS, 2020).
Professional Applications
Professional traders and institutional investors employ the G7VOL indicator in several key ways:
1. Risk Management Signaling
According to research by Adrian and Brunnermeier (2016), elevated currency volatility often precedes broader market stress. When the G7VOL breaches its high volatility threshold (typically 1.5 times the 100-period average), portfolio managers frequently reduce risk exposure across asset classes. As noted by Borio (2019, p.17), "currency volatility spikes have historically preceded equity market corrections by 2-7 trading days."
2. Counter-Cyclical Investment Strategy
Low G7 volatility periods (readings below the lower band) tend to coincide with what Shin (2017) describes as "risk-on" environments. Professional investors often use these signals to increase allocations to higher-beta assets and emerging markets. Campbell et al. (2021) found that G7 volatility in the lowest quintile historically preceded emerging market outperformance by an average of 3.7% over subsequent quarters.
3. Regime Identification
The normalized volatility framework enables identification of distinct market regimes:
- Readings above 1.0: Crisis/high volatility regime
- Readings between -0.5 and 0.5: Normal volatility regime
- Readings below -1.0: Unusually calm markets
According to Rey (2015), these regimes have significant implications for global monetary policy transmission mechanisms and cross-border capital flows.
Interpretation and Trading Applications
G7 currency volatility serves as a barometer for global financial conditions due to these currencies' centrality in international trade and reserve status. As noted by Gagnon and Ihrig (2021, p.423), "G7 currency volatility captures both trade-related uncertainty and broader financial market risk appetites."
Professional traders apply this indicator in multiple contexts:
- Leading indicator: Research from the Federal Reserve Board (Powell, 2020) suggests G7 volatility often leads VIX movements by 1-3 days, providing advance warning of broader market volatility.
- Correlation shifts: During periods of elevated G7 volatility, cross-asset correlations typically increase what Brunnermeier and Pedersen (2009) term "correlation breakdown during stress periods." This phenomenon informs portfolio diversification strategies.
- Carry trade timing: Currency carry strategies perform best during low volatility regimes as documented by Lustig et al. (2011). The G7VOL indicator provides objective thresholds for initiating or exiting such positions.
References
Adrian, T. and Brunnermeier, M.K. (2016) 'CoVaR', American Economic Review, 106(7), pp.1705-1741.
Bank for International Settlements (2020) Monitoring Volatility in Foreign Exchange Markets. BIS Quarterly Review, December 2020.
Bollerslev, T., Patton, A.J. and Quaedvlieg, R. (2018) 'Modeling and forecasting (un)reliable realized volatilities', Journal of Econometrics, 204(1), pp.112-130.
Borio, C. (2019) 'Monetary policy in the grip of a pincer movement', BIS Working Papers, No. 706.
Brunnermeier, M.K. and Pedersen, L.H. (2009) 'Market liquidity and funding liquidity', Review of Financial Studies, 22(6), pp.2201-2238.
Campbell, J.Y., Sunderam, A. and Viceira, L.M. (2021) 'Inflation Bets or Deflation Hedges? The Changing Risks of Nominal Bonds', Critical Finance Review, 10(2), pp.303-336.
Clark, J. (2019) 'Currency Volatility and Macro Fundamentals', JPMorgan Global FX Research Quarterly, Fall 2019.
Gagnon, J.E. and Ihrig, J. (2021) 'What drives foreign exchange markets?', International Finance, 24(3), pp.414-428.
Hull, J.C. (2018) Options, Futures, and Other Derivatives. 10th edn. London: Pearson.
International Monetary Fund (2022) World Economic Outlook Database. Washington, DC: IMF.
Lo, A.W. (2002) 'The statistics of Sharpe ratios', Financial Analysts Journal, 58(4), pp.36-52.
Lustig, H., Roussanov, N. and Verdelhan, A. (2011) 'Common risk factors in currency markets', Review of Financial Studies, 24(11), pp.3731-3777.
Menkhoff, L., Sarno, L., Schmeling, M. and Schrimpf, A. (2012) 'Carry trades and global foreign exchange volatility', Journal of Finance, 67(2), pp.681-718.
Powell, J. (2020) Monetary Policy and Price Stability. Speech at Jackson Hole Economic Symposium, August 27, 2020.
Rey, H. (2015) 'Dilemma not trilemma: The global financial cycle and monetary policy independence', NBER Working Paper No. 21162.
Shin, H.S. (2017) 'The bank/capital markets nexus goes global', Bank for International Settlements Speech, January 15, 2017.
Gustavo LiquidityThis script draws a user-colored horizontal ray on each green candle and places a blue flag at the ray’s end if the price touches the ray again within a specified number of future bars.
Cointegration Heatmap & Spread Table [EdgeTerminal]The Cointegration Heatmap is a powerful visual and quantitative tool designed to uncover deep, statistically meaningful relationships between assets.
Unlike traditional indicators that react to price movement, this tool analyzes the underlying statistical relationship between two time series and tracks when they diverge from their long-term equilibrium — offering actionable signals for mean-reversion trades .
What Is Cointegration?
Most traders are familiar with correlation, which measures how two assets move together in the short term. But correlation is shallow — it doesn’t imply a stable or predictable relationship over time.
Cointegration, however, is a deeper statistical concept: Two assets are cointegrated if a linear combination of their prices or returns is stationary , even if the individual series themselves are non-stationary.
Cointegration is a foundational concept in time series analysis, widely used by hedge funds, proprietary trading firms, and quantitative researchers. This indicator brings that institutional-grade concept into an easy-to-use and fully visual TradingView indicator.
This tool helps answer key questions like:
“Which stocks tend to move in sync over the long term?”
“When are two assets diverging beyond statistical norms?”
“Is now the right time to short one and long the other?”
Using a combination of regression analysis, residual modeling, and Z-score evaluation, this indicator surfaces opportunities where price relationships are stretched and likely to snap back — making it ideal for building low-risk, high-probability trade setups.
In simple terms:
Cointegrated assets drift apart temporarily, but always come back together over time. This behavior is the foundation of successful pairs trading.
How the Indicator Works
Cointegration Heatmap indicator works across any market supported on TradingView — from stocks and ETFs to cryptocurrencies and forex pairs.
You enter your list of symbols, choose a timeframe, and the indicator updates every bar with live cointegration scores, spread signals, and trade-ready insights.
Indicator Settings:
Symbol list: a customizable list of symbols separated by commas
Returns timeframe: time frame selection for return sampling (Weekly or Monthly)
Max periods: max periods to limit the data to a certain time and to control indicator performance
This indicator accomplishes three major goals in one streamlined package:
Identifies stable long-term relationships (cointegration) between assets, using a heatmap visualization.
Tracks the spread — the difference between actual prices and the predicted linear relationship — between each pair.
Generates trade signals based on Z-score deviations from the mean spread, helping traders know when a pair is statistically overextended and likely to mean revert.
The math:
Returns are calculated using spread tickers to ensure alignment in time and adjust for dividends, splits, and other inconsistencies.
For each unique pair of symbols, we perform a linear regression
Yt=α+βXt+ε
Then we compute the residuals (errors from the regression):
Spreadt=Yt−(α+βXt)
Calculate the standard deviation of the spread over a moving window (default: 100 samples) and finally, define the Cointegration Score:
S=1/Standard Deviation of Residuals
This means, the lower the deviation, the tighter the relationship, so higher scores indicate stronger cointegration.
Always remember that cointegration can break down so monitor the asset over time and over multiple different timeframes before making a decision.
How to use the indicator
The heatmap table:
The indicator displays 2 very important tables, one in the middle and one on the right side. After entering your symbols, the first table to pay attention to is the middle heatmap table.
Any assets with a cointegration value of 25% is something to pay attention to and have a strong and stable relationship. Anything below is weak and not tradable.
Additionally, the 40% level is another important line to cross. Assets that have a cointegration score of over 40% will most likely have an extremely strong relationship.
Think about it this way, the higher the percentage, the tighter and more statistically reliable the relationship is.
The spread table:
After finding a good asset pair using heatmap, locate the same pair in the spread table (right side).
Here’s what you’ll see on the table:
Spread: Current difference between the two symbols based on the regression fit
Mean: Historical average of that spread
Z-score: How far current spread is from the mean in standard deviations
Signal: Trade suggestion: Short, Long, or Neutral
Since you’re expecting mean reversion, the idea is that the spread will return to the average. You want to take a trade when the z-score is either over +2 or below -2 and exit when z-score returns to near 0.
You will usually see the trade suggestion on the spread chart but you can make your own decision based on your risk level.
Keep in mind that the Z-score for each pair refers to how off the first asset is from the mean compared to the second one, so for example if you see STOCKA vs STOCKB with a Z-score of -1.55, we are regressing STOCKB (Y) on STOCKA (X).
In this case, STOCKB is the quoted asset and STOCKA is the base asset.
In this case, this means that STOCKB is much lower than expected relative to STOCKA, so the trade would be a long position on stock B and short position on stock A.
Seasonality DOW CombinedOverall Purpose
This script analyzes historical daily returns based on two specific criteria:
Month of the year (January through December)
Day of the week (Sunday through Saturday)
It summarizes and visually displays the average historical performance of the selected asset by these criteria over multiple years.
Step-by-Step Breakdown
1. Initial Settings:
Defines minimum year (i_year_start) from which data analysis will start.
Ensures the user is using a daily timeframe, otherwise prompts an error.
Sets basic display preferences like text size and color schemes.
2. Data Collection and Variables:
Initializes matrices to store and aggregate returns data:
month_data_ and month_agg_: store monthly performance.
dow_data_ and dow_agg_: store day-of-week performance.
COUNT tracks total number of occurrences, and COUNT_POSITIVE tracks positive-return occurrences.
3. Return Calculation:
Calculates daily percentage change (chg_pct_) in price:
chg_pct_ = close / close - 1
Ensures it captures this data only for the specified years (year >= i_year_start).
4. Monthly Performance Calculation:
Each daily return is grouped by month:
matrix.set updates total returns per month.
The script tracks:
Monthly cumulative returns
Number of occurrences (how many days recorded per month)
Positive occurrences (days with positive returns)
5. Day-of-Week Performance Calculation:
Similarly, daily returns are also grouped by day-of-the-week (Sunday to Saturday):
Daily return values are summed per weekday.
The script tracks:
Cumulative returns per weekday
Number of occurrences per weekday
Positive occurrences per weekday
6. Visual Display (Tables):
The script creates two visual tables:
Left Table: Monthly Performance.
Right Table: Day-of-the-Week Performance.
For each table, it shows:
Yearly data for each month/day.
Summaries at the bottom:
SUM row: Shows total accumulated returns over all selected years for each month/day.
+ive row: Shows percentage (%) of times the month/day had positive returns, along with a tooltip displaying positive occurrences vs total occurrences.
Cells are color-coded:
Green for positive returns.
Red for negative returns.
Gray for neutral/no change.
7. Interpreting the Tables:
Monthly Table (left side):
Helps identify seasonal patterns (e.g., historically bullish/bearish months).
Day-of-Week Table (right side):
Helps detect recurring weekday patterns (e.g., historically bullish Mondays or bearish Fridays).
Practical Use:
Traders use this to:
Identify patterns based on historical data.
Inform trading strategies, e.g., avoiding historically bearish days/months or leveraging historically bullish periods.
Example Interpretation:
If the table shows consistently green (positive) for March and April, historically the asset tends to perform well during spring. Similarly, if the "Friday" column is often red, historically Fridays are bearish for this asset.
VOL & AVG OverlayCustom Session Volume Versus Average Volume
Description:
This indicator will create an overlay on your chart that will show you the following information:
Custom Session Volume
Average For Selected Session
Percentage Comparison
Options:
Set Custom Time Frame For Calculations
Set Custom Time Frame For Average Comparison
Set Custom Time Zone
Enable / Disable Each Value
Change Text Color
Change Background Color
Change Table location
Example:
Set indicator to 30 period average. Set custom time frame to 9:30am to 10:30am Eastern/New York.
When the time frame for the calculation is closed , the indicator will provide a comparison of the current days volume compared to the average of 30 previous days for that same time frame and display it as a percentage in the table.
In this example you could compare how the first hour of the trading day compares to the previous 30 day's average, aiding in evaluating the potential volume for the remainder of the day.
Notes:
Times must be entered in 24 hour format. (1pm = 13:00 etc.)
This indicator is for Intra-day time frames, not > Day.
If you prefer data in this format as opposed to a plotted line, check out my other indicator: ADR & ATR Overlay