Bookmap Style Aggressor Bubbles
This indicator is designed to emulate the visual aesthetic of professional Order Flow software (such as Bookmap) directly within TradingView. It replaces the traditional candlestick view with a clean "Microstructure" Step Line and highlights significant volume events using dynamic "Aggressor Bubbles."
This tool is perfect for traders who practice Order Flow analysis, Scalping, or VSA (Volume Spread Analysis) and want to visualize the relative intensity of buyers and sellers without the noise of traditional wicks and bodies.
1. How it Works
Since TradingView Pine Script operates on OHLCV (Level 1) data, this indicator uses a heuristic model to approximate Order Flow dynamics:
Aggressor Bubbles (Volume Spikes):
The script calculates a Relative Volume (RVOL) metric by comparing the current bar's volume against a 50-period Simple Moving Average (SMA).
If the current volume exceeds a user-defined threshold (e.g., 2.0x the average), a bubble is plotted.
Size: The bubble size scales dynamically based on how massive the volume spike is (Small, Normal, Large, Huge).
Direction (Color): The aggressor side is approximated using the price action of the bar. If Close >= Open, it is treated as Buy Aggression (Green). If Close < Open, it is treated as Sell Aggression (Red).
Microstructure Price Line:
Standard candles can obscure the immediate path of price. This indicator includes a Step Line option that plots the closing price. This mimics the "Last Price" feed seen in DOM-based software, allowing you to see exactly where price held or broke.
2. Features
Smart Filtering: Filters out low-volume noise. You only see bubbles when "Whales" or significant liquidity changes occur.
Visual Customization: Fully adjustable colors for Buy/Sell bubbles and the price line.
Alert System: Includes a built-in alert that triggers whenever a significant Aggressor Bubble appears, allowing you to be notified of high-activity moments instantly.
Clean Aesthetic: Optimized for Dark Mode/Black backgrounds.
3. How to Use
Chart Setup (Important): For the best experience, hide your standard candles. Go to Chart Settings > Symbol and uncheck Body, Borders, and Wick.
Settings: Set your background to Black.
Interpretation:
Breakouts: Look for large bubbles pushing price through a key level. This indicates strong momentum.
Absorptions: Look for large bubbles appearing at the top/bottom of a range without price follow-through. This often suggests a reversal (Passive limit orders absorbing the aggressive market orders).
4. Technical Disclosure & Limitations
Please note that TradingView Pine Script provides access to OHLCV (History) data, not historical Tick-by-Tick or Level 2 (Depth of Market) data. Therefore, this indicator is a simulation. The "Aggressor" side is derived from bar direction, and the bubbles represent executed volume per bar, not individual tick clusters. It is intended for visual analysis and identifying high-volume nodes relative to recent history.
Phân tích Xu hướng
Renko ScalperWhat it is-
A lightweight Renko Scalper that combines Renko brick direction with an internal EMA trend filter and MACD confirmation to signal high-probability short-term entries. EMAs are used internally (hidden from the chart) so the visual remains uncluttered.
Signals-
Buy arrow: Renko direction turns bullish AND EMA trend up AND MACD histogram positive.
Sell arrow: Renko direction turns bearish AND EMA trend down AND MACD histogram negative.
Consecutive same-direction signals are suppressed (only one arrow per direction until opposite signal).
Visuals-
Buy / Sell arrows (large) above/below bars.
Chart background tints green/red after the respective signal for easy glance recognition.
Inputs:-
Renko Box Size (points)
EMA Fast / EMA Slow
MACD fast/slow/signal lengths
How to use-
Add to chart
Use smaller Renko box sizes for scalping, larger for swing-like entries.
Confirm signal with price action and volume—this indicator is a signal generator, not a full automated system.
Use alerts (built in) to receive Buy / Sell arrow notifications.
Alerts-
Buy Arrow — buySignal
Sell Arrow — sellSignal
Buy Background / Sell Background — background-color state alerts
Recommended settings-
Timeframes: 1m–15m for scalping, 5m for balanced intraday.
Symbols: liquid futures/currency pairs/major crypto.
Disclaimer
This script is educational and not financial advice. Backtest and forward test on a demo account before live use. Past performance is not indicative of future results. Use proper risk management.
Grok/Claude Turtle Soup Strategy # 🥣 Turtle Soup Strategy (Enhanced)
## A Mean-Reversion Strategy Based on Failed Breakouts
---
## Historical Origins
### The Original Turtle Traders (1983-1988)
The Turtle Trading system is one of the most famous experiments in trading history. In 1983, legendary commodities trader **Richard Dennis** made a bet with his partner **William Eckhardt** about whether great traders were born or made. Dennis believed trading could be taught; Eckhardt believed it was innate.
To settle the debate, Dennis recruited 23 ordinary people through newspaper ads—including a professional blackjack player, a fantasy game designer, and an accountant—and taught them his trading system in just two weeks. He called them "Turtles" after turtle farms he had visited in Singapore, saying *"We are going to grow traders just like they grow turtles in Singapore."*
The results were extraordinary. Over the next five years, the Turtles reportedly earned over **$175 million in profits**. The experiment proved Dennis right: trading could indeed be taught.
#### The Original Turtle Rules:
- **Entry:** Buy when price breaks above the 20-day high (System 1) or 55-day high (System 2)
- **Exit:** Sell when price breaks below the 10-day low (System 1) or 20-day low (System 2)
- **Stop Loss:** 2x ATR (Average True Range) from entry
- **Position Sizing:** Based on volatility (ATR)
- **Philosophy:** Pure trend-following—catch big moves by riding breakouts
The Turtle system was a **trend-following** strategy that assumed breakouts would lead to sustained trends. It worked brilliantly in trending markets but suffered during choppy, range-bound conditions.
---
### The Turtle Soup Strategy (1990s)
In the 1990s, renowned trader **Linda Bradford Raschke** (along with Larry Connors) observed something interesting: many of the breakouts that the Turtle system traded actually *failed*. Price would spike above the 20-day high, trigger Turtle buy orders, then immediately reverse—trapping the breakout traders.
Raschke realized these failed breakouts were predictable and tradeable. She developed the **Turtle Soup** strategy, which does the *exact opposite* of the original Turtle system:
> *"Instead of buying the breakout, we wait for it to fail—then fade it."*
The name "Turtle Soup" is a clever play on words: the strategy essentially "eats" the Turtles by trading against them when their breakouts fail.
#### Original Turtle Soup Rules:
- **Setup:** Price makes a new 20-day high (or low)
- **Qualifier:** The previous 20-day high must be at least 3-4 days old (not a fresh breakout)
- **Entry Trigger:** Price reverses back inside the channel (failed breakout)
- **Entry:** Go SHORT (against the failed breakout above), or LONG (against the failed breakdown below)
- **Philosophy:** Mean-reversion—fade false breakouts and profit from trapped traders
#### Turtle Soup Plus One Variant:
Raschke also developed a more conservative variant called "Turtle Soup Plus One" which waits for the *next bar* after the breakout to confirm the failure before entering. This reduces false signals but may miss some opportunities.
---
## Our Enhanced Turtle Soup Strategy
We have taken the classic Turtle Soup concept and enhanced it with modern technical indicators and filters to improve signal quality and adapt to today's markets.
### Core Logic Preserved
The fundamental strategy remains true to Raschke's original concept:
| Turtle (Original) | Turtle Soup (Our Strategy) |
|-------------------|---------------------------|
| BUY breakout above 20-day high | SHORT when that breakout FAILS |
| SELL breakout below 20-day low | LONG when that breakdown FAILS |
| Trend-following | Mean-reversion |
| "The trend is your friend" | "Failed breakouts trap traders" |
---
### Enhancements & Improvements
#### 1. RSI Exhaustion Filter
**Addition:** RSI must confirm exhaustion before entry
- **For SHORT entries:** RSI > 60 (buyers exhausted)
- **For LONG entries:** RSI < 40 (sellers exhausted)
**Why:** The original Turtle Soup had no momentum filter. Adding RSI ensures we only fade breakouts when the market is showing signs of exhaustion, significantly reducing false signals. This enhancement was inspired by later traders who found RSI extremes (originally 90/10, softened to 60/40) dramatically improved win rates.
#### 2. ADX Trending Filter
**Addition:** ADX must be > 20 for trades to execute
**Why:** While the original Turtle Soup was designed for ranging markets, we found that requiring *some* trend strength (ADX > 20) actually improves results. This ensures we're trading in markets with enough directional movement to create meaningful failed breakouts, rather than random noise in dead markets.
#### 3. Heikin Ashi Smoothing
**Addition:** Optional Heikin Ashi calculations for breakout detection
**Why:** Heikin Ashi candles smooth out price noise and make trend reversals more visible. When enabled, the strategy uses HA values to detect breakouts and failures, reducing whipsaws from erratic price spikes.
#### 4. Dynamic Donchian Channels with Regime Detection
**Addition:** Color-coded channels based on market regime
- 🟢 **Green:** Bullish regime (uptrend + DI+ > DI- + OBV bullish)
- 🔴 **Red:** Bearish regime (downtrend + DI- > DI+ + OBV bearish)
- 🟡 **Yellow:** Neutral regime
**Why:** Visual regime detection helps traders understand the broader market context. The original Turtle Soup had no regime awareness—our enhancement lets traders see at a glance whether conditions favor the strategy.
#### 5. Volume Spike Detection (Optional)
**Addition:** Optional filter requiring volume surge on the breakout bar
**Why:** Failed breakouts are more significant when they occur on high volume. A volume spike on the breakout bar (default 1.2x average) indicates more traders got trapped, creating stronger reversal potential.
#### 6. ATR-Based Stops and Targets
**Addition:** Configurable ATR-based stop losses and profit targets
- **Stop Loss:** 1.5x ATR (default)
- **Profit Target:** 2.0x ATR (default)
**Why:** The original Turtle Soup used fixed stop placement. ATR-based stops adapt to current volatility, providing tighter stops in calm markets and wider stops in volatile conditions.
#### 7. Signal Cooldown
**Addition:** Minimum bars between trades (default 5)
**Why:** Prevents overtrading during choppy conditions where multiple failed breakouts might occur in quick succession.
#### 8. Real-Time Info Panel
**Addition:** Comprehensive dashboard showing:
- Current regime (Bullish/Bearish/Neutral)
- RSI value and zone
- ADX value and trending status
- Breakout status
- Bars since last high/low
- Current setup status
- Position status
**Why:** Gives traders instant visibility into all strategy conditions without needing to check multiple indicators.
---
## Entry Rules Summary
### SHORT Entry (Fading Failed Breakout Above)
1. ✅ Price breaks ABOVE the 20-period Donchian high
2. ✅ Previous 20-period high was at least 1 bar ago
3. ✅ Price closes back BELOW the Donchian high (failed breakout)
4. ✅ RSI > 60 (exhausted buyers)
5. ✅ ADX > 20 (trending market)
6. ✅ Cooldown period met
→ **Enter SHORT**, betting the breakout will fail
### LONG Entry (Fading Failed Breakdown Below)
1. ✅ Price breaks BELOW the 20-period Donchian low
2. ✅ Previous 20-period low was at least 1 bar ago
3. ✅ Price closes back ABOVE the Donchian low (failed breakdown)
4. ✅ RSI < 40 (exhausted sellers)
5. ✅ ADX > 20 (trending market)
6. ✅ Cooldown period met
→ **Enter LONG**, betting the breakdown will fail
---
## Exit Rules
1. **ATR Stop Loss:** Position closed if price moves 1.5x ATR against entry
2. **ATR Profit Target:** Position closed if price moves 2.0x ATR in favor
3. **Channel Exit:** Position closed if price breaks the exit channel in the opposite direction
4. **Mid-Channel Exit:** Position closed if price returns to channel midpoint
---
## Best Market Conditions
The Turtle Soup strategy performs best when:
- ✅ Markets are prone to false breakouts
- ✅ Volatility is moderate (not too low, not extreme)
- ✅ Price is oscillating within a broader range
- ✅ There are clear support/resistance levels
The strategy may struggle when:
- ❌ Strong trends persist (breakouts follow through)
- ❌ Volatility is extremely low (no meaningful breakouts)
- ❌ Markets are in news-driven directional moves
---
## Default Settings
| Parameter | Default | Description |
|-----------|---------|-------------|
| Lookback Period | 20 | Donchian channel period |
| Min Bars Since Extreme | 1 | Bars since last high/low |
| RSI Length | 14 | RSI calculation period |
| RSI Short Level | 60 | RSI must be above this for shorts |
| RSI Long Level | 40 | RSI must be below this for longs |
| ADX Length | 14 | ADX calculation period |
| ADX Threshold | 20 | Minimum ADX for trades |
| ATR Period | 20 | ATR calculation period |
| ATR Stop Multiplier | 1.5 | Stop loss distance in ATR |
| ATR Target Multiplier | 2.0 | Profit target distance in ATR |
| Cooldown Period | 5 | Minimum bars between trades |
| Volume Multiplier | 1.2 | Volume spike threshold |
---
## Philosophy
> *"The Turtle system made millions by following breakouts. The Turtle Soup strategy makes money when those breakouts fail. In trading, there's always someone on the other side of the trade—this strategy profits by being the smart money that fades the trapped breakout traders."*
The beauty of the Turtle Soup strategy is its elegant simplicity: it exploits a known, repeatable pattern (failed breakouts) while using modern filters (RSI, ADX) to improve timing and reduce false signals.
---
## Credits
- **Original Turtle System:** Richard Dennis & William Eckhardt (1983)
- **Turtle Soup Strategy:** Linda Bradford Raschke & Larry Connors (1990s)
- **RSI Enhancement:** Various traders who discovered RSI extremes improve reversal detection
- **This Implementation:** Enhanced with Heikin Ashi smoothing, regime detection, ADX filtering, and comprehensive visualization
---
*"We're not following the turtles—we're making soup out of them."* 🥣
Traffic Lights - BETA ZONESTraffic Lights - BETA ZONES
Overview
The Traffic Light indicator is a simple, visual tool designed to help traders gauge market bias, trend strength, and momentum at a glance. It displays three rows of colored dots (like a traffic light) in a separate pane below your chart:
• Green: Bullish signal (go/buy bias).
• Red: Bearish signal (stop/sell bias).
• Orange: Neutral or caution (mixed/uncertain conditions).
This indicator combines price action (via EMA positioning), trend direction (via RSI), and momentum expansion (via RSI + MACD histogram) to provide a layered view of the market. When all three rows align as green or red, it generates Buy or Sell labels on the main chart for potential entry signals.
It's non-repainting in its core logic (Row 2 uses delayed RSI comparison to avoid noise), making it reliable for live trading. Best used on trending markets like forex, stocks, or crypto on timeframes from 15M to Daily.
How It Works
The indicator evaluates three independent "rows" of conditions, each represented by a colored dot:
1. Row 1: Price Action Signal (EMA Touch) This row assesses the overall trend bias based on price's position relative to a slow EMA (default: 50-period).
o Green: Price is cleanly above the EMA (bullish bias).
o Red: Price is cleanly below the EMA (bearish bias).
o Orange: Price is "touching" or within a volatility buffer around the EMA (neutral/caution). The "touch zone" is defined by ATR padding, which can be toggled off for a stricter (green/red only) mode.
2. Row 2: Buyers/Sellers Trend (RSI) This row tracks the underlying trend of buyer/seller strength using RSI (default: 14-period on close). To reduce noise and repainting, it uses a delayed comparison (RSI vs. RSI ):
o Green: RSI is rising (buyers gaining strength).
o Red: RSI is falling (sellers gaining strength). No orange here—it's purely directional.
3. Row 3: Buyers/Sellers Signal (RSI + MACD Histogram) This row focuses on momentum expansion, requiring alignment across RSI zones and MACD histogram:
o Green: RSI > 50 (bull zone), MACD hist > 0 (positive), and histogram is expanding upward.
o Red: RSI < 50 (bear zone), MACD hist < 0 (negative), and histogram is expanding downward.
o Orange: Any mismatch (e.g., pullbacks, consolidations, or weak momentum). MACD defaults: Fast=12, Slow=26, Signal=9.
Signals
• Buy Signal: Triggers a "Buy" label below the bar when all three rows turn green for the first time (crossover from non-aligned).
• Sell Signal: Triggers a "Sell" label above the bar when all three rows turn red for the first time. These are conservative signals—use them for trend confirmation or entries in alignment with your strategy. They don't repaint once fired.
Inputs & Customization
All inputs are grouped for easy tweaking:
• Row 1: Price Action Signal
o Slow EMA Length (default: 50): Adjusts the trend baseline.
o EMA Timeframe (default: empty/current): Use a higher timeframe (e.g., "240" for 4H) for multi-timeframe analysis.
o Enable Orange 'Touch' Zone (default: true): Toggle for strict (green/red only) vs. touch mode.
o ATR Length (default: 3): Volatility period for touch padding.
o Touch Padding (ATR mult, default: 0.15): Widens the orange buffer; set to 0 for wick-touch only.
• Row 2: Buyers/Sellers Trend (RSI)
o RSI Length (default: 14): Period for RSI calculation.
o RSI Source (default: close): Change to high/low/open for different sensitivities.
• Row 3: Buyers/Sellers Signal (RSI + MACD hist)
o MACD Fast/Slow/Signal Lengths (defaults: 12/26/9): Standard MACD settings.
Usage Tips
• Trend Trading: Wait for all-green for long entries or all-red for shorts. Use in conjunction with support/resistance.
• Scalping/Intraday: Enable orange touch zone for more nuance in choppy markets; disable for cleaner signals in trends.
• Multi-Timeframe: Set Row 1 EMA to a higher TF for "big picture" bias while keeping others on current.
• Risk Management: Always combine with stop-losses (e.g., below recent lows for buys). Backtest on your asset/timeframe.
• Limitations: In ranging markets, orange dots may dominate—pair with volatility filters like ADX. Not a standalone system; use as a confirmation tool.
If you have feedback or suggestions, drop a comment below! Happy trading 🚦
Gaussian Hidden Markov ModelA Hidden Markov Model (HMM) is a statistical model that assumes an underlying process is a Markov process with unobservable (hidden) states. In the context of financial data analysis, a HMM can be particularly useful because it allows for the modeling of time series data where the state of the market at a given time depends on its state in the previous time period, but these states are not directly observable from the market data. When we say that a state is "unobservable" or "hidden," we mean that the true state of the process generating the observations at any time is not directly visible or measurable. Instead, what is observed is a set of data points that are influenced by these hidden states.
The HMM uses a set of observed data to infer the sequence of hidden states of the model (in our case a model with 3 states and Gaussian emissions). It comprises three main components: the initial probabilities, the state transition probabilities, and the emission probabilities. The initial probabilities describe the likelihood of starting in a particular state. The state transition probabilities describe the likelihood of moving from one state to another, while the emission probabilities (in our case emitted from Gaussian probability density functions, in the image red yellow and green Laplace probability densitty functions) describe the likelihood of the observed data given a particular state.
MODEL FIT
Posterior
By default, the indicator displays the posterior distribution as fitted by training a 3-state Gaussian HMM. The posterior refers to the probability distribution of the hidden states given the observed data. In the case of your Gaussian HMM with three states, the posterior represents the probabilities that the model assigns to each of these three states at each time point, after observing the data. The term "posterior" comes from Bayes' theorem, where it represents the updated belief about the model's states after considering the evidence (the observed data).
In the indicator, the posterior is visualized as the probability of the stock market being in a particular volatility state (high vol, medium vol, low vol) at any given time in the time series. Each day, the probabilities of the three states sum to 1, with the plot showing color-coded bands to reflect these state probabilities over time. It is important to note that the posterior distribution of the model fit tells you about the performance of the model on past data. The model calculates the probabilities of observations for all states by taking into account the relationship between observations and their past and future counterparts in the dataset. This is achieved using the forward-backward algorithm, which enables us to train the HMM.
Conditional Mean
The conditional mean is the expected value of the observed data given the current state of the model. For a Gaussian HMM, this would be the mean of the Gaussian distribution associated with the current state. It’s "conditional" because it depends on the probabilities of the different states the model is in at a given time. This connects back to the posterior probability, which assigns a probability to the model being in a particular state at a given time.
Conditional Standard Deviation Bands
The conditional standard deviation is a measure of the variability of the observed data given the current state of the model. In a Gaussian HMM, each state has its own emission probability, defined by a Gaussian distribution with a specific mean and standard deviation. The standard deviation represents how spread out the data is around the mean for each state. These bands directly relate to the emission probabilities of the HMM, as they describe the likelihood of the observed values given the current state. Narrow bands suggest a lower standard deviation, indicating the model is more confident about the data's expected range when in that state, while wider bands indicate higher uncertainty and variability.
Transition Matrix
The transition matrix in a HMM is a key component that characterizes the model. It's a square matrix representing the probabilities of transitioning from one hidden state to another. Each row of the transition matrix must sum up to 1 since the probabilities of moving from a given state to all possible subsequent states (including staying in the same state) must encompass all possible outcomes.
For example, we can see the following transition probabilities in our model:
Going from state X: to X (0.98), to Y (0.02), to Z (0)
Going from state Y: to X (0.03), to Y (0.96), to Z (0.01)
Going from state Z: to X (0), to Y (0.11), to Z (0.89)
MODEL TEST
When the "Test Out of Sample” option is enabled, the indicator plots models out-of-sample predictions. This is particularly useful for real-time identification of market regimes, ensuring that the model's predictive capability is rigorously tested on unseen data. The indicator displays the out of sample posterior probabilities which are calculated using the forward algorithm. Higher probability for a particular state indicate that the model is predicted a higher likelihood that the market is currently in that state. Evaluating the models performance on unseen data is crucial in understanding how well the model explains data that are not included in its training process.
THF Ultimate AIO Scalper & Trend PRO This is a comprehensive "All-In-One" trading suite designed to identify high-probability setups by combining **Trend Following**, **Price Action (FVG)**, and **Ichimoku Cloud** systems.
The indicator is designed to be "Ready-to-Trade" out of the box, with all major confluence filters active by default. It helps traders avoid false signals by ensuring that momentum, trend, and support/resistance levels are in alignment.
### 🛠️ Key Features & Components:
**1. Trend & Scalp Engine:**
* **Scalp Signals:** Fast EMA crossovers (7/21) for quick entries.
* **Trend Filter:** Signals are filtered by a long-term SMA (200) to ensure you are trading with the dominant trend.
* **Golden/Death Cross:** Automatically highlights major trend shifts (SMA 50 crossing SMA 200).
**2. Price Action (Fair Value Gaps):**
* **FVG Detection:** Highlights unmitigated Bullish and Bearish imbalance zones. These act as high-probability targets or re-entry zones.
* **Dashboard:** A built-in panel tracks the number of active vs. mitigated gaps.
* **Mitigation Lines:** Automatically draws lines when price tests an FVG level.
**3. Ichimoku Cloud Overlay:**
* Displays the full Ichimoku system (Tenkan, Kijun, and Kumo Cloud) to identify dynamic support/resistance and trend strength.
* **Usage:** Perfect for confirming breakout signals when price is above/below the Cloud.
**4. Momentum & Volume:**
* **Volume Coloring:** Bars are colored based on relative volume strength.
* **RSI & MACD:** Integrated buy/sell signals to spot overbought/oversold conditions instantly.
### 🎯 How to Trade (Confluence Strategy):
The power of this script lies in **Confluence** (multiple indicators agreeing):
* **Buy Setup:**
1. Price is above the **Ichimoku Cloud** and **SMA 200**.
2. Wait for a **"SCALP BUY"** signal or **"Trend BUY"** label.
3. Confirm that price is reacting to a **Bullish FVG** (Green Box).
4. **RSI/MACD** should show bullish momentum.
* **Sell Setup:**
1. Price is below the **Ichimoku Cloud** and **SMA 200**.
2. Wait for a **"SCALP SELL"** signal.
3. Confirm rejection from a **Bearish FVG** (Red Box).
---
**CREDITS & ATTRIBUTION:**
* **Fair Value Gap Logic:** This script utilizes the open-source FVG calculation method originally developed by **LuxAlgo**. We have integrated this logic with our custom trend system to provide a complete trading view.
* **Trend Logic:** Custom compilation of Moving Average crossovers and Ichimoku standard calculations.
*Disclaimer: This tool is for educational purposes only. Always manage your risk.*
Hurst Exponent - Detrended Fluctuation AnalysisIn stochastic processes, chaos theory and time series analysis, detrended fluctuation analysis (DFA) is a method for determining the statistical self-affinity of a signal. It is useful for analyzing time series that appear to be long-memory processes and noise.
█ OVERVIEW
We have introduced the concept of Hurst Exponent in our previous open indicator Hurst Exponent (Simple). It is an indicator that measures market state from autocorrelation. However, we apply a more advanced and accurate way to calculate Hurst Exponent rather than simple approximation. Therefore, we recommend using this version of Hurst Exponent over our previous publication going forward. The method we used here is called detrended fluctuation analysis. (For folks that are not interested in the math behind the calculation, feel free to skip to "features" and "how to use" section. However, it is recommended that you read it all to gain a better understanding of the mathematical reasoning).
█ Detrend Fluctuation Analysis
Detrended Fluctuation Analysis was first introduced by by Peng, C.K. (Original Paper) in order to measure the long-range power-law correlations in DNA sequences . DFA measures the scaling-behavior of the second moment-fluctuations, the scaling exponent is a generalization of Hurst exponent.
The traditional way of measuring Hurst exponent is the rescaled range method. However DFA provides the following benefits over the traditional rescaled range method (RS) method:
• Can be applied to non-stationary time series. While asset returns are generally stationary, DFA can measure Hurst more accurately in the instances where they are non-stationary.
• According the the asymptotic distribution value of DFA and RS, the latter usually overestimates Hurst exponent (even after Anis- Llyod correction) resulting in the expected value of RS Hurst being close to 0.54, instead of the 0.5 that it should be. Therefore it's harder to determine the autocorrelation based on the expected value. The expected value is significantly closer to 0.5 making that threshold much more useful, using the DFA method on the Hurst Exponent (HE).
• Lastly, DFA requires lower sample size relative to the RS method. While the RS method generally requires thousands of observations to reduce the variance of HE, DFA only needs a sample size greater than a hundred to accomplish the above mentioned.
█ Calculation
DFA is a modified root-mean-squares (RMS) analysis of a random walk. In short, DFA computes the RMS error of linear fits over progressively larger bins (non-overlapped “boxes” of similar size) of an integrated time series.
Our signal time series is the log returns. First we subtract the mean from the log return to calculate the demeaned returns. Then, we calculate the cumulative sum of demeaned returns resulting in the cumulative sum being mean centered and we can use the DFA method on this. The subtraction of the mean eliminates the “global trend” of the signal. The advantage of applying scaling analysis to the signal profile instead of the signal, allows the original signal to be non-stationary when needed. (For example, this process converts an i.i.d. white noise process into a random walk.)
We slice the cumulative sum into windows of equal space and run linear regression on each window to measure the linear trend. After we conduct each linear regression. We detrend the series by deducting the linear regression line from the cumulative sum in each windows. The fluctuation is the difference between cumulative sum and regression.
We use different windows sizes on the same cumulative sum series. The window sizes scales are log spaced. Eg: powers of 2, 2,4,8,16... This is where the scale free measurements come in, how we measure the fractal nature and self similarity of the time series, as well as how the well smaller scale represent the larger scale.
As the window size decreases, we uses more regression lines to measure the trend. Therefore, the fitness of regression should be better with smaller fluctuation. It allows one to zoom into the “picture” to see the details. The linear regression is like rulers. If you use more rulers to measure the smaller scale details you will get a more precise measurement.
The exponent we are measuring here is to determine the relationship between the window size and fitness of regression (the rate of change). The more complex the time series are the more it will depend on decreasing window sizes (using more linear regression lines to measure). The less complex or the more trend in the time series, it will depend less. The fitness is calculated by the average of root mean square errors (RMS) of regression from each window.
Root mean Square error is calculated by square root of the sum of the difference between cumulative sum and regression. The following chart displays average RMS of different window sizes. As the chart shows, values for smaller window sizes shows more details due to higher complexity of measurements.
The last step is to measure the exponent. In order to measure the power law exponent. We measure the slope on the log-log plot chart. The x axis is the log of the size of windows, the y axis is the log of the average RMS. We run a linear regression through the plotted points. The slope of regression is the exponent. It's easy to see the relationship between RMS and window size on the chart. Larger RMS equals less fitness of the regression. We know the RMS will increase (fitness will decrease) as we increases window size (use less regressions to measure), we focus on the rate of RMS increasing (how fast) as window size increases.
If the slope is < 0.5, It means the rate of of increase in RMS is small when window size increases. Therefore the fit is much better when it's measured by a large number of linear regression lines. So the series is more complex. (Mean reversion, negative autocorrelation).
If the slope is > 0.5, It means the rate of increase in RMS is larger when window sizes increases. Therefore even when window size is large, the larger trend can be measured well by a small number of regression lines. Therefore the series has a trend with positive autocorrelation.
If the slope = 0.5, It means the series follows a random walk.
█ FEATURES
• Sample Size is the lookback period for calculation. Even though DFA requires a lower sample size than RS, a sample size larger > 50 is recommended for accurate measurement.
• When a larger sample size is used (for example = 1000 lookback length), the loading speed may be slower due to a longer calculation. Date Range is used to limit numbers of historical calculation bars. When loading speed is too slow, change the data range "all" into numbers of weeks/days/hours to reduce loading time. (Credit to allanster)
• “show filter” option applies a smoothing moving average to smooth the exponent.
• Log scale is my work around for dynamic log space scaling. Traditionally the smallest log space for bars is power of 2. It requires at least 10 points for an accurate regression, resulting in the minimum lookback to be 1024. I made some changes to round the fractional log space into integer bars requiring the said log space to be less than 2.
• For a more accurate calculation a larger "Base Scale" and "Max Scale" should be selected. However, when the sample size is small, a larger value would cause issues. Therefore, a general rule to be followed is: A larger "Base Scale" and "Max Scale" should be selected for a larger the sample size. It is recommended for the user to try and choose a larger scale if increasing the value doesn't cause issues.
The following chart shows the change in value using various scales. As shown, sometimes increasing the value makes the value itself messy and overshoot.
When using the lowest scale (4,2), the value seems stable. When we increase the scale to (8,2), the value is still alright. However, when we increase it to (8,4), it begins to look messy. And when we increase it to (16,4), it starts overshooting. Therefore, (8,2) seems to be optimal for our use.
█ How to Use
Similar to Hurst Exponent (Simple). 0.5 is a level for determine long term memory.
• In the efficient market hypothesis, market follows a random walk and Hurst exponent should be 0.5. When Hurst Exponent is significantly different from 0.5, the market is inefficient.
• When Hurst Exponent is > 0.5. Positive Autocorrelation. Market is Trending. Positive returns tend to be followed by positive returns and vice versa.
• Hurst Exponent is < 0.5. Negative Autocorrelation. Market is Mean reverting. Positive returns trends to follow by negative return and vice versa.
However, we can't really tell if the Hurst exponent value is generated by random chance by only looking at the 0.5 level. Even if we measure a pure random walk, the Hurst Exponent will never be exactly 0.5, it will be close like 0.506 but not equal to 0.5. That's why we need a level to tell us if Hurst Exponent is significant.
So we also computed the 95% confidence interval according to Monte Carlo simulation. The confidence level adjusts itself by sample size. When Hurst Exponent is above the top or below the bottom confidence level, the value of Hurst exponent has statistical significance. The efficient market hypothesis is rejected and market has significant inefficiency.
The state of market is painted in different color as the following chart shows. The users can also tell the state from the table displayed on the right.
An important point is that Hurst Value only represents the market state according to the past value measurement. Which means it only tells you the market state now and in the past. If Hurst Exponent on sample size 100 shows significant trend, it means according to the past 100 bars, the market is trending significantly. It doesn't mean the market will continue to trend. It's not forecasting market state in the future.
However, this is also another way to use it. The market is not always random and it is not always inefficient, the state switches around from time to time. But there's one pattern, when the market stays inefficient for too long, the market participants see this and will try to take advantage of it. Therefore, the inefficiency will be traded away. That's why Hurst exponent won't stay in significant trend or mean reversion too long. When it's significant the market participants see that as well and the market adjusts itself back to normal.
The Hurst Exponent can be used as a mean reverting oscillator itself. In a liquid market, the value tends to return back inside the confidence interval after significant moves(In smaller markets, it could stay inefficient for a long time). So when Hurst Exponent shows significant values, the market has just entered significant trend or mean reversion state. However, when it stays outside of confidence interval for too long, it would suggest the market might be closer to the end of trend or mean reversion instead.
Larger sample size makes the Hurst Exponent Statistics more reliable. Therefore, if the user want to know if long term memory exist in general on the selected ticker, they can use a large sample size and maximize the log scale. Eg: 1024 sample size, scale (16,4).
Following Chart is Bitcoin on Daily timeframe with 1024 lookback. It suggests the market for bitcoin tends to have long term memory in general. It generally has significant trend and is more inefficient at it's early stage.
Chandelier Exit + Pivots + MA + Swing High/LowIt combines four indicators.
For use in the Hero course.
Support & Resistance + VolumeThis script is an advanced technical analysis tool designed to automatically identify institutional Support and Resistance zones, while analyzing the activity (Volume) within these zones. It automatically cleans up the chart to keep only relevant information.
Key Features:
Automatic Zone Detection:
Supports (Green): Identified based on major swing lows (Pivots).
Resistances (Red): Identified based on major swing highs (Pivots).
The width of the zones automatically adapts to market volatility (based on ATR) to remain relevant regardless of the timeframe.
Smart Merging:
To avoid cluttering the chart with overlapping lines, the script detects if a new support or resistance forms within an existing zone.
If so, it does not create a new box but expands the existing zone. This allows you to visualize consolidated "liquidity zones" rather than scattered lines.
Cumulative Volume Profile:
This is the core strength of this indicator. It calculates the total volume traded inside each zone since its creation.
Every time price revisits a zone, the candle's volume is added to the total.
Display: Volume is shown as whole numbers with a $ symbol (e.g., 300 500$) for precise reading.
Interpretation: A zone with very high volume indicates a strong battle between buyers and sellers, making the zone harder to break.
Historical Management (Broken Zones):
If the price crosses and closes beyond a zone (valid breakout), the zone changes appearance immediately.
It turns Gray, stops extending to the right, and the label displays the text "Cassé" (Broken). This allows you to keep a visual trace of past key levels without disturbing current analysis.
Advanced S&D Engine | ZikZak-Trader30About This Script
This is a fully custom-built Supply & Demand Zone detection engine for TradingView written by ZikZak-Trader30 (Kotdwar, UK). The script identifies potential key supply and demand zones based on market structure and pattern logic widely used by professional traders.
Detected Patterns:
RBR (Rally-Base-Rally, demand)
DBD (Drop-Base-Drop, supply)
RBD (Rally-Base-Drop, supply)
DBR (Drop-Base-Rally, demand)
Features Highlight
Detailed configurable zone filtering (freshness, gap detection, time spent, width, Fibonacci confluence, etc.)
Fair and adjustable scoring system for zone strength
Automatic management/removal of old or retested/violated zones
Optional Fibonacci level confluence and dynamic labeling
Transparency Statement
How It Works:
This script uses well-known price action concepts and compares candles’ movement, consolidation, and breakout patterns to mark S&D zones.
There are no repaints or future leaks: all logic is based entirely on historical and current bars.
Parameters and variables are fully described in the script inputs. The zone scoring and removal logic is also visible in the code for transparency.
IMPORTANT: Usage & Fair-Use Policy
This script is provided for educational and informational purposes only.
It should not be considered as financial advice or a trading signal.
Trading/investing involves risk—always do your own research or consult a financial advisor before making trading decisions.
Past performance or backtest results are not necessarily indicative of future results.
License & Fair Use
The code is original, written by ZikZak-Trader30.
All logic and comments are visible for users to study, adapt, or improve for personal, non-commercial use within TradingView.
You may NOT resell, repackage, or repost this script as your own.
If you fork or publicly remix/adapt the script, please credit "ZikZak-Trader30" and do not remove this disclosure section.
If you use ideas or snippets, kindly reference this script and author.
Absolutely NO plagiarized or resold code is permitted. This script is not for re-sale.
Acknowledgements
This indicator was inspired by years of price action study and usage of public S&D scripts. While the pattern logic is classic in nature, the version and scoring are original.
No proprietary datasets or paid logic from other sources are included.
Minor ideas on zone freshness and Fibonacci blending are common in the TradingView S&D community and have been custom-implemented here.
THF Scalp & Trend + FVG [English]This indicator is a comprehensive "All-In-One" trading suite designed for Scalpers and Day Traders who look for confluence between Trend Following indicators and Price Action (Fair Value Gaps).
It combines two powerful concepts into a single chart overlay:
1. Moving Average Crossovers & Trend Filtering (THF Logic).
2. Fair Value Gaps (FVG) detection for entry/exit targets.
### 🛠️ Key Features:
**1. Trend & Scalp Signals:**
- **Scalp Signals:** Based on fast EMA crossovers (default 7/21). These signals can be filtered by a long-term SMA (200) to ensure you are trading with the major trend.
- **Trend Signals:** Identifies stronger trend shifts using EMA 21 crossing SMA 50.
- **Major Crosses:** Automatically highlights Golden Cross (SMA 50 > 200) and Death Cross events.
**2. Price Action (FVG - Fair Value Gaps):**
- Integrated **LuxAlgo's Fair Value Gap** logic to identify imbalances in the market.
- Displays Bullish/Bearish zones which act as magnets for price or support/resistance levels.
- Includes a Dashboard to track mitigated vs. unmitigated zones.
**3. Momentum & Volume Confluence:**
- **Visual Volume:** Candles are colored based on volume relative to the average (Volume SMA).
- **RSI & MACD Signals:** Optional overlays to spot overbought/oversold conditions or momentum shifts directly on the chart.
### 🎯 How to Use:
- **For Scalping:** Wait for a "SCALP BUY" signal while the price is above the SMA 200 (Trend Filter). Use the FVG boxes as potential Take Profit targets.
- **For Trend Trading:** Look for the "Trend BUY" label and confirm with the Golden Cross.
- **Stop Loss:** Can be placed below the recent swing low or below the EMA 50.
----------------------------------------------------------------
**CREDITS & ATTRIBUTION:**
This script is a mashup of custom trend logic and open-source community codes.
- **Fair Value Gap:** Full credit goes to **LuxAlgo** for the FVG detection algorithm and dashboard logic. This script utilizes their open-source calculation methods to enhance the trend strategy.
- **Trend Logic:** Based on classic Moving Average crossover strategies tailored for scalping.
*Disclaimer: This tool is for educational purposes only. Always manage your risk.*
Swing v 3Swing v.3 Indicator Description
Swing v.3 is an advanced swing analysis indicator with deep liquidity and volume analysis, designed to identify institutional movements and high-probability reversal points:
Key Components:
🎯 Swing Points Detection:
Intelligent detection of swing highs and lows (SH/SL)
Proper sequencing of peaks and valleys (prevents duplicates)
Identifies strong swings (★) based on high volume
Automatic support and resistance level mapping
📊 Delta Volume Analysis:
Calculates buying/selling pressure for each candle
Identifies strong swings based on Delta threshold
Filters by positive buying or negative selling pressure
Displays detailed liquidity ratios (buy/sell volumes)
⚡ Displacement Candles:
Detects powerful momentum candles with rapid price movement
Multiple conditions: large body, small wicks, high volume
ATR filter to measure strength relative to volatility
Color-codes candles by strength rating
🔍 Wave Analysis:
Tracks waves between swing points
Calculates cumulative buy/sell volume per wave
Detects bullish/bearish divergence patterns
Alerts for fake breakouts and strong accumulation
📊 Live Dashboard:
Real-time statistics for swings and liquidity
Measures price proximity to support/resistance levels
Current Delta information and active wave data
Proximity alerts for nearby key levels
⚙️ Additional Features:
Color-codes candles for strong swing points
Multiple filters for precision (Delta, volume, ATR)
Detailed tooltips for each marker
Flexible color and display settings
The indicator helps traders identify strong reversal points, institutional liquidity zones, and high-momentum candles for more accurate trading decisions.
وصف مؤشر Swing v.3
Swing v.3 هو مؤشر متقدم لتحليل نقاط التأرجح (السوينق) والزخم السعري مع تحليل عميق للسيولة وحجم التداول:
المكونات الرئيسية:
🎯 نقاط السوينق (Swing Points):
كشف نقاط التأرجح العليا والسفلى (SH/SL) بطريقة ذكية
ترتيب صحيح للقمم والقيعان (يمنع التكرار)
تحديد السوينقات القوية (★) بناءً على حجم التداول العالي
رسم مستويات الدعم والمقاومة تلقائياً
📊 تحليل Delta Volume:
حساب ضغط الشراء/البيع لكل شمعة
تحديد السوينقات القوية بناءً على Delta
فلترة حسب ضغط الشراء الإيجابي أو البيع السلبي
عرض نسب السيولة التفصيلية (شراء/بيع)
⚡ شموع Displacement (الإزاحة السريعة):
كشف الشموع القوية ذات الحركة السريعة
شروط متعددة: جسم كبير، ذيول صغيرة، حجم تداول عالي
فلتر ATR لقياس القوة نسبة للتقلبات
تلوين الشموع حسب قوتها
🔍 تحليل الموجات (Wave Analysis):
تتبع الموجات بين السوينقات
حساب إجمالي حجم الشراء/البيع لكل موجة
كشف التباين الإيجابي/السلبي (Divergence)
تنبيهات الاختراق الوهمي والتجميع القوي
📊 لوحة المعلومات (Dashboard):
عرض إحصائيات حية للسوينقات والسيولة
قياس قرب السعر من مستويات الدعم/المقاومة
معلومات Delta الحالية والموجة النشطة
تنبيهات للمستويات القريبة
⚙️ المميزات الإضافية:
تلوين الشموع للسوينقات القوية
فلاتر متعددة للدقة (Delta، حجم التداول، ATR)
معلومات تفصيلية في Tooltips لكل علامة
إعدادات مرنة للألوان والعرض
Smart Money ProSmart Money Pro V 8.1 is an advanced trading indicator that tracks institutional "smart money" movements using multiple Smart Money Concepts (SMC) techniques:
Market Structure: Identifies Change of Character (CHoCH), Break of Structure (BOS), and Internal/External Market Structure (IDM)
Order Blocks: Detects demand/supply zones including EXT OB, IDM OB, SCOB, and mitigation/breaker blocks
Order Flow: Tracks major and minor order flows with mitigation levels
Fair Value Gaps (FVG): Highlights price inefficiencies and imbalance zones
Liquidity Levels: Maps liquidity sweeps and key pivot levels
Price Structure: Shows OTE (Optimal Trade Entry) zones, PDH/PDL (Previous Day High/Low), equilibrium levels, and swing sweeps
Candle Patterns: Detects Inside and Outside bars
The indicator helps traders identify institutional entry/exit points, liquidity grabs, and high-probability trading zones.
Smart Money Pro V 8.1 هو مؤشر متقدم لتتبع تحركات المؤسسات المالية "الأموال الذكية" باستخدام مفاهيم Smart Money Concepts (SMC):
هيكل السوق: يحدد تغيير الاتجاه (CHoCH)، كسر الهيكل (BOS)، والهيكل الداخلي/الخارجي (IDM)
مناطق الطلب والعرض: يكتشف Order Blocks بأنواعها (EXT OB, IDM OB, SCOB) ومناطق الاختراق والتخفيف
تدفق الأوامر: يتتبع التدفقات الرئيسية والثانوية مع مستويات التخفيف
فجوات القيمة العادلة (FVG): يبرز مناطق عدم الكفاءة السعرية وعدم التوازن
مستويات السيولة: يرسم مصائد السيولة والنقاط المحورية الرئيسية
هيكل السعر: يعرض مناطق OTE (نقاط الدخول المثلى)، أعلى/أدنى سعر سابق (PDH/PDL)، مستويات التوازن، وكسر القمم/القيعان
أنماط الشموع: يكتشف شموع Inside و Outside Bar
Trend Pullback S-MSNRThis Indicator Identify two Major Time Frames for Trend Selection and Pullback.
NY time 10:00 AM to 10:15 AM zone will decide for trend.
NY time 10:30 AM to 11:30 AM zone will Pullback and Follow the Previous Trend.
Use S-MSNR Strategy for these two time Zone.
Quantum Trend MatrixThe Quantum Trend Matrix (QTM) is a comprehensive technical analysis suite designed to solve the problem of market noise by combining Statistical Volatility Structure with Momentum Trend Filtration.
Many traders struggle because they trade momentum signals (like crossovers) without considering the daily structural limits of the market. This script integrates these two concepts into a single "Roadmap" to help traders align their entries with institutional price structure.
🎯 Concept & Methodology (How it Works)
This script is not merely a collection of indicators; it is a logic-based system where components effectively filter one another:
1. Structural Volatility Levels (The "Map")
Unlike standard Support/Resistance which is subjective, QTM calculates objective levels based on the internal logic.
Methodology: The script applies specific percentage-based volatility coefficients (tailored to the asset class, e.g., Indices ,Commodities,etc) to the Price.
* The Green Line (Breakout Level) : Represents the statistical upper volatility limit above which a "Bullish Expansion" is expected to occur.
* The Red Line (Breakdown Level): Represents the statistical lower volatility limit Below which a "Bearish Expansion" is expected to occur.
* Why this is useful: It prevents traders from chasing trends in the "chop zone" (between the lines) and highlights high-probability breakout areas.
2. The Value Zone (Trend Validation)
* Methodology: This utilizes a High-Timeframe moving average ribbon logic (calculated using Daily data).
* Function: It acts as a dynamic trend filter. A breakout signal (Green Line cross) is statistically significant if the Price is also supported by the Value Zone (Blue Ribbon). If the Ribbon is Orange, a bullish breakout is likely a "False Trap".
3. Momentum & Exhaustion Logic
* Crossovers (Circles): Validates short-term trend shifts using smoothed exponential average crossovers.
* Mean Reversion (Diamonds): Uses an integrated Oscillator Momentum logic to detect over-extended price action. A Diamond signal warns that the price has deviated too far from the mean (VWAP) and trend continuation is risky.
🛠️ Practical Application
This script is designed for a top-down decision process:
1. Wait for Structure: For Trending Moves do not trade inside the Pivot (Blue) to Breakout (Green/Red) range. This is the "Noise" zone.
2. Confirm the Breakout: Wait for a candle to CLOSE outside the Green or Red volatility levels or to take Support/Resistance from Red/Green Levels respectively.
3. Check the "Value Zone": Ensure the background ribbon color matches the breakout direction (Blue for Long, Orange for Short).
4. Monitor Health: Use the bottom-right panel (displaying RSI, ADX, and DI metrics) to ensure trend strength is sufficient to sustain the move.
⚠️ Disclaimer & Risk Disclosure
* Logic Disclosure: While the specific volatility coefficients and smoothing lengths are proprietary, this script relies on standard technical analysis concepts including Moving Averages, RSI, ADX, and Percentage-based levels relative to the Price.
* No Guarantee: Technical analysis is probabilistic, not predictive. Past performance does not guarantee future results.
* Risk Management: Always use Stop Losses. This tool is an aid for analysis, not a replacement for risk management.
🔒 Access Information
This is a proprietary Invite-Only script.
*(Note: Do not ask for access in the comments below. Please refer to the author's signature or profile for more information).*
BankNifty Aggregate Weighted OBVDescription-
This indicator calculates the aggregate On Balance Volume (OBV) of the entire Bank Nifty Index by analyzing its 12 individual constituents rather than the index futures volume.
Why is this different?
Standard OBV on the Bank Nifty Index usually analyzes the volume of the Index Futures or the raw index volume (which can be inaccurate or derivative-heavy). This script queries the real-time volume and price action of the 12 specific banks that make up the index (HDFC, ICICI, SBI, Axis, Kotak, etc.).
How it works-
Weighted Calculation:- It calculates the Net Flow (Volume * Weightage) for every single bank for the current bar.
Aggregation:- It sums the Net Flow of all 12 banks to create a "Total Sector Flow."
Accumulation:- It generates the OBV line based on this aggregated sector flow.
Normalization:- Unlike simple summation scripts, this calculates flow per bar before accumulating, ensuring that stocks with longer trading histories do not skew the data.
Features:
Customizable Weights:- Users can adjust the weightage of each bank if NSE rebalances the index.
Toggle Constituents:- You can turn specific banks on/off to see their impact.
Signal Line:- Includes an SMA/EMA signal line to help identify volume trend reversals.
Trend Coloring:- The fill color changes (Green/Red) based on the OBV's position relative to the signal line.
How to use:
Trend Confirmation: If Bank Nifty price is rising but this Weighted OBV is falling, it indicates a divergence and potential weakness in the move (lack of institutional participation).
Breakouts: Use the Signal Line crossover to validate breakout moves.
Adaptive Trend Navigator [ATH Filter & Risk Engine]Description:
This strategy implements a systematic Trend Following approach designed to capture major moves while actively protecting capital during severe bear markets. It combines a classic Moving Average "Fan" logic with two advanced risk management layers: a 4-Stage Dynamic Stop Loss and a macro-economic "Circuit Breaker" filter.
Core Concepts:
1. Trend Identification (Entry Logic) The script uses a cascade of Simple Moving Averages (SMA 25, 50, 100, 200) to identify the maturity of a trend.
Entries are triggered by specific crossovers (e.g., SMA 25 crossing SMA 50) or by breaking above the previous trade's high ("High-Water Mark" Re-Entry).
2. The "Circuit Breaker" (Crash Protection) To prevent trading during historical market collapses (like 2000 or 2008), the strategy monitors the Nasdaq 100 (QQQ) as a global benchmark:
Normal Regime: If the market is within 20% of its All-Time High, the strategy operates normally.
Crisis Regime: If the QQQ falls more than 20% from its ATH, the "Circuit Breaker" activates (Visualized by a Red Background).
Recovery Rule: In a Crisis Regime, new long positions are blocked unless the QQQ reclaims its SMA 200. This filters out "bull traps" in secular bear markets.
3. 4-Stage Risk Engine (Exit Logic) Once in a trade, the risk management adapts to the position's performance:
Stage 1: Fixed initial Stop Loss (default 10%) for breathing room.
Stage 2: Moves to Break-Even area once the price rises 12%.
Stage 3: Tightens to a trailing stop (8%) after 25% profit.
Stage 4: Maximizes gains with a tight trailing stop (5%) during parabolic moves (>40% profit).
Visual Guide:
SMAs: 25/50/100/200 period lines for trend visualization.
Red Background: Indicates the "Crisis Regime" where trading is halted due to broad market weakness.
Blue Background: Indicates a "Recovery Phase" (Crisis is active, but market is above SMA 200).
Red Line: Shows the dynamic Stop Loss level for active positions.
Settings: All parameters (SMA lengths, Drawdown threshold, Risk Stages) are fully customizable. The QQQ benchmark ticker can also be changed to SPY or other indices depending on the asset class traded.
Alper-EMAAlper-EMA
Description:
This indicator allows you to display 5 customizable EMAs (Exponential Moving Averages) on a single chart. Each EMA can be configured independently with length, color, visibility, and calculation timeframe.
Features:
5 fully customizable EMAs
Set individual length and color for each EMA
Toggle visibility for each EMA
Multi-timeframe calculation: e.g., display EMA300 calculated on a 30-minute timeframe while viewing a 1-minute chart
Labels display EMA period and timeframe for clarity
Adjustable label size: tiny / small / normal / large
Clear and readable plot lines
Use Cases:
Monitor multiple timeframe EMAs simultaneously
Analyze trend and support/resistance levels
Track EMA crossovers for strategy development
Note:
This indicator is suitable for both short-term (scalping) and medium-to-long term analysis. The multi-timeframe feature allows you to see different EMA perspectives on a single chart quickly.
DTR Volume TrendDTR Volume Trend is a volume-based oscillator designed to measure trend strength, momentum shifts, and mean-reversion opportunities using volume-weighted price data. The indicator analyzes recent volume profiles, VWAP deviation, and smoothed signals to create a responsive oscillator that adapts to market conditions.
Key Features:
- Volume-weighted oscillator based on VWAP and volume distribution.
- Mean reversion mode to detect when price deviates strongly from its volume-weighted average.
- Adaptive midline that adjusts automatically to recent oscillator behavior.
- Bull and bear zones that highlight potential exhaustion or reversal areas.
- Fast and slow signal lines to show momentum changes through crossovers.
- Optional bar coloring to highlight bullish or bearish conditions on the chart.
How to Use:
- When the oscillator is above the midline, momentum tends to be bullish.
- When it is below the midline, momentum tends to be bearish.
- Upper zones may indicate overbought or exhaustion levels.
- Lower zones may indicate oversold or accumulation levels.
- Crossovers between fast and slow signals can highlight early trend or momentum shifts.
Best For:
- Trend confirmation
- Mean-reversion strategies
- Identifying momentum changes
- Spotting volume-driven extremes
KVS-Ultimate FVG & iFVG System [MTF + Distance Filter]Description: This indicator identifies Fair Value Gaps (FVG) and Inversion FVGs (iFVG) across multiple timeframes (MTF) with an advanced visualization system. Unlike standard FVG indicators, this script solves the "chart clutter" problem with a unique Distance Filter and offers a customizable Split Label System.
Key Features:
1. Unique Distance Filter (Clean Screen Mode):
When enabled, the script only shows the closest FVGs to the current price within a user-defined limit.
Keeps your chart clean while focusing on relevant price action levels.
2. Split Label System (Tabular Design):
Completely customizable label positioning, sizing, and coloring.
Separate controls for Normal FVGs and iFVGs.
Smart Label Logic: If you hide the FVG box, its label automatically hides. If an FVG breaks and becomes an iFVG (or fades), the label logic switches automatically to the iFVG settings.
3. Strict Mode Filtering:
Enabled: Checks if the candle closing price effectively breaks the previous structure (High/Low of the 1st candle), ensuring high-quality gaps.
Disabled: Detects all gaps between wicks (Standard calculation).
4. Multi-Timeframe (MTF) Support:
Monitor FVGs from up to 5 different timeframes simultaneously on a single chart.
5. Dynamic Interaction:
Choose how the script reacts when an FVG is broken: Turn it into an iFVG (Inversion) or simply fade the color (Ghost/Fade mode).
How to Use:
Use the "Distance Filter" checkbox in settings to clean up old/far blocks.
Adjust "TF1" to "TF5" to set up your multi-timeframe analysis.
Customize the Label Panel to align text perfectly with your chart style.
Disclaimer: This tool is for educational purposes and support for technical analysis.
Relative Strength Heatmap [BackQuant]Relative Strength Heatmap
A multi-horizon RSI matrix that compresses 20 different lookbacks into a single panel, turning raw momentum into a visual “pressure gauge” for overbought and oversold clustering, trend exhaustion, and breadth of participation across time horizons.
What this is
This indicator builds a strip-style heatmap of 20 RSIs, each with a different length, and stacks them vertically as colored tiles in a single pane. Every tile is colored by its RSI value using your chosen palette, so you can see at a glance:
How many “fast” versus “slow” RSIs are overbought or oversold.
Whether momentum is concentrated in the short lookbacks or spread across the whole curve.
When momentum extremes cluster, signalling strong market pressure or exhaustion.
On top of the tiles, the script plots two simple breadth lines:
A white line that counts how many RSIs are above 70 (overbought cluster).
A black line that counts how many RSIs are below 30 (oversold cluster).
This turns a single symbol’s RSI ladder into a compact “market pressure gauge” that shows not only whether RSI is overbought or oversold, but how many different horizons agree at the same time.
Core idea
A single RSI looks at one length and one timescale. Markets, however, are driven by flows that operate on multiple horizons at once. By computing RSI over a ladder of lengths, you approximate a “term structure” of strength:
Short lengths react to immediate swings and very recent impulses.
Medium lengths reflect swing behaviour and local trends.
Long lengths reflect structural bias and higher timeframe regime.
When many lengths agree, for example 10 or more RSIs all above 70, it suggests broad participation and strong directional pressure. When only a few fast lengths stretch to extremes while longer ones stay neutral, the move is more fragile and more likely to mean-revert.
This script makes that structure visible as a heatmap instead of forcing you to run many separate RSI panes.
How it works
1) Generating RSI lengths
You control three parameters in the calculation settings:
RS Period – the base RSI length used for the shortest strip.
RSI Step – the amount added to each successive RSI length.
RSI Multiplier – a global scaling factor applied after the step.
Each of the 20 RSIs uses:
RSI length = round((base_length + step × index) × multiplier) , where the index goes from 0 to 19.
That means:
RSI 1 uses (len + step × 0) × mult.
RSI 2 uses (len + step × 1) × mult.
…
RSI 20 uses (len + step × 19) × mult.
You can keep the ladder dense (small step and multiplier) or stretch it across much longer horizons.
2) Heatmap layout and grouping
Each RSI is plotted as an “area” strip at a fixed vertical level using histbase to stack them:
RSI 1–5 form Group 1.
RSI 6–10 form Group 2.
RSI 11–15 form Group 3.
RSI 16–20 form Group 4.
Each group has a toggle:
Show only Group 1 and 2 if you care mainly about fast and medium horizons.
Show all groups for a full spectrum from very short to very long.
Hide any group that feels redundant for your workflow.
The actual numeric RSI values are not plotted as lines. Instead, each strip is drawn as a horizontal band whose fill color represents the current RSI regime.
3) Palette-based coloring
Each tile’s color is driven by the RSI value and your chosen palette. The script includes several palettes:
Viridis – smooth green to yellow, good for subtle reading.
Jet – strong blue to red sequence with high contrast.
Plasma – purple through orange to yellow.
Custom Heat – cool blues to neutral grey to hot reds.
Gray – grayscale from white to black for minimalistic layouts.
Cividis, Inferno, Magma, Turbo, Rainbow – additional scientific and rainbow-style maps.
Internally, RSI values are bucketed into ranges (for example, below 10, 10–20, …, 90–100). Each bucket maps to a unique colour for that palette. In all schemes, low RSI values are mapped to the “cold” or darker side and high RSI values to the “hot” or brighter side.
The result is a true momentum heatmap:
Cold or dark tiles show low RSI and oversold or compressed conditions.
Mid tones show neutral or mid-range RSI.
Warm or bright tiles show high RSI and overbought or stretched conditions.
4) Bull and bear breadth counts
All 20 RSI values are collected into an array each bar. Two counters are then calculated:
Bull count – how many RSIs are above 70.
Bear count – how many RSIs are below 30.
These are plotted as:
A white line (“RSI > 70 Count”) for the overbought cluster.
A black line (“RSI < 30 Count”) for the oversold cluster.
If you enable the “Show Bull and Bear Count” option, you get an immediate reading of how many of the 20 horizons are stretched at any moment.
5) Cluster alerts and background tagging
Two alert conditions monitor “strong cluster” regimes:
RSI Heatmap Strong Bull – triggers when at least 10 RSIs are above 70.
RSI Heatmap Strong Bear – triggers when at least 10 RSIs are below 30.
When one of these conditions is true, the indicator can tint the background of the chart using a soft version of the current palette. This visually marks stretches where momentum is extreme across many lengths at once, not just on a single RSI.
What it plots
In one oscillator window, the indicator provides:
Up to 20 horizontal RSI strips, each representing a different RSI length.
Color-coded tiles reflecting the current RSI value for each length.
Group toggles to show or hide each block of five RSIs.
An optional white line that counts how many RSIs are above 70.
An optional black line that counts how many RSIs are below 30.
Optional background highlights when the number of overbought or oversold RSIs passes the strong-cluster threshold.
How it measures breadth and pressure
Single-symbol breadth
Breadth is usually defined across a basket of symbols, such as how many stocks advance versus decline. This indicator uses the same concept across time horizons for a single symbol. The question becomes:
“How many different RSI lengths are stretched in the same direction at once?”
Examples:
If only 2 or 3 of the shortest RSIs are above 70, bull count stays low. The move is fast and local, but not yet broadly supported.
If 12 or more RSIs across short, medium and long lengths are above 70, the bull count spikes. The move has broad momentum and strong upside pressure.
If 10 or more RSIs are below 30, bear count spikes and you are in a broad oversold regime.
This is breadth of momentum within one market.
Market pressure gauge
The combination of heatmap tiles and breadth lines acts as a pressure gauge:
High bull count with warm colors across most strips indicates strong upside pressure and crowded long positioning.
High bear count with cold colors across most strips indicates strong downside pressure and capitulation or forced selling.
Low counts with a mixed heatmap indicate neutral pressure, fragmented flows, or range-bound conditions.
You can treat the strong-cluster alerts as “extreme pressure” signals. When they fire, the market is heavily skewed in one direction across many horizons.
How to read the heatmap
Horizontal patterns (through time)
Look along the time axis and watch how the colors evolve:
Persistent hot tiles across many strips show sustained bullish pressure and trend strength.
Persistent cold tiles across many strips show sustained bearish pressure and weak demand.
Frequent flipping between hot and cold colours indicates a choppy or mean-reverting environment.
Vertical structure (across lengths at one bar)
Focus on a single bar and read the column of tiles from top to bottom:
Short RSIs hot, long RSIs neutral or cool: early trend or short-term fomo. Price has moved fast, longer horizons have not caught up.
Short and long RSIs all hot: mature, entrenched uptrend. Broad participation, high pressure, greater risk of blow-off or late-entry vulnerability.
Short RSIs cold but long RSIs mid to high: pullback in a higher timeframe uptrend. Dip-buy and continuation setups are often found here.
Short RSIs high but long RSIs low: countertrend rallies within a broader downtrend. Good hunting ground for fades and short entries after a bounce.
Bull and bear breadth lines
Use the two lines as simple, numeric breadth indicators:
A rising white line shows more RSIs pushing above 70, so bullish pressure is expanding in breadth.
A rising black line shows more RSIs pushing below 30, so bearish pressure is expanding in breadth.
When both lines are low and flat, few horizons are extreme and the market is in mid-range territory.
Cluster zones
When either count crosses the strong threshold (for example 10 out of 20 RSIs in extreme territory):
A strong bull cluster marks a broadly overbought regime. Trend followers may see this as confirmation. Mean-reversion traders may see it as a late-stage or blow-off context.
A strong bear cluster marks a broadly oversold regime. Downtrend traders see strong pressure, but the risk of sharp short-covering bounces also increases.
Trading applications
Trend confirmation
Use the heatmap and breadth lines as a trend filter:
Prefer long setups when the heatmap shows mostly mid to high RSIs and the bull count is rising.
Avoid fresh shorts when there is a strong bull cluster, unless you are specifically trading exhaustion.
Prefer short setups when the heatmap is mostly low RSIs and the bear count is rising.
Avoid aggressive longs when a strong bear cluster is active, unless you are trading reflexive bounces.
Mean-reversion timing
Treat cluster extremes as exhaustion zones:
Look for reversal patterns, failed breakouts, or order flow shifts when bull count is very high and price starts to stall or diverge.
Look for reflexive bounce potential when bear count is very high and price stops making new lows or shows absorption at the lows.
Use the palette and counts together: hot tiles plus a peaking white line can mark blow-off conditions, cold tiles plus a peaking black line can mark capitulation.
Regime detection and risk toggling
Use the overall shape of the ladder over time:
If upper strips stay warm and lower strips stay neutral or warm for extended periods, the market is in an uptrend regime. You can justify higher risk for long-biased strategies.
If upper strips stay cold and lower strips stay neutral or cold, the market is in a downtrend regime. You can justify higher risk for short-biased strategies or defensive positioning.
If colours and counts flip frequently, you are likely in a range or choppy regime. Consider reducing size or using more tactical, short-term strategies.
Multi-horizon synchronization
You can think of each RSI length as a proxy for a different “speed” of the same market:
When only fast RSIs are stretched, the move is local and less robust.
When fast, medium and slow RSIs align, the move has multi-horizon confirmation.
You can require a minimum bull or bear count before allowing your main strategy to engage.
Spotting hidden shifts
Sometimes price appears flat or drifting, but the heatmap quietly cools or warms:
If price is sideways while many hot tiles fade toward neutral, momentum is decaying under the surface and trend risk is increasing.
If price is sideways while many cold tiles climb back toward neutral, selling pressure is decaying and the tape is repairing itself.
Settings overview
Calculation Settings
RS Period – base RSI length for the shortest strip.
RSI Step – the increment added to each successive RSI length.
RSI Multiplier – scales all generated RSI lengths.
Calculation Source – the input series, such as close, hlc3 or others.
Plotting and Coloring Settings
Heatmap Color Palette – choose between Viridis, Jet, Plasma, Custom Heat, Gray, Cividis, Inferno, Magma, Turbo or Rainbow.
Show Group 1 – toggles RSI 1–5.
Show Group 2 – toggles RSI 6–10.
Show Group 3 – toggles RSI 11–15.
Show Group 4 – toggles RSI 16–20.
Show Bull and Bear Count – enables or disables the two breadth lines.
Alerts
RSI Heatmap Strong Bull – fires when the number of RSIs above 70 reaches or exceeds the configured threshold (default 10).
RSI Heatmap Strong Bear – fires when the number of RSIs below 30 reaches or exceeds the configured threshold (default 10).
Tuning guidance
Fast, tactical configurations
Use a small base RS Period, for example 2 to 5.
Use a small RSI Step, for tight clustering around the fast horizon.
Keep the multiplier near 1.0 to avoid extreme long lengths.
Focus on Group 1 and Group 2 for intraday and short-term trading.
Swing and position configurations
Use a mid-range RS Period, for example 7 to 14.
Use a moderate RSI Step to fan out into slower horizons.
Optionally use a multiplier slightly above 1.0.
Keep all four groups enabled for a full view from fast to slow.
Macro or higher timeframe configurations
Use a larger base RS Period.
Use a larger RSI Step so the top of the ladder reaches very slow lengths.
Focus on Group 3 and Group 4 to see structural momentum.
Treat clusters as regime markers rather than frequent trading signals.
Notes
This indicator is a contextual tool, not a standalone trading system. It does not model execution, spreads, slippage or fundamental drivers. Use it to:
Understand whether momentum is narrow or broad across horizons.
Confirm or filter existing signals from your primary strategy.
Identify environments where the market is crowded into one side.
Distinguish between isolated spikes and truly broad pressure moves.
The Relative Strength Heatmap is designed to answer a simple but powerful question:
“How many versions of RSI agree with what I am seeing on the chart?”
By compressing those answers into a single panel with clear colour coding and breadth lines, it becomes a practical, visual gauge of momentum breadth and market pressure that you can overlay on any trading framework.
MFM – Light Context HUD (Minimal)Overview
MFM Light Context HUD is the free version of the Market Framework Model. It gives you a fast and clean view of the current market regime and phase without signals or chart noise. The HUD shows whether the asset is in a bullish or bearish environment and whether it is in a volatile, compression, drift, or neutral phase. This helps you read structure at a glance.
Asset availability
The free version works only on a selected list of five assets.
Supported symbols are
SP:SPX
TVC:GOLD
BINANCE:BTCUSD
BINANCE:ETHUSDT
OANDA:EURUSD
All other assets show a context banner only.
How it works
The free version uses fixed settings based on the original MFM model. It calculates the regime using a higher timeframe RSI ratio and identifies the current phase using simplified momentum conditions. The chart stays clean. Only a small HUD appears in the top corner. Full visual phases, ratio logic, signals, and auto tune are part of the paid version.
The free version shows the phase name only. It does not display colored phase zones on the chart.
Phase meaning
The Market Framework Model uses four structural phases to describe how the market
behaves. These are not signals but context layers that show the underlying environment.
Volatile (Phase 1)
The market is in a fast, unstable or directional environment. Price can move aggressively with
stronger momentum swings.
Compression (Phase 2)
The market is in a contracting state. Momentum slows and volatility decreases. This phase
often appears before expansion, but it does not predict direction.
Drift (Phase 3)
The market moves in a more controlled, persistent manner. Trends are cleaner and volatility
is lower compared to volatile phases.
No phase
No clear structural condition is active.
These phases describe market structure, not trade entries. They help you understand the conditions you are trading in.
Cross asset context
The Market Framework Model reads markets as a multi layer system. The full version includes cross asset analysis to show whether the asset is acting as a leader or lagger relative to its benchmark. The free version uses the same internal benchmark logic for regime detection but does not display the cross asset layer on the chart.
Cross asset structure is a core part of the MFM model and is fully available in the paid version.
Included in this free version
Higher timeframe regime
Current phase name
Clean chart output
Context only
Works on a selected set of assets
Not included
No forecast signals
No ratio leader or lagger logic
No MRM zones
No MPF timing
No auto tune
The full version contains all features of the complete MFM model.
Full version
You can find the full indicator here:
payhip.com
More information
Model details and documentation:
mfm.inratios.com
Momentum Framework Model free HUD indicator User Guide: mfm.inratios.com
Disclaimer
The Market Framework Model (MFM) and all related materials are provided for educational and informational purposes only. Nothing in this publication, the indicator, or any associated charts should be interpreted as financial advice, investment recommendations, or trading signals. All examples, visualizations, and backtests are illustrative and based on historical data. They do not guarantee or imply any future performance. Financial markets involve risk, including the potential loss of capital, and users remain fully responsible for their own decisions. The author and Inratios© make no representations or warranties regarding the accuracy, completeness, or reliability of the information provided. MFM describes structural market context only and should not be used as the sole basis for trading or investment actions.
By using the MFM indicator or any related insights, you agree to these terms.
© 2025 Inratios. Market Framework Model (MFM) is protected via i-Depot (BOIP) – Ref. 155670. No financial advice.






















