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
Step 3: Multi-Timeframe Trading SessionsFor editing purposes,
This is for editing purposes for developer to edit it before publishing.
7* Previous Bar OHLC + 5m 20 EMAincreased label height for 7* Previous Bar OHLC + 5m 20 EMA. hope it helps :)
Nikkei Premarket High/Low LabelThis is Nikkei Premarket High/Low Label. shows you the premarket high and low. hope it helps :)
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.
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.
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 Session Prep (RTH only, UTC-4)This is Nikkei Session Prep (RTH only, UTC-4). 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
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
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 :)
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.
Session Prep (RTH only, UTC-4)corrected Session Prep (RTH only, UTC-4) now its working properly. hope it helps! :)
EUR/USD Multi-Layer Statistical Regression StrategyStrategy Overview
This advanced EUR/USD trading system employs a triple-layer linear regression framework with statistical validation and ensemble weighting. It combines short, medium, and long-term regression analyses to generate high-confidence directional signals while enforcing strict risk controls.
Core Components
Multi-Layer Regression Engine:
Parallel regression analysis across 3 customizable timeframes (short/medium/long)
Projects future price values using prediction horizons
Statistical significance filters (R-squared, correlation, slope thresholds)
Signal Validation System:
Lookback validation tests historical prediction accuracy
Ensemble weighting of layer signals (adjustable influence per timeframe)
Confidence scoring combining statistical strength, layer agreement, and validation accuracy
Risk Management:
Position sizing scaled by signal confidence (1%-100% of equity)
Daily loss circuit breaker (halts trading at user-defined threshold)
Forex-tailored execution (pip slippage, percentage-based commissions)
Visual Intelligence:
Real-time regression line plots (3 layered colors)
Projection markers for short-term forecasts
Background coloring for market bias indication
Comprehensive statistics dashboard (R-squared metrics, validation scores, P&L)
Key Parameters
Category Settings
Regression Short/Med/Long lengths (20/50/100 bars)
Statistics Min R² (0.65), Correlation (0.7), Slope (0.0001)
Validation 30-bar lookback, 10-bar projection
Risk Controls 50% position size, 12% daily loss limit, 75% confidence threshold
Trading Logic
Entries require:
Ensemble score > |0.5|
Confidence > threshold
Short & medium-term significance
Active daily loss limit not breached
Exits triggered by:
Opposite high-confidence signals
Daily loss limit violation (emergency exit)
The strategy blends quantitative finance techniques with practical trading safeguards, featuring a self-optimizing design where signal quality directly impacts position sizing. The visual dashboard provides real-time feedback on model performance and market conditions.
Premarket High/Low LabelThis is the premarket high low label that will persist through current trading session. hope it helps :)
CCI-MACD Strategy 4.2
I cerchi si basano sull'oscillatore CCI (Commodity Channel Index).
L’indicatore CCI ci permette di osservare se il livello attuale del prezzo è particolarmente al di sopra o al di sotto di una certa media mobile, avente un numero di periodi scelto da noi.
Più la deviazione dal prezzo medio nel breve termine è forte, e maggiormente l’indicatore si allontanerà dallo 0: verso l’alto in caso di uptrend, o verso il basso in caso di downtrend.
Il segnale viene dato quando il valore del CCI supera la linea dello zero.
Il tutto è filtrato con un altro indicatore, il MACD, acronimo di "Moving Average Convergence Divergence", usato per identificare cambiamenti nel momentum del prezzo.
The circles are based on the CCI (Commodity Channel Index) oscillator.
The CCI indicator allows us to observe whether the current price level is significantly above or below a certain moving average, with a number of periods chosen by us.
The greater the deviation from the short-term average price, the further the indicator will deviate from 0: upwards in the case of an uptrend, or downwards in the case of a downtrend.
The signal is given when the CCI value crosses the zero line.
This is all filtered through another indicator, the MACD, which stands for "Moving Average Convergence Divergence," used to identify changes in price momentum.
Simple 5 Moving Averages 5 MAs - Shubhashish DixitEnjoy the 5 Moving Average to Support your analysis deeper