Math by Thomas Swing RangeMath by Thomas Swing Range is a simple yet powerful tool designed to visually highlight key swing levels in the market based on a user-defined lookback period. It identifies the highest high, lowest low, and calculates the midpoint between them — creating a clear range for swing trading strategies.
These levels can help traders:
Spot potential support and resistance zones
Analyze price rejection near range boundaries
Frame mean-reversion or breakout setups
The indicator continuously updates and extends these lines into the future, making it easier to plan and manage trades with visual clarity.
🛠️ How to Use
Add to Chart:
Apply the indicator on any timeframe and asset (works best on higher timeframes like 1H, 4H, or Daily).
Configure Parameters:
Lookback Period: Number of candles used to detect the highest high and lowest low. Default is 20.
Extend Lines by N Bars: Number of future bars the levels should be projected to the right.
Interpret Lines:
🔴 Red Line: Swing High (Resistance)
🟢 Green Line: Swing Low (Support)
🔵 Blue Line: Midpoint (Mean level — useful for equilibrium-based strategies)
Trade Ideas:
Bounce trades from swing high/low zones.
Breakout confirmation if price closes strongly outside the range.
Reversion trades if price moves toward the midpoint after extreme moves.
Indicators and strategies
Bollinger Bands - Multi Symbol Alert (Miu)This script extends the classic Bollinger Bands indicator with support for up to 8 user-defined symbols and a unique alert system.
Unlike traditional Bollinger Band indicators, it allows traders to configure alerts across multiple assets without keeping the indicator visible on the chart, making it ideal for passive multi-asset monitoring.
What it does:
This script calculates Bollinger Bands using a 100-period simple moving average and a standard deviation multiplier of 3 (or any input you set in the settings panel).
For each selected symbol, the upper and lower bands are retrieved using request.security() and monitored for breakouts.
Alerts are triggered when the closing price of the selected symbol breaks above the upper band (Overbought) or below the lower band (Oversold) — at the bar close.
How to use it:
1) Add the indicator to your chart.
2) Open the settings panel.
3) Select up to 8 symbols to monitor.
4) After setting parameters, click the three dots next to the indicator title and choose "Add Alert on...".
5) Name your alert and confirm.
6) If you don’t wish to keep the indicator visible, you can remove it from the chart — alerts will still function as expected.
Alert message includes:
- Symbol name (e.g., BTC, ETH, LTC)
- (OB) for overbought or (OS) for oversold
- Symbol’s price at the alert moment
Technical note:
This script uses request.security() to fetch Bollinger Band levels and closing prices from up to 8 selected symbols in real time.
Feel free to leave your feedback or suggestions in the comments section below.
Enjoy!
Spectral Order Flow Resonance (SOFR) Spectral Order Flow Resonance (SOFR)
See the Market’s Hidden Rhythms—Trade the Resonance, Not the Noise!
The Spectral Order Flow Resonance (SOFR) is a next-generation tool for traders who want to go beyond price and volume, tapping into the underlying “frequency signature” of order flow itself. Instead of chasing lagging signals or reacting to surface-level volatility, SOFR lets you visualize and quantify the real-time resonance of market activity—helping you spot when the crowd is in sync, and when the regime is about to shift.
What Makes SOFR Unique?
Not Just Another Oscillator:
SOFR doesn’t just measure momentum or volume. It applies spectral analysis (using Fast Fourier Transform) to normalized order flow, extracting the dominant cycles and their resonance strength. This reveals when the market is harmonizing around key frequencies—often the precursor to major moves.
Regime Detection, Not Guesswork:
By tracking harmonic alignment and phase coherence across multiple Fibonacci-based frequencies, SOFR identifies when the market is entering a bullish, bearish, or neutral resonance regime. This is visualized with a dynamic dashboard and info line, so you always know the current state at a glance.
Dynamic Dashboard:
The on-chart dashboard color-codes each key metric—regime, dominant frequency, harmonic alignment, phase coherence, and energy concentration—so you can instantly gauge the strength and direction of the current resonance. No more guesswork or clutter.
Universal Application:
Works on any asset, any timeframe, and in any market—futures, stocks, crypto, forex. If there’s order flow, SOFR can reveal its hidden structure.
How Does It Work?
Order Flow Normalization:
SOFR calculates the net buying/selling pressure and normalizes it using a rolling mean and standard deviation, making the signal robust across assets and timeframes.
Spectral Analysis:
The script applies FFT to the normalized order flow, extracting the magnitude and phase of several key frequencies (typically Fibonacci numbers). This allows you to see which cycles are currently dominating the market.
Resonance & Regime Logic:
When multiple frequencies align and exceed a dynamic resonance threshold, and phase coherence is high, SOFR detects a “resonance regime”—bullish, bearish, or neutral. This is when the market is most likely to experience a strong, sustained move.
Visual Clarity:
The indicator plots each frequency’s magnitude, highlights the dominant one, and provides a real-time dashboard with color-coded metrics for instant decision-making.
SOFR Dashboard Metrics Explained
Regime:
What it means: The current “state” of the market as detected by SOFR—Bullish, Bearish, or Neutral.
Why it matters: The regime tells you whether the market’s order flow is resonating in a way that favors upward moves (Bullish), downward moves (Bearish), or is out of sync (Neutral). This helps you align your trades with the prevailing market force, or stand aside when there’s no clear edge.
Dominant Freq:
What it means: The most powerful frequency (cycle length, in bars) currently detected in the order flow.
Why it matters: Markets often move in cycles. The dominant frequency shows which cycle is currently driving price action, helping you time entries and exits with the market’s “heartbeat.”
Harmonic Align:
What it means: The number of key frequencies (out of 3) that are currently in resonance (above threshold).
Why it matters: When multiple frequencies align, it signals that different groups of traders (with different time horizons) are acting in concert. This increases the probability of a strong, sustained move.
Phase Coh.:
What it means: A measure (0–100%) of how “in sync” the phases of the key frequencies are.
Why it matters: High phase coherence means the market’s cycles are reinforcing each other, not cancelling out. This is a classic signature of trending or explosive moves.
Energy Conc.:
What it means: The concentration of spectral energy in the dominant frequency, relative to the average.
Why it matters: High energy concentration means the market’s activity is focused in one cycle, increasing the odds of a decisive move. Low concentration means the market is scattered and less predictable.
How to Use
Bullish Regime:
When the dashboard shows a green regime and high harmonic alignment, the market is in a bullish resonance—look for long opportunities or trend continuations.
Bearish Regime:
When the regime is red and alignment is high, the market is in a bearish resonance—look for short opportunities or trend continuations.
Neutral Regime:
When the regime is gray or alignment is low, the market is out of sync—consider waiting for clearer signals or using other tools.
Combine with Your Strategy:
Use SOFR as a confirmation tool, a filter for trend/range conditions, or as a standalone regime detector. The dashboard’s color-coded metrics help you instantly spot when the market is entering or exiting resonance.
Inputs Explained
FFT Window Length :
Controls the number of bars used for spectral analysis. Higher values smooth the signal, lower values make it more sensitive.
Order Flow Period:
Sets the lookback for normalizing order flow. Shorter periods react faster, longer periods are smoother.
Fibonacci Frequencies:
Choose which cycles to analyze. Default values (5, 8, 13) capture common market rhythms.
Resonance Threshold:
Sets how strong a frequency’s signal must be to count as “in resonance.” Lower for more signals, higher for stricter filtering.
Signal Smoothing & Amplify:
Fine-tune the display for your chart and asset.
Dashboard & Info Line Toggles:
Show or hide the on-chart dashboard and info line as needed.
Why This Matters
Most indicators show you what just happened. SOFR shows you when the market is entering a state of resonance—when crowd behavior is most likely to produce powerful, sustained moves. By visualizing the hidden structure of order flow, you gain a tactical edge over traders who only see the surface.
For educational purposes only. Not financial advice. Always use proper risk management.
Use with discipline. Trade your edge.
— Dskyz, for DAFE Trading Systems
FVG (Nephew sam remake)Hello i am making my own FVG script inspired by Nephew Sam as his fvg code is not open source. My goal is to replicate his Script and then add in alerts and more functions. Thus, i spent few days trying to code. There is bugs such as lower time frame not showing higher time frame FVG.
This script automatically detects and visualizes Fair Value Gaps (FVGs) — imbalances between demand and supply — across multiple timeframes (15-minute, 1-hour, and 4-hour).
15m chart shows:
15m FVGs (green/red boxes)
1H FVGs (lime/maroon)
4H FVGs (faded green/red with borders) (Bugged For now i only see 1H appearing)
1H chart shows:
1H FVGs
4H FVGs
4H chart shows:
4H FVGs only
There is the function to auto close FVG when a future candle fully disrespected it.
You're welcome to:
🔧 Customize the appearance: adjust box colors, transparency, border style
🧪 Add alerts: e.g., when price enters or fills a gap
📅 Expand to Daily/Weekly: just copy the logic and plug in "D" or "W" as new layers
📈 Build confluence logic: combine this with order blocks, liquidity zones, or ICT concepts
🧠 Experiment with entry signals: e.g., candle confirmation on return to FVG
🚀 Improve performance: if you find a lighter way to track gaps, feel free to optimize!
MACD Crossover with Price Action and AlertsThe MACD should use the default parameters (12, 26, 9) for fast EMA, slow EMA, and signal EMA, respectively, applied to the Close price. Instead of simple MACD crossovers, the indicator should analyze price action in relation to the MACD histogram to generate signals. Specifically: 1. BUY signal: Generate a buy signal (an up arrow displayed below the low of the signal bar in green color) when the MACD histogram crosses above zero AND the price action shows a bullish engulfing pattern (the current candle's body completely engulfs the previous candle's body). 2. SELL signal: Generate a sell signal (a down arrow displayed above the high of the signal bar in red color) when the MACD histogram crosses below zero AND the price action shows a bearish engulfing pattern (the current candle's body completely engulfs the previous candle's body). The arrows should be non-repainting, meaning that once an arrow is plotted on a bar, it should not disappear or change position as the chart updates. The indicator should also plot the MACD line, signal line, and histogram using their default calculations. The MACD line should be blue, the signal line should be orange, and the histogram should be displayed using green bars for positive values and red bars for negative values. The indicator should also have customizable inputs for the MACD fast EMA period, slow EMA period, signal EMA period and engulfing pattern check enabled/disabled. If engulfing pattern check disabled, the indicator will generate signals based only on MACD histogram crossing zero.
Price/MA Deviation AngleThis indicator visualizes the angular deviation of price from a selected moving average (default: 21 EMA). It calculates the angle, in degrees, formed by the vertical distance between price and the moving average — assuming a one-bar horizontal distance.
Positive angles indicate upward deviation (bullish pressure).
Negative angles reflect downward deviation (bearish pressure).
0° represents perfect alignment between price and the MA.
±45° thresholds can be used as reference for strong momentum.
This tool offers a normalized, intuitive perspective on price momentum using geometric interpretation rather than price-to-price delta.
Dual Bollinger BandsIndicator Name:
Double Bollinger Bands (2-9 & 2-20)
Description:
This indicator plots two sets of Bollinger Bands on a single chart for enhanced volatility and trend analysis:
Fast Bands (2-9 Length) – Voilet
More responsive to short-term price movements.
Useful for spotting quick reversals or scalping opportunities.
Slow Bands (2-20 Length) – Black
Smoother, trend-following bands for longer-term context.
Helps confirm broader market direction.
Both bands use the standard settings (2 deviations, SMA basis) for consistency. The transparent fills improve visual clarity while keeping the chart uncluttered.
Use Cases:
Trend Confirmation: When both bands expand together, it signals strong momentum.
Squeeze Alerts: A tight overlap suggests low volatility before potential breakouts.
Multi-Timeframe Analysis: Compare short-term vs. long-term volatility in one view.
How to Adjust:
Modify lengths (2-9 and 2-20) in the settings.
Change colors or transparency as needed.
Why Use This Script?
No Repainting – Uses standard Pine Script functions for reliability.
Customizable – Easy to tweak for different trading styles.
Clear Visuals – Color-coded bands with background fills for better readability.
Ideal For:
Swing traders, day traders, and volatility scalpers.
Combining short-term and long-term Bollinger Band strategies.
Bear Market Probability Model# Bear Market Probability Model: A Multi-Factor Risk Assessment Framework
The Bear Market Probability Model represents a comprehensive quantitative framework for assessing systemic market risk through the integration of 13 distinct risk factors across four analytical categories: macroeconomic indicators, technical analysis factors, market sentiment measures, and market breadth metrics. This indicator synthesizes established financial research methodologies to provide real-time probabilistic assessments of impending bear market conditions, offering institutional-grade risk management capabilities to retail and professional traders alike.
## Theoretical Foundation
### Historical Context of Bear Market Prediction
Bear market prediction has been a central focus of financial research since the seminal work of Dow (1901) and the subsequent development of technical analysis theory. The challenge of predicting market downturns gained renewed academic attention following the market crashes of 1929, 1987, 2000, and 2008, leading to the development of sophisticated multi-factor models.
Fama and French (1989) demonstrated that certain financial variables possess predictive power for stock returns, particularly during market stress periods. Their three-factor model laid the groundwork for multi-dimensional risk assessment, which this indicator extends through the incorporation of real-time market microstructure data.
### Methodological Framework
The model employs a weighted composite scoring methodology based on the theoretical framework established by Campbell and Shiller (1998) for market valuation assessment, extended through the incorporation of high-frequency sentiment and technical indicators as proposed by Baker and Wurgler (2006) in their seminal work on investor sentiment.
The mathematical foundation follows the general form:
Bear Market Probability = Σ(Wi × Ci) / ΣWi × 100
Where:
- Wi = Category weight (i = 1,2,3,4)
- Ci = Normalized category score
- Categories: Macroeconomic, Technical, Sentiment, Breadth
## Component Analysis
### 1. Macroeconomic Risk Factors
#### Yield Curve Analysis
The inclusion of yield curve inversion as a primary predictor follows extensive research by Estrella and Mishkin (1998), who demonstrated that the term spread between 3-month and 10-year Treasury securities has historically preceded all major recessions since 1969. The model incorporates both the 2Y-10Y and 3M-10Y spreads to capture different aspects of monetary policy expectations.
Implementation:
- 2Y-10Y Spread: Captures market expectations of monetary policy trajectory
- 3M-10Y Spread: Traditional recession predictor with 12-18 month lead time
Scientific Basis: Harvey (1988) and subsequent research by Ang, Piazzesi, and Wei (2006) established the theoretical foundation linking yield curve inversions to economic contractions through the expectations hypothesis of the term structure.
#### Credit Risk Premium Assessment
High-yield credit spreads serve as a real-time gauge of systemic risk, following the methodology established by Gilchrist and Zakrajšek (2012) in their excess bond premium research. The model incorporates the ICE BofA High Yield Master II Option-Adjusted Spread as a proxy for credit market stress.
Threshold Calibration:
- Normal conditions: < 350 basis points
- Elevated risk: 350-500 basis points
- Severe stress: > 500 basis points
#### Currency and Commodity Stress Indicators
The US Dollar Index (DXY) momentum serves as a risk-off indicator, while the Gold-to-Oil ratio captures commodity market stress dynamics. This approach follows the methodology of Akram (2009) and Beckmann, Berger, and Czudaj (2015) in analyzing commodity-currency relationships during market stress.
### 2. Technical Analysis Factors
#### Multi-Timeframe Moving Average Analysis
The technical component incorporates the well-established moving average convergence methodology, drawing from the work of Brock, Lakonishok, and LeBaron (1992), who provided empirical evidence for the profitability of technical trading rules.
Implementation:
- Price relative to 50-day and 200-day simple moving averages
- Moving average convergence/divergence analysis
- Multi-timeframe MACD assessment (daily and weekly)
#### Momentum and Volatility Analysis
The model integrates Relative Strength Index (RSI) analysis following Wilder's (1978) original methodology, combined with maximum drawdown analysis based on the work of Magdon-Ismail and Atiya (2004) on optimal drawdown measurement.
### 3. Market Sentiment Factors
#### Volatility Index Analysis
The VIX component follows the established research of Whaley (2009) and subsequent work by Bekaert and Hoerova (2014) on VIX as a predictor of market stress. The model incorporates both absolute VIX levels and relative VIX spikes compared to the 20-day moving average.
Calibration:
- Low volatility: VIX < 20
- Elevated concern: VIX 20-25
- High fear: VIX > 25
- Panic conditions: VIX > 30
#### Put-Call Ratio Analysis
Options flow analysis through put-call ratios provides insight into sophisticated investor positioning, following the methodology established by Pan and Poteshman (2006) in their analysis of informed trading in options markets.
### 4. Market Breadth Factors
#### Advance-Decline Analysis
Market breadth assessment follows the classic work of Fosback (1976) and subsequent research by Brown and Cliff (2004) on market breadth as a predictor of future returns.
Components:
- Daily advance-decline ratio
- Advance-decline line momentum
- McClellan Oscillator (Ema19 - Ema39 of A-D difference)
#### New Highs-New Lows Analysis
The new highs-new lows ratio serves as a market leadership indicator, based on the research of Zweig (1986) and validated in academic literature by Zarowin (1990).
## Dynamic Threshold Methodology
The model incorporates adaptive thresholds based on rolling volatility and trend analysis, following the methodology established by Pagan and Sossounov (2003) for business cycle dating. This approach allows the model to adjust sensitivity based on prevailing market conditions.
Dynamic Threshold Calculation:
- Warning Level: Base threshold ± (Volatility × 1.0)
- Danger Level: Base threshold ± (Volatility × 1.5)
- Bounds: ±10-20 points from base threshold
## Professional Implementation
### Institutional Usage Patterns
Professional risk managers typically employ multi-factor bear market models in several contexts:
#### 1. Portfolio Risk Management
- Tactical Asset Allocation: Reducing equity exposure when probability exceeds 60-70%
- Hedging Strategies: Implementing protective puts or VIX calls when warning thresholds are breached
- Sector Rotation: Shifting from growth to defensive sectors during elevated risk periods
#### 2. Risk Budgeting
- Value-at-Risk Adjustment: Incorporating bear market probability into VaR calculations
- Stress Testing: Using probability levels to calibrate stress test scenarios
- Capital Requirements: Adjusting regulatory capital based on systemic risk assessment
#### 3. Client Communication
- Risk Reporting: Quantifying market risk for client presentations
- Investment Committee Decisions: Providing objective risk metrics for strategic decisions
- Performance Attribution: Explaining defensive positioning during market stress
### Implementation Framework
Professional traders typically implement such models through:
#### Signal Hierarchy:
1. Probability < 30%: Normal risk positioning
2. Probability 30-50%: Increased hedging, reduced leverage
3. Probability 50-70%: Defensive positioning, cash building
4. Probability > 70%: Maximum defensive posture, short exposure consideration
#### Risk Management Integration:
- Position Sizing: Inverse relationship between probability and position size
- Stop-Loss Adjustment: Tighter stops during elevated risk periods
- Correlation Monitoring: Increased attention to cross-asset correlations
## Strengths and Advantages
### 1. Comprehensive Coverage
The model's primary strength lies in its multi-dimensional approach, avoiding the single-factor bias that has historically plagued market timing models. By incorporating macroeconomic, technical, sentiment, and breadth factors, the model provides robust risk assessment across different market regimes.
### 2. Dynamic Adaptability
The adaptive threshold mechanism allows the model to adjust sensitivity based on prevailing volatility conditions, reducing false signals during low-volatility periods and maintaining sensitivity during high-volatility regimes.
### 3. Real-Time Processing
Unlike traditional academic models that rely on monthly or quarterly data, this indicator processes daily market data, providing timely risk assessment for active portfolio management.
### 4. Transparency and Interpretability
The component-based structure allows users to understand which factors are driving risk assessment, enabling informed decision-making about model signals.
### 5. Historical Validation
Each component has been validated in academic literature, providing theoretical foundation for the model's predictive power.
## Limitations and Weaknesses
### 1. Data Dependencies
The model's effectiveness depends heavily on the availability and quality of real-time economic data. Federal Reserve Economic Data (FRED) updates may have lags that could impact model responsiveness during rapidly evolving market conditions.
### 2. Regime Change Sensitivity
Like most quantitative models, the indicator may struggle during unprecedented market conditions or structural regime changes where historical relationships break down (Taleb, 2007).
### 3. False Signal Risk
Multi-factor models inherently face the challenge of balancing sensitivity with specificity. The model may generate false positive signals during normal market volatility periods.
### 4. Currency and Geographic Bias
The model focuses primarily on US market indicators, potentially limiting its effectiveness for global portfolio management or non-USD denominated assets.
### 5. Correlation Breakdown
During extreme market stress, correlations between risk factors may increase dramatically, reducing the model's diversification benefits (Forbes and Rigobon, 2002).
## References
Akram, Q. F. (2009). Commodity prices, interest rates and the dollar. Energy Economics, 31(6), 838-851.
Ang, A., Piazzesi, M., & Wei, M. (2006). What does the yield curve tell us about GDP growth? Journal of Econometrics, 131(1-2), 359-403.
Baker, M., & Wurgler, J. (2006). Investor sentiment and the cross‐section of stock returns. The Journal of Finance, 61(4), 1645-1680.
Baker, S. R., Bloom, N., & Davis, S. J. (2016). Measuring economic policy uncertainty. The Quarterly Journal of Economics, 131(4), 1593-1636.
Barber, B. M., & Odean, T. (2001). Boys will be boys: Gender, overconfidence, and common stock investment. The Quarterly Journal of Economics, 116(1), 261-292.
Beckmann, J., Berger, T., & Czudaj, R. (2015). Does gold act as a hedge or a safe haven for stocks? A smooth transition approach. Economic Modelling, 48, 16-24.
Bekaert, G., & Hoerova, M. (2014). The VIX, the variance premium and stock market volatility. Journal of Econometrics, 183(2), 181-192.
Brock, W., Lakonishok, J., & LeBaron, B. (1992). Simple technical trading rules and the stochastic properties of stock returns. The Journal of Finance, 47(5), 1731-1764.
Brown, G. W., & Cliff, M. T. (2004). Investor sentiment and the near-term stock market. Journal of Empirical Finance, 11(1), 1-27.
Campbell, J. Y., & Shiller, R. J. (1998). Valuation ratios and the long-run stock market outlook. The Journal of Portfolio Management, 24(2), 11-26.
Dow, C. H. (1901). Scientific stock speculation. The Magazine of Wall Street.
Estrella, A., & Mishkin, F. S. (1998). Predicting US recessions: Financial variables as leading indicators. Review of Economics and Statistics, 80(1), 45-61.
Fama, E. F., & French, K. R. (1989). Business conditions and expected returns on stocks and bonds. Journal of Financial Economics, 25(1), 23-49.
Forbes, K. J., & Rigobon, R. (2002). No contagion, only interdependence: measuring stock market comovements. The Journal of Finance, 57(5), 2223-2261.
Fosback, N. G. (1976). Stock market logic: A sophisticated approach to profits on Wall Street. The Institute for Econometric Research.
Gilchrist, S., & Zakrajšek, E. (2012). Credit spreads and business cycle fluctuations. American Economic Review, 102(4), 1692-1720.
Harvey, C. R. (1988). The real term structure and consumption growth. Journal of Financial Economics, 22(2), 305-333.
Kahneman, D., & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. Econometrica, 47(2), 263-291.
Magdon-Ismail, M., & Atiya, A. F. (2004). Maximum drawdown. Risk, 17(10), 99-102.
Nickerson, R. S. (1998). Confirmation bias: A ubiquitous phenomenon in many guises. Review of General Psychology, 2(2), 175-220.
Pagan, A. R., & Sossounov, K. A. (2003). A simple framework for analysing bull and bear markets. Journal of Applied Econometrics, 18(1), 23-46.
Pan, J., & Poteshman, A. M. (2006). The information in option volume for future stock prices. The Review of Financial Studies, 19(3), 871-908.
Taleb, N. N. (2007). The black swan: The impact of the highly improbable. Random House.
Whaley, R. E. (2009). Understanding the VIX. The Journal of Portfolio Management, 35(3), 98-105.
Wilder, J. W. (1978). New concepts in technical trading systems. Trend Research.
Zarowin, P. (1990). Size, seasonality, and stock market overreaction. Journal of Financial and Quantitative Analysis, 25(1), 113-125.
Zweig, M. E. (1986). Winning on Wall Street. Warner Books.
Multi-Session ORBThe Multi-Session ORB Indicator is a customizable Pine Script (version 6) tool designed for TradingView to plot Opening Range Breakout (ORB) levels across four major trading sessions: Sydney, Tokyo, London, and New York. It allows traders to define specific ORB durations and session times in Central Daylight Time (CDT), making it adaptable to various trading strategies.
Key Features:
1. Customizable ORB Duration: Users can set the ORB duration (default: 15 minutes) via the inputMax parameter, determining the time window for calculating the high and low of each session’s opening range.
2. Flexible Session Times: The indicator supports user-defined session and ORB times for:
◦ Sydney: Default ORB (17:00–17:15 CDT), Session (17:00–01:00 CDT)
◦ Tokyo: Default ORB (19:00–19:15 CDT), Session (19:00–04:00 CDT)
◦ London: Default ORB (02:00–02:15 CDT), Session (02:00–11:00 CDT)
◦ New York: Default ORB (08:30–08:45 CDT), Session (08:30–16:00 CDT)
3. Session-Specific ORB Levels: For each session, the indicator calculates and tracks the high and low prices during the specified ORB period. These levels are updated dynamically if new highs or lows occur within the ORB timeframe.
4. Visual Representation:
◦ ORB high and low lines are plotted only during their respective session times, ensuring clarity.
◦ Each session’s lines are color-coded for easy identification:
▪ Sydney: Light Yellow (high), Dark Yellow (low)
▪ Tokyo: Light Pink (high), Dark Pink (low)
▪ London: Light Blue (high), Dark Blue (low)
▪ New York: Light Purple (high), Dark Purple (low)
◦ Lines are drawn with a linewidth of 2 and disappear when the session ends or if the timeframe is not intraday (or exceeds the ORB duration).
5. Intraday Compatibility: The indicator is optimized for intraday timeframes (e.g., 1-minute to 15-minute charts) and only displays when the chart’s timeframe multiplier is less than or equal to the ORB duration.
How It Works:
• Session Detection: The script uses the time() function to check if the current bar falls within the user-defined ORB or session time windows, accounting for all days of the week.
• ORB Logic: At the start of each session’s ORB period, the script initializes the high and low based on the first bar’s prices. It then updates these levels if subsequent bars within the ORB period exceed the current high or fall below the current low.
• Plotting: ORB levels are plotted as horizontal lines during the respective session, with visibility controlled to avoid clutter outside session times or on incompatible timeframes.
Use Case:
Traders can use this indicator to identify key breakout levels for each trading session, facilitating strategies based on price action around the opening range. The flexibility to adjust ORB and session times makes it suitable for various markets (e.g., forex, stocks, or futures) and time zones.
Limitations:
• The indicator is designed for intraday timeframes and may not display on higher timeframes (e.g., daily or weekly) or if the timeframe multiplier exceeds the ORB duration.
• Time inputs are in CDT, requiring users to adjust for their local timezone or market requirements.
• If you need to use this for GC/CL/SPY/QQQ you have to adjust the times by one hour.
This indicator is ideal for traders focusing on session-based breakout strategies, offering clear visualization and customization for global market sessions.
Bitcoin Open Interest [SAKANE]Bitcoin Open Interest
— Unveiling the True Flow of Capital
PurposeVisualize and compare Bitcoin open interest (OI) from CME and Binance, the leading derivatives exchanges, in a single intuitive chart, providing traders with clear insights into crypto market capital dynamics.
Background & MotivationIn the 24/7 crypto market, price movements alone reveal only part of the story. Open interest (OI)—the total outstanding futures contracts—offers critical clues to the market’s next move. Yet, accessing and interpreting OI data is challenging:
CME Constraints: Commitment of Traders (COT) reports are weekly, and standalone BTC1! or BTC2! OI is noisy due to contract rollovers, obscuring true OI changes.
Existing Tool Limitations: Most OI indicators are fixed to either USD or BTC, limiting flexible analysis.
This indicator overcomes these hurdles, enabling seamless comparison of CME and Binance OI to track the market’s “capital center of gravity” in real time.
Key Features
Synthetic CME OI: Combines BTC1! and BTC2! to deliver high-accuracy OI, eliminating rollover noise.
Multi-Timeframe Analysis: Displays daily CME OI as pseudo-candlestick (OHLC) on any timeframe (e.g., 4H), allowing intuitive capital flow tracking across timeframes.
CME/Binance One-Click Toggle: Instantly compare institutional-driven CME and retail-driven Binance OI.
USD/BTC Flexibility: Switch between BTC (real demand) and USD (margin) perspectives for OI analysis.
Robust Design: Concise, global-scope code ensures stability and adaptability to TradingView updates.
Insights & Use Cases
Holistic Market Sentiment: Analyze capital flows by region and exchange for a multidimensional view.
Signal Detection: E.g., a sharp drop in CME OI during a sell-off may signal institutional withdrawal.
Retail Trends: A surge in Binance OI suggests retail-driven inflows.
Event-Driven Insights: E.g., during a hypothetical April 2025 “Trump Tariff Shock,” instantly identify which exchange drives capital shifts.
Unique ValueUnlike price-centric indicators, this tool focuses on capital flow (OI). It’s the only indicator offering one-click multi-timeframe and multi-exchange OI comparison, empowering traders to uncover the market’s “true intent” and gain a strategic edge.
ConclusionBitcoin Open Interest makes the market’s hidden capital movements accessible to all. By capturing market dynamics and pinpointing the “leading forces” during events, it sets a new standard for traders seeking a revolutionary perspective.
GCM Centre Line Candle MarkerGCM Centre Line Candle Marker (GCM-CLCM) - Descriptive Notes
Indicator Overview:
The "GCM Centre Line Candle Marker" is a versatile TradingView overlay indicator designed to enhance chart analysis by drawing short horizontal lines at user-defined "centre" points of candles. These lines provide a quick visual reference to key price levels within each candle, such as midpoints, open, close, or typical prices. The indicator offers extensive customization for line appearance, positioning, and conditional display, including an option to highlight only bullish engulfing patterns.
Key Features:
1. Customizable Line Position:
o Users can choose from various methods to calculate the "centre" price for the line:
(High + Low) / 2 (Default)
(Open + Close) / 2
Close
Open
(Open + High + Low + Close) / 4 (HLCO/4)
(Open + High + Close) / 3 (Typical Price HLC/3 variation)
(Open + Close + Low) / 3 (Typical Price OCL/3 variation)
2. Line Appearance Customization:
o Visibility: Toggle lines on/off.
o Style: Solid, dotted, or dashed lines.
o Width: Adjustable line thickness (1 to 5).
o Length: Defines how many candles forward the line extends (1 to 10).
o Color: Lines are colored based on candle type (bullish/bearish), with user-selectable base colors.
o Dynamic Opacity: Line opacity is dynamically adjusted based on the candle's size relative to recent candles. Larger candles produce more opaque lines (up to the user-defined maximum opacity), while smaller candles result in more transparent lines. This helps significant candles stand out.
3. Price Labels:
o Show Labels: Option to display price labels at the end of each center line.
o Label Background Color: Customizable.
o Dynamic Text Color: Label text color can change based on the movement of the center price:
Green: Current center price is higher than the previous.
Red: Current center price is lower than the previous.
Gray: No change or first label.
o Static Text Color: Alternatively, a fixed color can be used for all labels.
4. Conditional Drawing - Bullish Engulfing Filter:
o Users can enable an option to Only Show Bullish Engulfing Candles. When active, center lines will only be drawn for candles that meet bullish engulfing criteria (current bull candle's body engulfs the previous bear candle's body).
5. Performance Management:
o Max Lines to Show: Limits the number of historical lines displayed on the chart to maintain clarity and performance. Older lines are automatically removed as new ones are drawn.
6. Alert Condition:
o Includes a built-in alert: Big Bullish Candle. This alert triggers when a bullish candle's range (high - low) is greater than the 20-period simple moving average (SMA) of candle ranges.
How It Works:
• For each new candle, the script calculates the "center" price based on the user's Line Position selection.
• If showLines is enabled and (if applicable) the bullish engulfing condition is met, a new line is drawn from the current candle's bar_index at the calculated _center price, extending lineLength candles forward.
• The line's color is determined by whether the candle is bullish (close > open) or bearish (close < open).
• Opacity is calculated dynamically: scaledOpacity = int((100 - maxUserOpacity) * (1 - dynamicFactor) + maxUserOpacity), where dynamicFactor is candleSize / maxSize (current candle size relative to the max size in the last 20 candles). This means maxUserOpacity is the least transparent the line will be (for the largest candles), and smaller candles will have lines approaching full transparency.
• Optional price labels are added at the end of these lines.
• The script manages an array of drawn lines, removing the oldest ones if the maxLines limit is exceeded.
Potential Use Cases:
• Visualizing Intra-Candle Levels: Quickly see midpoints or other key price points without manual drawing.
• Short-Term Reference Points: The extended lines can act as very short-term dynamic support/resistance or points of interest.
• Pattern Recognition: Highlight bullish engulfing patterns or simply emphasize candles based on their calculated center.
• Volatility Indication: The dynamic opacity can subtly indicate periods of larger or smaller candle ranges.
• Confirmation Tool: Use in conjunction with other indicators or trading strategies.
User Input Groups:
• Line Settings: Controls all aspects of the line's appearance and calculation.
• Label Settings: Manages the display and appearance of price labels.
• Other Settings: Contains options for line management and conditional filtering (like Bullish Engulfing).
This indicator provides a clean and customizable way to mark significant price levels within candles, aiding traders in their technical analysis.
Swing-Based Volatility IndexSwing-Based Volatility Index
This indicator helps traders quickly determine whether the market has moved enough over the past few hours to justify scalping.
It measures the percentage price swing (high to low) over a configurable time window (e.g., last 4–8 hours) and compares it to a minimum threshold (e.g., 1%).
✅ If the percent move exceeds the threshold → Market is volatile enough to scalp (green background).
🚫 If it's below the threshold → Market is too quiet (red background).
Features:
Adjustable lookback period in hours
Custom threshold for volatility sensitivity
Automatically adapts to the current chart timeframe
This tool is ideal for scalpers and short-term traders who want to avoid entering trades in low-volatility environments.
Multi-EnvelopeRMA Multi-Envelope Indicator
The RMA Multi-Envelope Indicator is a technical analysis tool designed for TradingView, utilizing Pine Script v6. It creates eight customizable envelope bands around a 200-period Running Moving Average (RMA) on a 5-minute timeframe, based on current market measurements. Each band has independent upper and lower percentage deviations, preset to: Band 1 (0.42%, 0.46%), Band 2 (0.78%, 0.69%), Band 3 (1.01%, 1.03%), Band 4 (1.36%, 1.39%), Band 5 (1.80%, 1.62%), Band 6 (2.15%, 2.13%), Band 7 (2.93%, 2.81%), and Band 8 (4.65%, 4.18%). Users can adjust the timeframe, moving average type (RMA, SMA, or EMA), length, and colors for the basis line and bands via hex codes (e.g., #FF6D00 for the basis and Band 8) with semi-transparent color.rgb fills. Ideal for identifying support/resistance, overbought/oversold conditions, or trend boundaries on a 5-minute chart.
Quarter ICT Theo TradeQuarter ICT | Theo Trade
The "Multi-Level Yearly Divisions" indicator is a visual tool designed for TradingView charts. Its primary purpose is to help traders and analysts visualize and analyze price action within a structured, hierarchical breakdown of the year. It divides each year into progressively smaller, equal time segments, allowing for detailed observation of how markets behave during specific portions of the year, quarters, and even finer sub-divisions.
Yearly Detection: It first identifies the start of each new year on the chart.
Four Levels of Division:
Level 0: Marks the beginning of the year with a distinct line.
Level 1 (Quarters): Divides the entire year into four equal parts (quarters).
Level 2: Each quarter is then further divided into four equal smaller segments.
Level 3: Each of these Level 2 segments is again divided into four equal parts.
Level 4: Finally, each Level 3 segment is divided into four more equal parts.
multi-tf standard devs [keypoems]Multi-Timeframe Standard Deviations Levels
A visual map of “how far is too far” across any three higher time-frames.
1. What it does
This script plots dynamic price “rails” built from standard deviation (StDev)—the same math that underpins the bell curve—on up to three higher-time-frames (HTFs) at once.
• It measures the volatility of intraday open-to-close increments, reaching back as far as 5000 bars (≈ 20 years on daily data).
• Each HTF can be extended to the next session or truncated at session close for tidy dashboards.
• Lines can be mirrored so you see symmetric positive/negative bands, and optional background fills shade the “probability cone.”
Because ≈ 68 % of moves live inside ±1 StDev, ≈ 95 % inside ±2, and ≈ 99.7 % inside ±3, the plot instantly shows when price is statistically stretched or compressed.
3. Key settings
Higher Time-Frame #1-3 Turn each HTF on/off, pick the interval (anything from 1 min to 1 year), and decide whether lines should extend into the next period.
Show levels for last X days Keep your chart clean by limiting how many historical sessions are displayed (1-50).
Based on last X periods Length of the StDev sample. Long look-backs (e.g. 5 000) iron-out day-to-day noise; short look-backs make the bands flex with recent volatility.
Fib Settings Toggle each multiple, line thickness/style/colour, label size, whether to print the numeric level, the live price, the HTF label, and whether to tint the background (choose your own opacity).
4. Under-the-hood notes
StDev is calculated on (close – open) / open rather than absolute prices, making the band width scale-agnostic.
Watch for tests of ±1:
Momentum traders ride the breakout with a target at the next band.
Mean-reversion traders wait for the first stall candle and trade back to zero line or VWAP.
Bottom line: Multi-Timeframe Standard-Deviations turns raw volatility math into an intuitive “price terrain map,” helping you instantly judge whether a move is ordinary, stretched, or extreme—across the time-frames that matter to you.
Original code by fadizeidan and stats by NQStats's ProbableChris.
Swing High/Low by %REnglish Description
Swing High/Low by %R
This indicator identifies potential swing high and swing low points by combining William %R overbought/oversold turning points with classic swing price structures.
Swing High: Detected when William %R turns down from overbought territory and the price forms a local high (higher than both neighboring bars).
Swing Low: Detected when William %R turns up from oversold territory and the price forms a local low (lower than both neighboring bars).
This tool is designed to help traders spot possible market reversals and better time their entries and exits.
Customizable parameters:
Williams %R period
Overbought & Oversold thresholds
The indicator plots clear signals above/below price bars for easy visualization.
For educational purposes. Please use with proper risk management!
คำอธิบายภาษาไทย
Swing High/Low by %R
อินดิเคเตอร์นี้ใช้ระบุจุด Swing High และ Swing Low ที่มีโอกาสเป็นจุดกลับตัวของตลาด โดยอาศัยสัญญาณจาก William %R ที่พลิกกลับตัวบริเวณ overbought/oversold ร่วมกับโครงสร้างราคาแบบ swing
Swing High: เกิดเมื่อ William %R พลิกกลับลงจากเขต Overbought และราคาแท่งกลางสูงกว่าทั้งสองแท่งข้างเคียง
Swing Low: เกิดเมื่อ William %R พลิกกลับขึ้นจากเขต Oversold และราคาแท่งกลางต่ำกว่าทั้งสองแท่งข้างเคียง
ช่วยให้เทรดเดอร์สามารถมองเห็นโอกาสในการกลับตัวของราคา และใช้ประกอบการวางแผนจังหวะเข้าหรือออกจากตลาดได้อย่างแม่นยำมากขึ้น
ตั้งค่าได้:
ระยะเวลา Williams %R
ค่าขอบเขต Overbought & Oversold
อินดิเคเตอร์จะแสดงสัญลักษณ์อย่างชัดเจนบนกราฟเพื่อความสะดวกในการใช้งาน
ควรใช้ร่วมกับการบริหารความเสี่ยง
5:30 AM IST Close + Offset Lines + TablesDescription:
This script captures the 5:30 AM IST close price and plots it on the chart along with dynamic offset levels above and below (±5, ±20, ±40, ±60, ±80 points). It also displays these levels in neatly organized tables at the top-right and bottom-right corners for quick reference.
🔹 Timezone: Asia/Kolkata (IST)
🔹 Useful for: Intraday traders who reference early morning levels
🔹 Visual aids:
Orange line for 5:30 AM close
Green lines for points above
Red lines for points below
Tables summarizing all levels
This tool helps identify key early-morning reference zones that can act as support/resistance or breakout targets.
Multi-Timeframe Session HighlighterWhat is the Multi-Timeframe Session Highlighter?
It’s a simple Pine Script indicator that paints two special candles on your chart, no matter what timeframe you’re looking at. Think of it as a highlighter pen for session starts and ends—can be used for session-based strategies or just keeping an eye on key turning points.
How it works:
Green Bar (Session Open): Marks the exact bar when your chosen higher-timeframe session kicks off. If you select “4H,” on the indicator, you’ll see green on every 4-hour open, even if you’re staring at a 15-minute chart.
Red Bar (Session Close): Highlights the very last lower-timeframe candle immediately before that session wraps up. So on a 1H chart with “Daily” selected, you’ll get a red band on the 23:00 hour before the new daily bar at midnight.
Customizable: Pick your own colors and transparency level to match your chart theme.
Getting started:
Add the indicator to your chart.
In the inputs, select the session timeframe (for example, “240” for 4H or “D” for daily).
Choose your favorite green and red shades.
That’s it.
Realtime ATR-Based Stop Loss Numerical OverlayRealtime ATR-Based Stop Loss Numerical Overlay
A simple, effective tool for dynamic risk management based on ATR (Average True Range) without adding cluttered and distracting lines all over your chart.
📌 Description
This script plots a real-time stop loss level using the Average True Range (ATR) on your chart, helping you set consistent, volatility-based stops. It supports both:
✅ Current chart timeframe
✅ Custom fixed timeframe inputs (1m, 5m, 15m, 1h, etc.)
The stop level is calculated as:
Stop = ATR × Multiplier
and updates in real-time. An overlay table displays on the bottom-right of your chart with the calculated stop value in a clean, simple way.
⚙️ Settings
ATR Timeframe Source:
Choose between using the current chart's timeframe or a fixed one (e.g. 5, 15, 60, D, etc).
ATR Length:
Period used to calculate the ATR (default is 14).
Stop Loss Multiplier:
Multiplies the ATR value to define your stop (e.g., 1.5 × ATR).
Wait for Timeframe Closes:
If enabled, the ATR value waits for the selected timeframe’s candle to close before updating. If unselected, it will update in real time.
🛠️ How to Use
Add this script to your chart from your indicators list.
Configure your desired timeframe, ATR length, and multiplier in the settings panel.
Use the value shown in the table overlay as your suggested stop loss distance from entry.
Adjust your position sizing accordingly to fit your risk tolerance.
This tool is especially useful for traders looking for adaptive risk management that evolves with market volatility — whether scalping intraday or swing trading.
💡 Pro Tip
The ATR stop can also be used to dynamically trail your stop behind price movement.
Adaptive Momentum Flow (AMF)Overview
The Adaptive Momentum Flow (AMF) indicator is a powerful, multi-faceted tool designed to provide a comprehensive and adaptive view of market momentum and trend strength. Unlike traditional oscillators with fixed settings, AMF dynamically adjusts its calculations based on market volatility , ensuring its signals remain relevant across varying market conditions. By combining advanced Double Exponential Moving Averages (DEMA) with a powerful volume analysis component and a customizable scoring system, AMF offers a unique perspective on price action and underlying buying/selling pressure.
Key Features & How It Works
1. Adaptive DEMA Trend Strength:
At its core, AMF utilizes three DEMA lines (Fast, Medium, Slow) to assess the current trend's alignment and strength.
The indicator dynamically adjusts the lengths of these DEMA lines based on real-time market volatility, measured by Average True Range (ATR). This means AMF becomes more responsive in volatile markets and smoother in calmer periods.
A "Volatility Sensitivity" input allows you to fine-tune how aggressively the indicator adapts to these changes.
2. Volume Analysis (Buying/Selling Pressure):
AMF incorporates a dedicated volume analysis module to gauge whether volume is predominantly supporting upward or downward price movements. This helps identify periods of significant buying or selling pressure.
This volume analysis component is smoothed with an adjustable Moving Average (SMA, EMA, WMA, or DEMA) and contributes to the overall momentum score, adding a crucial layer of volume-driven confirmation to the analysis.
3. Comprehensive Scoring System:
The indicator generates a normalized "Oscillator Score" that ranges from -100 to 100. This score is a weighted sum of:
Price's relationship to the Fast DEMA.
The Fast DEMA's relationship to the Medium DEMA.
The Medium DEMA's relationship to the Slow DEMA.
The smoothed value from the volume analysis.
Each component's influence on the final score can be individually adjusted via input weights, allowing for deep customization.
Signal Line & Crossovers:
A smoothed "Signal Line" provides additional confirmation for momentum shifts. Crossovers between the main AMF line and its Signal Line can indicate potential changes in market direction.
Overbought/Oversold Levels:
Adjustable Overbought (default 70) and Oversold (default -70) levels visually highlight extreme momentum conditions.
These zones are enhanced with a color fill effect (bright red for overbought, bright cyan for oversold), making it easy to spot when the market is entering potentially exhausted states.
Crucially, these extreme zones can often be further validated by combining them with volatility bands (like Bollinger Bands or Keltner Channels as shown in the chart above) or other confluence indicators, offering stronger signals for potential reversals or exhaustion.
Benefits for Traders
Reduced Lag: DEMA's inherent design helps minimize lag compared to traditional moving averages, providing more timely signals.
Adaptive Intelligence: Automatically adjusts to market volatility, ensuring the indicator's sensitivity is appropriate for current conditions.
Holistic Momentum View: Combines price-based trend alignment with volume-based pressure for a more robust assessment of market flow.
Clear Visual Cues: Intuitive plots, signal line, and vibrant overbought/oversold zone fills make interpretation straightforward.
Customizable: Extensive input options allow traders to tailor the indicator to their specific trading style, asset, and timeframe.
How to Use
Trend Confirmation: Look for the AMF line and its Signal Line to align with the price trend.
Momentum Shifts: Crossovers between the AMF line and its Signal Line can indicate shifts in momentum.
Extreme Conditions: Pay attention when the AMF line enters the neon-highlighted overbought or oversold zones, signaling potential reversals or pauses in the current momentum. Always consider confirming these signals with other analysis tools, such as price action, chart patterns, support/resistance levels, or volatility indicators.
Customization: Experiment with the "Volatility Sensitivity," DEMA multipliers, and scoring weights to find the optimal settings for your trading strategy.
Median True Range {Darkoexe}Simple and sweet, this is the median true range. It reviews the size of the previous period amount of candles, and displays the candle size value that is the median of those previous values.
//Darkoexe
CME Futures RTH net change % levelsRTH Session time calculated for AMERICAN FUTURES ONLY.
Plots the net change % from the last session's RTH close, a.k.a daily % change for that specific instrument. Best used as support and resistance zones in confluence with other analysis, and also serve as a gauge for how volatile the session is.
Beta Tracker [theUltimator5]This script calculates the Pearson correlation coefficient between the charted symbol and a dynamic composite of up to four other user-defined tickers. The goal is to track how closely the current asset’s normalized price behavior aligns with, or diverges from, the selected group (or basket)
How can this indicator be valuable?
You can compare the correlation of your current symbol against a basket of other tickers to see if it is moving independently, or being pulled with the basket.... or is it moving against the basket.
It can be used to help identify 'swap' baskets of stocks or other tickers that tend to generally move together and visually show when your current ticker diverges from the basket.
It can be used to track beta (or negative beta) with the market or with a specific ticker.
This is best used as a supplement to other trading signals to give a more complete picture of the external forces potentially pulling or pushing the price action of the ticker.
🛠️ How It Works
The current symbol and each selected comparison ticker are normalized over a custom lookback window, allowing fair pattern-based comparison regardless of price scale.
The normalized values from 1 to 4 selected tickers are averaged into a composite, which represents the group’s collective movement.
A Pearson correlation coefficient is computed over a separate correlation lookback period, measuring the relationship between the current asset and the composite.
The result is plotted as a dynamic line, with color gradients:
Blue = strongly correlated (near +1)
Orange = strongly inverse correlation (near –1)
Intermediate values fade proportionally
A highlighted background appears when the correlation drops below a user-defined threshold (e.g. –0.7), helping identify strong negative beta periods visually.
A toggleable info table displays which tickers are currently being compared, along with customizable screen positioning.
⚙️ User Inputs
Ticker 1–4: Symbols to compare the current asset against (blank = ignored)
Normalization Lookback: Period to normalize each series
Correlation Lookback: Period over which correlation is calculated
Negative Correlation Highlight: Toggle for background alert and threshold level
Comparison Table: Toggle and position controls for an on-screen summary of selected tickers
imgur.com
⚠️ Notes
The script uses request.security() to pull data from external symbols; these must be available for the selected chart timeframe.
A minimum of one valid ticker must be provided for the script to calculate a composite and render correlation.