Transfer Function Filter [theUltimator5]The Transfer Function Filter is an engineering style approach to transform the price action on a chart into a frequency, then filter out unwanted signals using Butterworth-style filter approach.
This indicator allows you to analyze market structure by isolating or removing different frequency components of price movement—similar to how engineers filter signals in control systems and electrical circuits.
🔎 Features
Four Filter Types
1) Low Pass Filter – Smooths price data, highlighting long-term trends while filtering out short-term noise. This filter acts similar to an EMA, removing noisy signals, resulting in a smooth curve that follows the price of the stock relative to the filter cutoff settings.
Real world application for low pass filter - Used in power supplies to provide a clean, stable power level.
2) High Pass Filter – Removes slow-moving trends to emphasize short-term volatility and rapid fluctuations. The high pass filter removes the "DC" level of the chart, removing the average price moves and only outputting volatility.
Real world application for high pass filter - Used in audio equalizers to remove low-frequency noise (like rumble) while allowing higher frequencies to pass through, improving sound clarity.
3) Band Pass Filter – Allows signals to plot only within a band of bar ranges. This filter removes the low pass "DC" level and the high pass "high frequency noise spikes" and shows a signal that is effectively a smoothed volatility curve. This acts like a moving average for volatility.
Real world application for band pass filter - Radio stations only allow certain frequency bands so you can change your radio channel by switching which frequency band your filter is set to.
4) Band Stop Filter – Suppresses specific frequency bands (cycles between two cutoffs). This filter allows through the base price moving average, but keeps the high frequency volatility spikes. It allows you to filter out specific time interval price action.
Real world application for band stop filter - If there is prominent frequency signal in the area which can cause unnecessary noise in your system, a band stop filter can cancel out just that frequency so you get everything else
Configurable Parameters
• Cutoff Periods – Define the cycle lengths (in bars) to filter. This is a bit counter-intuitive with the numbering since the higher the bar count on the low-pass filter, the lower the frequency cutoff is. The opposite holds true for the high pass filter.
• Filter Order – Adjust steepness and responsiveness (higher order = sharper filtering, but with more delay).
• Overlay Option – Display Low Pass & Band Stop outputs directly on the price chart, or in a separate pane. This is enabled by default, plotting the filters that mimic moving averages directly onto the chart.
• Source Selection – Apply filters to close, open, high, low, or custom sources.
Histograms for Comparison
• BS–LP Histogram – Shows distance between Band Stop and Low Pass filters.
• BP–HP Histogram – Highlights differences between Band Pass and High Pass filters.
Histograms give the visualization of a pseudo-MACD style indicator
Visual & Informational Aids
• Customizable colors for each filter line.
• Optional zero-line for histogram reference.
• On-chart info table summarizing active filters, cutoff settings, histograms, and filter order.
📊 Use Cases
Trend Detection – Use the Low Pass filter to smooth noise and follow underlying market direction.
Volatility & Cycle Analysis – Apply High Pass or Band Pass to capture shorter-term patterns.
Noise Suppression – Deploy Band Stop to remove specific choppy frequencies.
Momentum Insight – Watch the histograms to spot divergences and relative filter strength.
Cerca negli script per "长三角ETF技术形态分析(如支撑位、压力位、技术指标)"
Multi-Timeframe Bollinger BandsMy hope is to optimize the settings for this indicator and reintroduce it as a "strategy" with suggested position entry and exit points shown in the price pane.
I’ve been having good results setting the “Bollinger Band MA Length” in the Input tab to between 5 and 10. You can use the standard 20 period, but your results will not be as granular.
This indicator has proven very good at finding local tops and bottoms by combining data from multiple timeframes. Use timeframes that are lower than the timeframe you are viewing in your price pane. Be cognizant that the indicator, like other oscillators, does occasionally produce divergences at tops and bottoms.
Any feedback is appreciated.
Overview
This indicator is an oscillator that measures the normalized position of the price relative to Bollinger Bands across multiple timeframes. It takes the price's position within the Bollinger Bands (calculated on different timeframes) and averages those positions to create a single value that oscillates between 0 and 1. This value is then plotted as the oscillator, with reference lines and colored regions to help interpret the price's relative strength or weakness.
How It Works
Bollinger Band Calculation:
The indicator uses a custom function f_getBBPosition() to calculate the position of the price within Bollinger Bands for a given timeframe.
Price Position Normalization:
For each timeframe, the function normalizes the price's position between the upper and lower Bollinger Bands.
It calculates three positions based on the high, low, and close prices of the requested timeframe:
pos_high = (High - Lower Band) / (Upper Band - Lower Band)
pos_low = (Low - Lower Band) / (Upper Band - Lower Band)
pos_close = (Close - Lower Band) / (Upper Band - Lower Band)
If the upper band is not greater than the lower band or if the data is invalid (e.g., na), it defaults to 0.5 (the midline).
The average of these three positions (avg_pos) represents the normalized position for that timeframe, ranging from 0 (at the lower band) to 1 (at the upper band).
Multi-Timeframe Averaging:
The indicator fetches Bollinger Band data from four customizable timeframes (default: 30min, 60min, 240min, daily) using request.security() with lookahead=barmerge.lookahead_on to get the latest available data.
It calculates the normalized position (pos1, pos2, pos3, pos4) for each timeframe using f_getBBPosition().
These four positions are then averaged to produce the final avg_position:avg_position = (pos1 + pos2 + pos3 + pos4) / 4
This average is the oscillator value, which is plotted and typically oscillates between 0 and 1.
Moving Averages:
Two optional moving averages (MA1 and MA2) of the avg_position can be enabled, calculated using simple moving averages (ta.sma) with customizable lengths (default: 5 and 10).
These can be potentially used for MA crossover strategies.
What Is Being Averaged?
The oscillator (avg_position) is the average of the normalized price positions within the Bollinger Bands across the four selected timeframes. Specifically:It averages the avg_pos values (pos1, pos2, pos3, pos4) calculated for each timeframe.
Each avg_pos is itself an average of the normalized positions of the high, low, and close prices relative to the Bollinger Bands for that timeframe.
This multi-timeframe averaging smooths out short-term fluctuations and provides a broader perspective on the price's position within the volatility bands.
Interpretation
0.0 The price is at or below the lower Bollinger Band across all timeframes (indicating potential oversold conditions).
0.15: A customizable level (green band) which can be used for exiting short positions or entering long positions.
0.5: The midline, where the price is at the average of the Bollinger Bands (neutral zone).
0.85: A customizable level (orange band) which can be used for exiting long positions or entering short positions.
1.0: The price is at or above the upper Bollinger Band across all timeframes (indicating potential overbought conditions).
The colored regions and moving averages (if enabled) help identify trends or crossovers for trading signals.
Example
If the 30min timeframe shows the close at the upper band (position = 1.0), the 60min at the midline (position = 0.5), the 240min at the lower band (position = 0.0), and the daily at the upper band (position = 1.0), the avg_position would be:(1.0 + 0.5 + 0.0 + 1.0) / 4 = 0.625
This value (0.625) would plot in the orange region (between 0.85 and 0.5), suggesting the price is relatively strong but not at an extreme.
Notes
The use of lookahead=barmerge.lookahead_on ensures the indicator uses the latest available data, making it more real-time, though its effectiveness depends on the chart timeframe and TradingView's data feed.
The indicator’s sensitivity can be adjusted by changing bb_length ("Bollinger Band MA Length" in the Input tab), bb_mult ("Bollinger Band Standard Deviation," also in the Input tab), or the selected timeframes.
Multi-Timeframe Bollinger Band PositionBeta version.
My hope is to optimize the settings for this indicator and reintroduce it as a "strategy" with suggested position entry and exit points shown in the price pane.
Any feedback is appreciated.
Overview
This indicator is an oscillator that measures the normalized position of the price relative to Bollinger Bands across multiple timeframes. It takes the price's position within the Bollinger Bands (calculated on different timeframes) and averages those positions to create a single value that oscillates between 0 and 1. This value is then plotted as the oscillator, with reference lines and colored regions to help interpret the price's relative strength or weakness.
How It Works
Bollinger Band Calculation:
The indicator uses a custom function f_getBBPosition() to calculate the position of the price within Bollinger Bands for a given timeframe.
Price Position Normalization:
For each timeframe, the function normalizes the price's position between the upper and lower Bollinger Bands.
It calculates three positions based on the high, low, and close prices of the requested timeframe:
pos_high = (High - Lower Band) / (Upper Band - Lower Band)
pos_low = (Low - Lower Band) / (Upper Band - Lower Band)
pos_close = (Close - Lower Band) / (Upper Band - Lower Band)
If the upper band is not greater than the lower band or if the data is invalid (e.g., na), it defaults to 0.5 (the midline).
The average of these three positions (avg_pos) represents the normalized position for that timeframe, ranging from 0 (at the lower band) to 1 (at the upper band).
Multi-Timeframe Averaging:
The indicator fetches Bollinger Band data from four customizable timeframes (default: 30min, 60min, 240min, daily) using request.security() with lookahead=barmerge.lookahead_on to get the latest available data.
It calculates the normalized position (pos1, pos2, pos3, pos4) for each timeframe using f_getBBPosition().
These four positions are then averaged to produce the final avg_position:avg_position = (pos1 + pos2 + pos3 + pos4) / 4
This average is the oscillator value, which is plotted and typically oscillates between 0 and 1.
Moving Averages:
Two optional moving averages (MA1 and MA2) of the avg_position can be enabled, calculated using simple moving averages (ta.sma) with customizable lengths (default: 5 and 10).
These can be potentially used for MA crossover strategies.
What Is Being Averaged?
The oscillator (avg_position) is the average of the normalized price positions within the Bollinger Bands across the four selected timeframes. Specifically:It averages the avg_pos values (pos1, pos2, pos3, pos4) calculated for each timeframe.
Each avg_pos is itself an average of the normalized positions of the high, low, and close prices relative to the Bollinger Bands for that timeframe.
This multi-timeframe averaging smooths out short-term fluctuations and provides a broader perspective on the price's position within the volatility bands.
Interpretation:
0.0 The price is at or below the lower Bollinger Band across all timeframes (indicating potential oversold conditions).
0.15: A customizable level (green band) which can be used for exiting short positions or entering long positions.
0.5: The midline, where the price is at the average of the Bollinger Bands (neutral zone).
0.85: A customizable level (orange band) which can be used for exiting long positions or entering short positions.
1.0: The price is at or above the upper Bollinger Band across all timeframes (indicating potential overbought conditions).
The colored regions and moving averages (if enabled) help identify trends or crossovers for trading signals.
Example:
If the 30min timeframe shows the close at the upper band (position = 1.0), the 60min at the midline (position = 0.5), the 240min at the lower band (position = 0.0), and the daily at the upper band (position = 1.0), the avg_position would be:(1.0 + 0.5 + 0.0 + 1.0) / 4 = 0.625
This value (0.625) would plot in the orange region (between 0.85 and 0.5), suggesting the price is relatively strong but not at an extreme.
Notes:
The use of lookahead=barmerge.lookahead_on ensures the indicator uses the latest available data, making it more real-time, though its effectiveness depends on the chart timeframe and TradingView's data feed.
The indicator’s sensitivity can be adjusted by changing bb_length ("Bollinger Band MA Length" in the Input tab), bb_mult ("Bollinger Band Standard Deviation," also in the Input tab), or the selected timeframes.
Changing of the GuardChanging of the Guard (COG) - Advanced Reversal Pattern Indicator
🎯 What It Does
The Changing of the Guard (COG) indicator identifies high-probability reversal setups by detecting specific candlestick patterns that occur at key institutional levels. This indicator combines traditional price action analysis with volume-weighted and moving average confluence to filter out noise and focus on the most reliable trading opportunities.
🔧 Key Features
Multi-Timeframe VWAP Analysis
• Daily VWAP (Gray circles) - Intraday institutional reference
• Weekly VWAP (Yellow circles) - Short-term institutional bias
• Monthly VWAP (Orange circles) - Long-term institutional sentiment
Triple EMA System
• EMA 20 (Blue) - Short-term trend direction
• EMA 50 (Purple) - Medium-term momentum
• EMA 200 (Navy) - Long-term market structure
Adaptive COG Pattern Detection
• 2-Bar Mode: Quick reversal signals for scalping
• 3-Bar Mode: Balanced approach for swing trading (default)
• 4-Bar Mode: Conservative signals for position trading
📊 How It Works
The indicator identifies "changing of the guard" moments when:
1. Pattern Formation: 2-4 consecutive bars show exhaustion in one direction
2. Reversal Confirmation: A counter-trend bar appears with strong momentum
3. Confluence Trigger: The reversal bar crosses through a significant VWAP or EMA level
Bullish COG: Green triangle appears below bars when bearish exhaustion meets bullish reversal at key support
Bearish COG: Red triangle appears above bars when bullish exhaustion meets bearish reversal at key resistance
💡 Trading Applications
Swing Trading: Use 3-bar mode with EMA 50/200 confluence for multi-day holds
Day Trading: Use 2-bar mode with Daily VWAP confluence for intraday reversals
Position Trading: Use 4-bar mode with Monthly VWAP confluence for major trend changes
⚙️ Customization Options
• Toggle VWAP display on/off
• Toggle EMA display on/off
• Toggle COG signals on/off
• Select detection mode (2-bar, 3-bar, 4-bar)
• Built-in alert system for automated notifications
🎨 Visual Design
Clean, professional interface with:
• Subtle dotted lines for VWAPs to avoid chart clutter
• Color-coded EMAs for easy trend identification
• Clear triangle signals that don't obstruct price action
• Customizable display options for different trading styles
📈 Best Practices
• Combine with volume analysis for additional confirmation
• Use higher timeframe bias to filter trade direction
• Consider market structure and support/resistance levels
• Backtest different modes to find optimal settings for your strategy
⚠️ Risk Management
This indicator identifies potential reversal points but should be used with proper risk management. Always consider:
• Overall market trend and structure
• Volume confirmation
• Multiple timeframe analysis
• Appropriate position sizing
Perfect for traders who want to catch reversals at institutional levels with high-probability setups. The confluence requirement ensures you're trading with the smart money, not against it.
VIX > 20/25 HighlightThis indicator tracks the CBOE Volatility Index (VIX) and highlights when volatility exceeds critical thresholds.
Plots the VIX with dashed reference lines at 20 and 25.
Background turns orange when the VIX is above 20.
Background turns bright red when the VIX is above 25.
Includes alert conditions to notify you when the VIX crosses above 20 or 25.
Use this tool to quickly visualize periods of elevated market stress and manage risk accordingly.
Previous High/Low Range (D,W,M)Previous High/Low Range (D,W,M)
This indicator displays the previous period’s High, Low, and 50% Midpoint levels for the Day, Week, and Month. It visually extends these levels into the future for easy reference, helping traders identify key support and resistance zones. Users can customize the visibility, colors, and line styles for each timeframe, and optionally show labels and a dashed midpoint line for clearer analysis. Ideal for trend analysis and spotting potential reversal points.
Projected 65min VolumeThe script provides relative volume for the first 5min candle after its close vs 14 avg and estimates projected volume for the first 65min candle in the trading session vs avg value.
!!!The indicator is designed to work only at 5min TF!!!
Scalping Indicator (EMA + RSI)Buy and Sell Signals. Use with Supply and Demand to find good entries. Do not rely solely on this signal. Monitors with short and long EMA cross along with oversold or overbought RSI.
Fractal Suite: MTF Fractals + BOS/CHOCH + OB + FVG + Targets Kese Way
Fractals (Multi-Timeframe): Automatically detects both current-timeframe and higher-timeframe Bill Williams fractals, with customizable left/right bar settings.
Break of Structure (BOS) & CHoCH: Marks structural breaks and changes of character in real time.
Liquidity Sweeps: Identifies sweep patterns where price takes out a previous swing high/low but closes back within range.
Order Blocks (OB): Highlights the last opposite candle before a BOS, with customizable extension bars.
Fair Value Gaps (FVG): Finds 3-bar inefficiencies with a minimum size filter.
Confluence Zones: Optionally require OB–FVG overlap for high-probability setups.
Entry, Stop, and Targets: Automatically calculates entry price, stop loss, and up to three take-profit targets based on risk-reward ratios.
Visual Dashboard: Mini on-chart table summarizing structure, last swing points, and settings.
Alerts: Set alerts for new fractals, BOS events, and confluence-based trade setups.
Volume/Price Movement Indicator## Volume/Price Movement Indicator (VPM)
The **Volume/Price Movement Indicator (VPM)** is a technical analysis tool designed to identify the strength and potential direction of a trend by combining price momentum with volume analysis. Unlike indicators that only look at price, VPM uses volume as a confirming factor to gauge the conviction behind a price move. This helps traders distinguish between strong, high-conviction trends and weak, low-conviction movements that may be prone to reversal.
***
### Key Concepts
* **Price Trend**: The indicator smooths out daily price changes to determine the underlying trend direction. A positive price trend suggests upward momentum, while a negative trend suggests downward momentum.
* **Volume Analysis**: The VPM calculates a **Volume Ratio**, which compares the current bar's volume to its moving average. A high volume ratio indicates that the current volume is significantly higher than recent average volume, suggesting strong market participation. The **Volume Threshold Multiplier** is used to define what constitutes "high volume."
* **Net Pressure**: This component measures the difference between buying pressure and selling pressure, providing an additional layer of confirmation. Positive net pressure indicates that buying activity is outpacing selling, and vice versa.
***
### How to Use the Indicator
The VPM plots its findings on a histogram below the main chart, using colors to clearly signal the market's state.
* **🟢 Strong Bull (Green)**: This is the most powerful bullish signal. It indicates a clear upward price trend that is confirmed by both high volume and positive net pressure. This is a strong signal of conviction and potential continuation of the uptrend.
* **🔵 Weak Bull (Lime)**: This signal indicates a clear upward price trend, but with low volume. The positive net pressure suggests buying is still dominant, but the lack of high volume means there may not be strong market conviction. This signal suggests caution and may precede a consolidation or reversal.
* **🔴 Strong Bear (Red)**: The strongest bearish signal. It indicates a clear downward price trend confirmed by high volume and negative net pressure. This suggests strong selling conviction and a high probability of the downtrend continuing.
* **🟠 Weak Bear (Orange)**: This indicates a clear downward price trend but with low volume. Negative net pressure confirms selling dominance, but the low volume suggests a lack of strong conviction. Like the "Weak Bull" signal, this suggests caution.
* **⚫ Neutral (Gray)**: This signal is displayed when there is no clear trend or when price and volume are diverging. It's a signal of market indecision and suggests waiting for a clearer signal.
***
### Indicator Settings
* **Trend Length**: This input controls the sensitivity of the price trend calculation. A smaller value will make the indicator more responsive to short-term price changes, while a larger value will filter out noise and focus on longer-term trends.
* **Volume MA Length**: This determines the length of the moving average used as a baseline for volume. A longer length will make the "high volume" condition harder to meet.
* **Volume Threshold Multiplier**: This is a key setting for tuning the indicator. It determines how much higher the current volume must be than its moving average to be considered "high volume." For example, a value of `1.2` means volume must be at least 20% higher than the moving average to trigger a high-volume signal.
Gamma & Max Pain HelperGamma & Max Pain Helper
Plots Call Wall, Put Wall, and Max Pain levels directly on your chart so you can see where options positioning might influence price.
Features:
Manually enter Call Wall, Put Wall, and Max Pain strike prices.
Lines auto-update each bar — no redrawing needed.
Labels display name + strike price.
Option to only show lines near current price (within a % you choose).
Color-coded:
Red = Call Wall (potential resistance)
Green = Put Wall (potential support)
Blue = Max Pain (price magnet into expiry)
Adjustable line width & extension.
Use Case:
Perfect for traders combining options open interest/gamma analysis with price action, pivots, VWAP, and other intraday levels. Quickly spot overlaps between option walls and technical barriers for high-probability reaction zones.
Source-indicatorsSource Indicators – A premium TradingView tool combining automated support/resistance levels, dynamic trendlines, and breakout alerts.
Perfect for spotting key market zones and trend shifts in real-time.
Quant Signals: Market Sentiment Monitor HUDWavelets & Scale Spectrum
This indicator is ideal for traders who adapt their strategy to market conditions — such as swing traders, intraday traders, and system developers.
Trend-followers can use it to confirm trending conditions before entering.
Mean-reversion traders can spot choppy markets where reversals are more likely.
Risk managers can monitor volatility shifts and regime changes to adjust position size or pause trading.
It works best as a market context filter — telling you the “weather” before you decide on the trade.
Wavelets are like tiny “measuring rulers” for price changes. Instead of looking at the whole chart at once, a wavelet looks at differences in price over a specific time scale — for example, 2 bars, 4 bars, 8 bars, and so on.
The scale spectrum is what you get when you measure volatility at several of these scales and then plot them against scale size.
If the spectrum forms a straight line on a log–log chart, it means price changes follow a consistent pattern across time scales (a power-law relationship).
The slope of that line gives the Hurst exponent (H) — telling you whether moves tend to persist (trend) or reverse (mean-revert).
The height of the line gives you the volatility (σ) — the average size of moves.
This approach works like a microscope, revealing whether the market’s behaviour is consistent across short-term and long-term horizons, and when that behaviour changes.
This tool applies a wavelet-based scale-spectrum analysis to price data to estimate three key market state measures inside a rolling window:
Hurst exponent (H) — measures persistence in price moves:
H > ~0.55 → market is trending (moves tend to continue).
H < ~0.45 → market is choppy/mean-reverting (moves tend to reverse).
Values near 0.5 indicate a neutral, random-walk-like regime.
Volatility (σ) — the average size of price swings at your chart’s timeframe, optionally annualized. Rising volatility means larger price moves, falling volatility means smaller moves.
Fit residual — how well the observed multi-scale volatility fits a clean power-law line. Low residual = stable behaviour; high residual = structural change (possible regime shift).
Whaley Thrust — ADT / UDT / SPT (2010) + EDT (EMA) + Info BoxDescription
Implements Wayne Whaley’s 2010 Dow Award breadth-thrust framework on daily data, with a practical extension:
• ADT (Advances Thrust) — 5-day ratio of advances to (adv+dec). Triggers: > 73.66% (thrust), < 19.05% (capitulation).
• UDT (Up-Volume Thrust) — 5-day ratio of up-volume to (up+down). Triggers: > 77.88%, < 16.41%. Defaults to USI:UVOL / USI:DVOL (edit if your feed differs).
• SPT (Price Thrust) — 5-day % change of a benchmark (default SPY, toggle to use chart symbol). Triggers: > +10.05%, < −13.85%.
• EDT (EMA extension) — Declines-share thrust derived from WBT logic (not in Whaley’s paper): EMA/SMA of Declines / (Adv+Decl). Triggers: > 0.8095 (declines thrust), < 0.2634 (declines abating).
• All-Clear — Prints when ADT+ and UDT+ occur within N days (default 10); marks the second event and shades brighter green.
Visuals & Controls
• Shape markers for each event; toggle text labels on/off.
• Optional background shading (green for thrusts, red for capitulations; brighter green for All-Clear).
• Compact info box showing live ADT / UDT / SPT (white by default; turns green/red at thresholds).
• Min-spacing filter to prevent duplicate prints.
Tips
• Use on Daily charts (paper uses 5 trading days). Weekly views can miss mid-week crosses.
• If UDT shows 100%, verify your Down Volume symbol; the script requires both UVOL and DVOL to be > 0.
• Best use: treat capitulations (−) as setup context; act on thrusts (+)—especially when ADT+ & UDT+ cluster (All-Clear).
Credit
Core method from Wayne Whaley (2010), Planes, Trains and Automobiles (Dow Award). EDT is an added, complementary interpretation using WBT-style smoothing.
Quant Signals: Entropy w/ ForecastThis is the first of many quantitative signals I plan to create for TV users.
Most technical analysis (TA) tools—like moving averages, oscillators, or chart patterns—are heuristic: they’re based on visually identifiable shapes, threshold crossovers, or empirically chosen rules. These methods rarely quantify the information content or structural complexity of market data. By quantifying market predictability before making a forecast, this method filters out noise and focuses your trading only during statistically favorable conditions—something traditional TA cannot objectively measure.
This MEPP-based approach is quantitative and model-free:
It comes from information theory and measures Shannon entropy rate to assess how predictable the market is at any moment.
Instead of interpreting price formations, it uses a data-compression algorithm (Lempel–Ziv) to capture hidden structure in the sequence of returns.
Forecasts are generated using a principle from statistical physics (Maximum Entropy Production), not historical chart patterns.
In short, this method measures the market's predictability BEFORE deciding a directional forecast is worth trusting. This tool is to inform TA traders on the market's current regime, whether it is smooth and predictable or it is volatile and turbulent.
Technical Introduction:
In information theory, Shannon entropy measures the uncertainty (or information content) in a sequence of data. For markets, the entropy rate captures how much new information price returns generate over time:
Low entropy rate → price changes are more structured and predictable.
High entropy rate → price changes are more random and unpredictable.
By discretizing recent returns into quartile-based states, this indicator:
Calculates the normalized entropy rate as a regime filter.
Uses MEPP to forecast the next state that maximizes entropy production.
Displays both the regime status (predictable vs chaotic) and the forecast bias (bullish/bearish) in a dashboard.
Measurements & How to Use Them
TLDR: HIGH ENTROPY -> information generation/market shift -> Don't trust forecast/strategy
1. H (bits/sym)
Shannon entropy rate of the last μ discrete returns, in bits per symbol (0–2).
Lower → more predictable; higher → more random.
Use as a raw measure of market structure.
2. H_max (log₂Ω)
Theoretical maximum entropy for Ω states. Here Ω = 4 → H_max = 2.0 bits.
Reference value for normalization.
3. Entropy (norm)
H / H_max, scaled between 0 and 1.
< 0.5–0.6 → predictable regime; > 0.6 → chaotic regime.
Main regime filter — forecasts are more reliable when below your threshold.
4. Regime
Label based on Entropy (norm) vs your entThresh.
LOW (predictable) = higher odds forecast will be correct.
HIGH (chaotic) = forecasts less reliable.
5. Next State (MEPP Forecast)
Discrete return state (1–4) predicted to occur next, chosen to maximize entropy production:
Large Down (strong bearish)
Small Down (mild bearish)
Small Up (mild bullish)
Large Up (strong bullish)
Use as your bias direction.
6. Bias
Simplified label from the Next State:
States 1–2 = Bearish bias (red)
States 3–4 = Bullish bias (green)
Align strategy direction with bias only in LOW regime.
SMI Base-Trigger Bullish Re-acceleration (Higher High)Description
What it does
This indicator highlights a two-step bullish pattern using Stochastic Momentum Index (SMI) plus an ATR distance filter:
1. Base (orange) – Marks a momentum “reset.” A base prints when SMI %K crosses up through %D while %K is below the Base level (default -70). The base stores the base price and starts a waiting window.
2. Trigger (green) – Confirms momentum and price strength. A trigger prints only if, before the timeout window ends:
• SMI %K crosses up through %D again,
• %K is above the Trigger level (default -60),
• Close > Base Price, and
• Price has advanced at least Min ATR multiple (default 1.0× the 14-period ATR) above the base price.
A dashed green line connects the base to the trigger.
Why it’s useful
It seeks a bullish divergence / reacceleration: momentum recovers from deeply negative territory, then price reclaims and exceeds the base by a volatility-aware margin. This helps filter out weak “oversold bounces.”
Signals
• Base ▲ (orange): Potential setup begins.
• Trigger ▲ (green): Confirmation—momentum and price agree.
Inputs (key ones)
• %K Length / EMA Smoothing / %D Length: SMI construction.
• Base when %K < (default -70): depth required for a valid reset.
• Trigger when %K > (default -60): strength required on confirmation.
• Base timeout (days) (default 100): maximum look-ahead window.
• ATR Length (default 14) and Min ATR multiple (default 1.0): price must exceed the base by this ATR-scaled distance.
How traders use it (example rules)
• Entry: On the Trigger.
• Risk: A common approach is a stop somewhere between the base price and a multiple of ATR below trigger; or use your system’s volatility stop.
• Exits: Your choice—trend MA cross, fixed R multiple, or structure-based levels.
Notes & tips
• Works best on liquid symbols and mid-to-higher timeframes (reduce noise).
• Increase Min ATR multiple to demand stronger price confirmation; tighten or widen Base/Trigger levels to fit your market.
• This script plots signals only; convert to a strategy to backtest entries/exits.
5% Canary (per Thrasher) Implements Thrasher’s framework using closing prices and simple, non-optimized thresholds. The study watches for the first 5% decline from the latest 52-week closing high and classifies it:
• 5% Canary: drop occurs in ≤ 15 trading days.
• Confirmed 5% Canary: within 42 trading days of a Canary, there are two consecutive closes below the 200-DMA.
• Buy-the-Dip: the first 5% decline takes > 15 days and 50-DMA > 200-DMA (uptrend).
Includes optional 50/200-DMA plots, clutter-reduction, and alert conditions. This is a signal framework, not a standalone system—pair with your own risk management.
Entropy (Fiedor/Kontoyiannis) - Part 2 of Fiedor's TheoryThis indicator estimates the Shannon entropy of a price series using a Markov chain model of binary returns, following the approach of Fiedor (2014) and Kontoyiannis (1997).
% of Max shows current entropy as a percentage of its theoretical maximum (1 bit for binary up/down moves).
Percentile ranks the current entropy against historical values in the chosen lookback window.
High entropy suggests price movement is less predictable by frequentist models; low entropy implies more structure and predictability.
Use this as an informational oscillator, not a trading signal.
This is a visualization of Part 1 of Fiedor's Theory. The same entropy logic is already embedded in Part 1 however the second pane is a nice reminder of why it works.
EMA band 12/60/150/200EMA band consisting of 12/60/150/200
Specifically for Indian stock market, can be used for other trading scripts after testing.
Best use case : on Daily TF.
Bull run entry criteria, Not bear market or Bottom catching.