Recession Warning Model [BackQuant]Recession Warning Model
Overview
The Recession Warning Model (RWM) is a Pine Script® indicator designed to estimate the probability of an economic recession by integrating multiple macroeconomic, market sentiment, and labor market indicators. It combines over a dozen data series into a transparent, adaptive, and actionable tool for traders, portfolio managers, and researchers. The model provides customizable complexity levels, display modes, and data processing options to accommodate various analytical requirements while ensuring robustness through dynamic weighting and regime-aware adjustments.
Purpose
The RWM fulfills the need for a concise yet comprehensive tool to monitor recession risk. Unlike approaches relying on a single metric, such as yield-curve inversion, or extensive economic reports, it consolidates multiple data sources into a single probability output. The model identifies active indicators, their confidence levels, and the current economic regime, enabling users to anticipate downturns and adjust strategies accordingly.
Core Features
- Indicator Families : Incorporates 13 indicators across five categories: Yield, Labor, Sentiment, Production, and Financial Stress.
- Dynamic Weighting : Adjusts indicator weights based on recent predictive accuracy, constrained within user-defined boundaries.
- Leading and Coincident Split : Separates early-warning (leading) and confirmatory (coincident) signals, with adjustable weighting (default 60/40 mix).
- Economic Regime Sensitivity : Modulates output sensitivity based on market conditions (Expansion, Late-Cycle, Stress, Crisis), using a composite of VIX, yield-curve, financial conditions, and credit spreads.
- Display Options : Supports four modes—Probability (0-100%), Binary (four risk bins), Lead/Coincident, and Ensemble (blended probability).
- Confidence Intervals : Reflects model stability, widening during high volatility or conflicting signals.
- Alerts : Configurable thresholds (Watch, Caution, Warning, Alert) with persistence filters to minimize false signals.
- Data Export : Enables CSV output for probabilities, signals, and regimes, facilitating external analysis in Python or R.
Model Complexity Levels
Users can select from four tiers to balance simplicity and depth:
1. Essential : Focuses on three core indicators—yield-curve spread, jobless claims, and unemployment change—for minimalistic monitoring.
2. Standard : Expands to nine indicators, adding consumer confidence, PMI, VIX, S&P 500 trend, money supply vs. GDP, and the Sahm Rule.
3. Professional : Includes all 13 indicators, incorporating financial conditions, credit spreads, JOLTS vacancies, and wage growth.
4. Research : Unlocks all indicators plus experimental settings for advanced users.
Key Indicators
Below is a summary of the 13 indicators, their data sources, and economic significance:
- Yield-Curve Spread : Difference between 10-year and 3-month Treasury yields. Negative spreads signal banking sector stress.
- Jobless Claims : Four-week moving average of unemployment claims. Sustained increases indicate rising layoffs.
- Unemployment Change : Three-month change in unemployment rate. Sharp rises often precede recessions.
- Sahm Rule : Triggers when unemployment rises 0.5% above its 12-month low, a reliable recession indicator.
- Consumer Confidence : University of Michigan survey. Declines reflect household pessimism, impacting spending.
- PMI : Purchasing Managers’ Index. Values below 50 indicate manufacturing contraction.
- VIX : CBOE Volatility Index. Elevated levels suggest market anticipation of economic distress.
- S&P 500 Growth : Weekly moving average trend. Declines reduce wealth effects, curbing consumption.
- M2 + GDP Trend : Monitors money supply and real GDP. Simultaneous declines signal credit contraction.
- NFCI : Chicago Fed’s National Financial Conditions Index. Positive values indicate tighter conditions.
- Credit Spreads : Proxy for corporate bond spreads using 10-year vs. 2-year Treasury yields. Widening spreads reflect stress.
- JOLTS Vacancies : Job openings data. Significant drops precede hiring slowdowns.
- Wage Growth : Year-over-year change in average hourly earnings. Late-cycle spikes often signal economic overheating.
Data Processing
- Rate of Change (ROC) : Optionally applied to capture momentum in data series (default: 21-bar period).
- Z-Score Normalization : Standardizes indicators to a common scale (default: 252-bar lookback).
- Smoothing : Applies a short moving average to final signals (default: 5-bar period) to reduce noise.
- Binary Signals : Generated for each indicator (e.g., yield-curve inverted or PMI below 50) based on thresholds or Z-score deviations.
Probability Calculation
1. Each indicator’s binary signal is weighted according to user settings or dynamic performance.
2. Weights are normalized to sum to 100% across active indicators.
3. Leading and coincident signals are aggregated separately (if split mode is enabled) and combined using the specified mix.
4. The probability is adjusted by a regime multiplier, amplifying risk during Stress or Crisis regimes.
5. Optional smoothing ensures stable outputs.
Display and Visualization
- Probability Mode : Plots a continuous 0-100% recession probability with color gradients and confidence bands.
- Binary Mode : Categorizes risk into four levels (Minimal, Watch, Caution, Alert) for simplified dashboards.
- Lead/Coincident Mode : Displays leading and coincident probabilities separately to track signal divergence.
- Ensemble Mode : Averages traditional and split probabilities for a balanced view.
- Regime Background : Color-coded overlays (green for Expansion, orange for Late-Cycle, amber for Stress, red for Crisis).
- Analytics Table : Optional dashboard showing probability, confidence, regime, and top indicator statuses.
Practical Applications
- Asset Allocation : Adjust equity or bond exposures based on sustained probability increases.
- Risk Management : Hedge portfolios with VIX futures or options during regime shifts to Stress or Crisis.
- Sector Rotation : Shift toward defensive sectors when coincident signals rise above 50%.
- Trading Filters : Disable short-term strategies during high-risk regimes.
- Event Timing : Scale positions ahead of high-impact data releases when probability and VIX are elevated.
Configuration Guidelines
- Enable ROC and Z-score for consistent indicator comparison unless raw data is preferred.
- Use dynamic weighting with at least one economic cycle of data for optimal performance.
- Monitor stress composite scores above 80 alongside probabilities above 70 for critical risk signals.
- Adjust adaptation speed (default: 0.1) to 0.2 during Crisis regimes for faster indicator prioritization.
- Combine RWM with complementary tools (e.g., liquidity metrics) for intraday or short-term trading.
Limitations
- Macro indicators lag intraday market moves, making RWM better suited for strategic rather than tactical trading.
- Historical data availability may constrain dynamic weighting on shorter timeframes.
- Model accuracy depends on the quality and timeliness of economic data feeds.
Final Note
The Recession Warning Model provides a disciplined framework for monitoring economic downturn risks. By integrating diverse indicators with transparent weighting and regime-aware adjustments, it empowers users to make informed decisions in portfolio management, risk hedging, or macroeconomic research. Regular review of model outputs alongside market-specific tools ensures its effective application across varying market conditions.
Statistics
Square-root Decay Volume ProfileThis indicator displays a custom price profile that mimics a volume profile using occurrence-based weighting rather than actual volume. It counts how often the selected price source (e.g., close) falls within each price bin over a lookback period. What makes it unique is the use of square-root time decay: more recent price occurrences are given greater importance, while older data is discounted proportionally to the inverse square root of its age.
Each bin's relative weight is visualized as a horizontal bar aligned to the right edge of the chart, showing where price has "spent time" more recently. This allows traders to identify areas of interest, balance zones, and potential support/resistance levels based on decayed price density.
Key Features:
Square-root decay weighting favors recent price action
Adjustable lookback period, bin count, and histogram width
Works with any price source (close, hl2, etc.)
Plots boxes directly on the chart for clear visualization
This tool is especially useful for discretionary traders seeking a price-centric alternative to traditional volume profiles, with an added emphasis on recency.
Linear Mean Reversion Strategy📘 Strategy Introduction: Linear Mean Reversion with Fixed Stop
This strategy implements a simple yet powerful mean reversion model that assumes price tends to oscillate around a dynamic average over time. It identifies statistically significant deviations from the moving average using a z-score, and enters trades expecting a return to the mean.
🧠 Core Logic:
A z-score is calculated by comparing the current price to its moving average, normalized by standard deviation, over a user-defined half-life window.
Trades are entered when the z-score crosses a threshold (e.g., ±1), signaling overbought or oversold conditions.
The strategy exits positions either when price reverts back near the mean (z-score close to 0), or if a fixed stop loss of 100 points is hit, whichever comes first.
⚙️ Key Features:
Dynamic mean and volatility estimation using moving average and standard deviation
Configurable z-score thresholds for entry and exit
Position size scaling based on z-score magnitude
Fixed stop loss to control risk and avoid prolonged drawdowns
🧪 Use Case:
Ideal for range-bound markets or assets that exhibit stationary behavior around a mean, this strategy is especially useful on assets with mean-reverting characteristics like currency pairs, ETFs, or large-cap stocks. It is best suited for traders looking for short-term reversions rather than long-term trends.
Session Prep (RTH only, UTC-4)corrected Session Prep (RTH only, UTC-4) now its working properly. hope it helps! :)
safa bot alertGood trading for everying and stuff that very gfood and stuff please let me puibisjertpa 9uihthsi fuckitgn code
Z-Score Mean ReversionThe "Mean Reversion Z-Score" indicator is a statistical tool that helps traders identify potential price reversals by measuring how far the current price has deviated from its mean (average) in terms of standard deviations. Here's what it does:
Calculates the Z-score by comparing the current price to its moving average, then dividing by the standard deviation of prices over a specified period (default 14 periods).
Identifies when the price has moved too far from its mean, suggesting a potential reversion opportunity:
Values above +2 indicate overbought conditions (potential sell)
Values below -2 indicate oversold conditions (potential buy)
Generates clear visual signals:
Green triangle (▲) for buy signals when crossing above -2
Red triangle (▼) for sell signals when crossing below +2
Color-coded background for quick visual reference
Plots reference lines at ±1.5 and ±2.0 standard deviations to help gauge the strength of the current trend.
This indicator is particularly useful for range-bound markets and mean reversion trading strategies, helping traders spot potential entry and exit points based on statistical extremes.
7* Previous Bar OHLC + 5m 20 EMAincreased label height for 7* Previous Bar OHLC + 5m 20 EMA. hope it helps :)
Step 3: Multi-Timeframe Trading SessionsFor editing purposes,
This is for editing purposes for developer to edit it before publishing.
CCI Turbo Pro [CongTrader]📄 Full Description for Publishing — CCI Turbo Pro
⚡️ CCI Turbo Pro — Advanced CCI with Reversal Zones & Alerts
This advanced CCI (Commodity Channel Index) indicator is built for traders who want enhanced reversal signals, customizable extreme zones, and dynamic alerts. It improves the classic CCI with better visual cues and momentum filtering to help you avoid false signals.
🛠️ How to Use:
CCI Length (default = 20): Adjust based on your trading timeframe.
Overbought/Oversold Zones:
Overbought = 200
Oversold = -200
Extreme OB = 300 (red zone)
Extreme OS = -300 (green zone)
When the CCI crosses from below −200 → BUY signal
When the CCI crosses from above +200 → SELL signal
Background turns green/red in extreme zones
Optional labels show entry signals clearly
This indicator is useful for:
Reversal Trading
Momentum Shifts
Scalping, Swing, or Intraday strategies
Overbought/Oversold Confirmation
Works on:
Any asset (Crypto, Forex, Stocks, Indices)
Any timeframe
🔔 Alerts Included:
📈 CCI Buy Alert → CCI crossed up from oversold
📉 CCI Sell Alert → CCI crossed down from overbought
🚨 Extreme OB/OS Alert → CCI enters extreme reversal zone
Alerts help you stay informed even when away from the screen.
🔎 Keywords (for search discovery):
CCI, CCI Reversal, CCI Alert, Turbo CCI, Advanced CCI, CCI Zones, CCI Overbought, CCI Oversold, Momentum Reversal, CCI Scalping, CongTrader, CCI Buy Sell, Technical Indicator
🙏 Thank You
If this indicator adds value to your trading, please give it a 👍, leave a comment, or follow for more free tools from CongTrader. Your support helps independent creators grow the community.
⚠️ Disclaimer
This indicator is for educational purposes only and does not constitute financial advice. Use this tool with your own judgment and risk management. Past performance does not guarantee future results.
✍️ Created by CongTrader — Free, Open-Source Tools for Smarter Traders...
Mara JPY Strength (USDJPY+EURJPY+GBPJPY)/3 + DXYJPY, USDJPY, EURJPY, GBPJPY, smart money, bias, index, forex indicator, DXY, strength meter, professional, trading tool, price action
Nikkei Session Key Levels Lines (with Labels) - Nikkei CFDThis is Nikkei Session Key Levels Lines (with Labels) - Nikkei CFD. shows you all the key level lines that you need to be aware. hope it helps :)
Nikkei Premarket High/Low LabelThis is Nikkei Premarket High/Low Label. shows you the premarket high and low. hope it helps :)
Nikkei Session Prep (RTH only, UTC-4)This is Nikkei Session Prep (RTH only, UTC-4). hope it helps :)
6E update Session Key Levels Lines (6E CME Day Session)6E update Session Key Levels Lines (6E CME Day Session) hope it helps :)
6E update Premarket High/Low Label (CME 6E style)6E update Premarket High/Low Label (CME 6E style). hope it helps :)
6E update Session Prep (CME Day Session 6E, UTC-4)6E update Session Prep (CME Day Session 6E, UTC-4) updated. hope it helps :)
Ghost Month HighlighterGhost Month and Trading: Understanding the Phenomenon
Ghost Month (鬼月) is the seventh month of the lunar calendar in Chinese culture, typically falling between late July and September. During this period, it's believed that the gates of the afterlife open and spirits roam the earth. This deeply rooted cultural belief has significant implications for Asian markets, particularly in regions with large Chinese populations like Taiwan, Hong Kong, Singapore, and mainland China.
Why Markets Often Decline or Stay Flat During Ghost Month:
Reduced Business Activity : Many businesses avoid launching new products, signing major contracts, or making significant investments during this period, believing it brings bad luck.
Property Market Slowdown : Real estate transactions drop significantly as people avoid moving homes or making large purchases. In some markets, property sales can decline by 20-30%.
IPO and M&A Drought : Companies often delay IPOs and merger announcements until after Ghost Month, reducing market catalysts.
Retail Spending Drops : Consumer spending on big-ticket items decreases, though spending on offerings and religious items increases.
Self-Fulfilling Prophecy : Many traders and investors reduce positions or stay on the sidelines, creating lower volumes and increased volatility. This becomes a self-fulfilling prophecy where expectation of poor performance leads to actual underperformance.
Tourism and Entertainment Impact : Travel and entertainment sectors see reduced activity as people avoid unnecessary trips and celebrations.
Historical data shows that Asian equity markets often underperform during Ghost Month, with some studies indicating average returns can be 2-5% lower than other months. However, this also creates opportunities for contrarian investors who buy during the seasonal weakness.
Inspired by @honey_xbt
Intraday Volume Pulse GSK-VIZAG-AP-INDIA📊 Intraday Volume Pulse — by GSK-VIZAG-AP-INDIA
Overview:
This indicator displays a simple and effective intraday volume summary in table format, starting from a user-defined session time. It provides an approximate breakdown of buy volume, sell volume, cumulative delta, and total volume — all updated in real-time.
🧠 Key Features
✅ Session Start Control
Choose the session start hour and minute (default is 09:15 for NSE).
🌐 Timezone Selector
View volume data in your preferred timezone: IST, GMT, EST, CST, etc.
📈 Buy/Sell Volume Estimation Logic
Buy Volume: When candle closes above open
Sell Volume: When candle closes below open
Equal: Volume split equally if Open == Close
🔄 Daily Auto-Reset
All volume metrics reset at the start of a new trading day.
🎨 Color-Coded Volume Insights
Buy Volume: Green shade if positive
Sell Volume: Red shade if positive
Cumulative Delta: Dynamic red/green based on net pressure
Total Volume: Neutral gray with emphasis text
🧾 Readable Number Formatting
Volumes are displayed in "K", "L", and "Cr" units for easier readability.
📌 Table Positioning
Choose from top/bottom corners to best fit your layout.
⚠️ Note
All data shown is approximate and based on candle structure — it does not reflect actual order book or tick-level data. This is a visual estimation tool to guide real-time intraday decisions.
✍️ Signature
GSK-VIZAG-AP-INDIA
Creator of practical TradingView tools focused on volume dynamics and trader psychology.
FunctionADFLibrary "FunctionADF"
Augmented Dickey-Fuller test (ADF), The ADF test is a statistical method used to assess whether a time series is stationary – meaning its statistical properties (like mean and variance) do not change over time. A time series with a unit root is considered non-stationary and often exhibits non-mean-reverting behavior, which is a key concept in technical analysis.
Reference:
-
- rtmath.net
- en.wikipedia.org
adftest(data, n_lag, conf)
: Augmented Dickey-Fuller test for stationarity.
Parameters:
data (array) : Data series.
n_lag (int) : Maximum lag.
conf (string) : Confidence Probability level used to test for critical value, (`90%`, `95%`, `99%`).
Returns: `adf` The test statistic. \
`crit` Critical value for the test statistic at the 10 % levels. \
`nobs` Number of observations used for the ADF regression and calculation of the critical values.
FU Candle - dnd_whael What the FU Candle Indicator does:
First we need to understand what FU candles are. There's bullish and bearish FU candles.
Bullish FU candles are candles that have a long wick that takes out the previous candles low, then turns around and closes above the high of the previous candle.
Current Price Horizonal LineDisplays a horizonal line across the chart of the current price.
For some reason the screenshot does not capture the indicator horizonal line.