ATK / DEF MTF Analysis Chameleon Combo SessionATK / DEF MTF Analysis Chameleon Combo Session is a multi-timeframe market observation and visualization tool designed to examine the broader market environment through several independent analytical dimensions.
Unlike traditional single-indicator analysis, this framework combines **MTF Process, MTF Radar, Test Depth Matrix, MTF Direction, and an independent Chameleon MA** into one structured dashboard.
### Core Components
**MTF Process**
Observes changes in higher-timeframe ADX and RSI conditions and classifies the current market process into different states, from accelerating conditions to sideways or declining conditions.
**MTF Radar**
Combines ADX, RSI, and relative ATR to describe the current level of market activity and volatility.
**Test Depth Matrix**
Divides the selected MTF price range into five relative zones:
* Deep Water
* Mid Water
* Shallow Water
* Shallows
* Dry Zone
This provides a visual representation of where the observed market environment is positioned within its selected range.
**MTF Direction**
Uses EMA structure together with DI+ / DI− relationships to classify the directional condition of the selected timeframe.
**Chameleon MA**
The Chameleon component is independently configured and is **not tied to the MTF timeframe setting**. Its moving-average line changes visual state according to its position within the Test Depth Matrix, creating a dynamic zone-based visual layer.
**MTF Final Result**
Combines the independent MTF Process, Radar, Test Depth, and Direction classifications into a normalized composite score for observing the overall market state.
### Multi-Level Market Observation
The framework separates the market into different analytical levels rather than relying on a single indicator reading.
It allows the user to observe:
**Direction → Process → Activity → Depth → Chameleon State → Composite Market State**
The purpose is to provide a broader contextual view of market conditions and how different analytical dimensions interact with each other.
### User Configuration
The indicator is intentionally configurable.
Users must define their own:
* MTF Timeframe
* Chameleon MA Period
* Test Depth Zone Period
* Display settings
The Chameleon parameters are independent from the MTF configuration, allowing the two analytical layers to be adjusted separately.
Different parameter settings can produce different market classifications, so there is no single configuration intended for all symbols or market conditions.
### Important
This indicator is designed **only for market observation, analysis, and visualization**.
It does not provide tadn recommendations, ent or eit instructions, fiial advice, or forts.
The displayed scores and classifications are mathtical representations based on market data and use-selected parameters.
The indicator does not determine what action should be taken.
Use are responsible for selecting and configuring the relevant parameters for their own analysis.
Indicator

TT-Autotune## TT-Autotune — Machine-Optimized Lorentzian Classification with Live Regime Switching
Most published strategies ship one set of parameters and hope the market
cooperates. TT-Autotune ships six — one per market regime — and each one was
bred, not guessed.
TT-Autotune is a strategy fork of the well-known Machine Learning: Lorentzian
Classification by jdehorty (used under MPL-2.0, full credit to the original
author — the k-nearest-neighbors core with Lorentzian distance is his work).
What we changed is everything around it: how the parameters are chosen, when
they apply, and how the signals become orders.
### The problem with the original defaults
Lorentzian Classification is a brilliant classifier wrapped around ~30 tunable
inputs: neighbor count, lookback depth, five feature slots (RSI / WT / CCI /
ADX with two periods each), kernel regression settings, and four filters.
The published defaults are one point in a 23-dimensional search space,
calibrated by hand, for no particular symbol, on no particular timeframe.
We measured that point. Across 50 crypto perpetual symbols on 15m, 1h, and 4h,
the stock defaults produced a NEGATIVE median walk-forward Sortino (−0.15)
net of fees. Not because the classifier is bad — because one parameter set
cannot fit every market.
### What TT-Autotune does differently
1 — SERVER-BRED PARAMETERS (Sync Code)
Every symbol × timeframe cell is optimized by TensorTrader's deterministic
genetic optimizer: populations of 32 candidate genomes evolved through
tournament selection, blend crossover, and decaying mutation (with fresh Sobol
immigrants every generation so the search never tunnel-visions), for a minimum
of 12 and up to 128 generations. Fitness is not "biggest backtest profit" —
it is walk-forward Sortino on net per-trade ROI after 5 bps fees + 2 bps
slippage, evaluated across 4 sequential out-of-sample folds on a pinned
5,000-bar window, with a consistency penalty (mean fold Sortino minus half its
dispersion). A candidate needs 40+ trades and activity in every fold or it is
discarded as statistically ineligible — no cherry-picked 6-trade miracles.
The winning genome is serialized into a compact Sync Code you paste into one
input field. Thirty parameters, injected at once.
2 — LIVE REGIME SWITCHING
Markets change character; your parameters should too. TT-Autotune embeds the
same six-state regime classifier that runs in TensorTrader's Python engine
(ADX + linear-regression slope + ATR%, with confirmation-bar and minimum-hold
hysteresis so it doesn't flip-flop): BULL_STRONG, BULL_WEAK, BEAR_STRONG,
BEAR_WEAK, SIDEWAYS_QUIET, SIDEWAYS_CHOP. A packed Regime Sync Code carries a
separately-evolved champion for each regime, and the script hot-swaps the
entire parameter set bar-by-bar as the live regime changes. An on-chart chip
panel shows which regime is live, how long it has held, and which regimes have
a deployed champion.
3 — A FIXED NEIGHBOR POOL
The original script scans the OLDEST maxBarsBack bars of whatever history
PulseWire happened to load — so the same settings give different signals
depending on your chart's loaded history. TT-Autotune scans a sliding pool of
the most RECENT maxBarsBack bars, making signals reproducible and matching the
Python simulator the optimizer trains against, bar for bar.
4 — A COMPLETE STRATEGY SHELL
This is a strategy, not an indicator: one alert covers long/short entries and
exits, with optional pyramiding (up to 5 DCA legs across timeframes), ATR-based
stop-loss / take-profit brackets, session and date windows, and three signal
modes (DEFAULT ML entries/exits, KERNEL_RAW, KERNEL_SMOOTH kernel-flip
triggers).
### The receipts
Every optimization run evaluates the stock-default parameter set as a baseline
on the exact same data, fees, folds, and eligibility rules as the candidates.
Publication is fail-closed: a champion is only released if it is statistically
eligible AND strictly beats the eligible default. From the most recent
completed sweep (148 populations, 50 symbols × 15m / 1h / 4h, ~607,000
walk-forward backtests):
- Champion beat the stock default in 148 of 148 populations.
- 136 of 148 cells flipped from a NEGATIVE default walk-forward Sortino to a
positive champion score.
- Median walk-forward fold Sortino: default −0.15 → champion +0.82.
- Median consistency-adjusted improvement: +0.67 aggregate score per cell.
- 825 of 888 per-regime panels produced an eligible regime champion; the rest
honestly report a baseline fallback instead of faking a winner.
Example (HBAR/USDT 4h): default settings scored 0.07 aggregate / +0.23 mean
fold Sortino over 78 trades; the evolved champion scored 0.91 / +1.73 over 66
trades — same window, same fees, same rules.
These are walk-forward backtests net of realistic costs, not live results.
Past performance never guarantees future returns. Trade small, trade paper
first.
### How to arm it
Without a Sync Code the script runs with the stock Lorentzian defaults — fine
for exploring, but you are leaving the entire optimization layer on the table.
To arm TT-Autotune with evolved parameters for your token:
1. Create a free account at tensortrader.agent-swarm.net.
2. Pick a symbol × timeframe cell from the optimized catalog (the free tier
includes one active cell; paid plans scale with your PulseWire alert
quota).
3. The TensorTrader browser extension delivers the packed Regime Sync Codes
into the script's inputs and keeps your alert enrolled and heartbeat-fresh
automatically — when a newer champion is bred for your cell, it rolls out
to you.
The codes are cell-specific on purpose: a champion evolved on HBAR 4h data has
no business trading DOGE 15m. The platform only arms the script for the market
it was actually trained on — that constraint is a feature, not a limitation.
### Credits and license
Original Lorentzian Classification logic © jdehorty, used under the Mozilla
Public License 2.0. TT-Autotune's regime classifier, sync-code system,
sliding neighbor pool, and strategy shell by TensorTrader.
---
## Publication notes (not part of the description)
- PulseWire House Rules require open-source forks of open-source scripts to
credit the original and describe meaningful changes — the sections above do
both explicitly.
- Domain in the description is `tensortrader.agent-swarm.net` (the request
contained a typo, "tnesortrader").
- Figures verified 2026-08-07 against the 148 runs with `results.json`
(admin-646 … admin-793 sweep, asof 2026-07-31). Regenerate with the
aggregation snippet in the chat transcript before republishing if new runs
have landed.
Strategy

DNSE VN301!, Bollinger Bands Break Out Strategy "Bollinger Bands Breakout with SMA Trend Filter" is a volatility breakout strategy designed to capture strong directional price movements when price breaks outside its recent trading range. The strategy uses Bollinger Bands, constructed from an SMA(20) and two standard deviations, to identify bullish breakouts when price closes above the upper band and bearish breakouts when price closes below the lower band.
To improve signal quality, the strategy incorporates an optional SMA(200) trend filter, allowing Long trades only when the SMA is rising and Short trades only when it is falling. By combining volatility-based breakout signals with long-term trend confirmation, the strategy seeks to reduce false breakouts during ranging markets while participating in sustained intraday trends. It also includes configurable stop loss, take profit, trading session filters, automatic end-of-day position closure, and trend reversal exits for disciplined risk management.
Strategy settings and configuration:
Chart timeframe: recommended 5-minute chart
Position size: 3 contracts
Bollinger Bands length: 20
Bollinger Bands multiplier: 2.0
SMA length: 200
Stop loss: 10 points
Take profit: disabled
SMA trend filter: On / Off
Take profit: On / Off
Time filter: On / Off
Trading session: 09:00 – 14:30
Trade direction: Long / Short / Both
Default script settings:
The strategy calculates Bollinger Bands using the SMA(20) of the closing price. The upper and lower bands are created by adding or subtracting two standard deviations around the middle line.
When volatility increases, the Bollinger Bands expand. When the market is quiet or moving sideways, the bands contract.
When the closing price breaks above the upper Bollinger Band, buying pressure may be taking control. When the closing price breaks below the lower Bollinger Band, selling pressure may be taking control.
When the SMA(200) trend filter is enabled, the script only allows Long trades when SMA(200) is rising and only allows Short trades when SMA(200) is falling. When the SMA filter is disabled, the strategy can trade both directions based only on Bollinger Bands breakout signals.
Users can add the built-in Bollinger Bands indicator on PulseWire with Length 20 and Multiplier 2.0 to visually monitor the signal on the price chart.
Entry and exit rules:
Long entry:
Closing price > upper Bollinger Band
AND SMA(200) is rising, if the SMA filter is enabled
AND the signal appears during the trading session
AND trade direction allows Long entries
Long exit:
Stop loss: 10 points from entry price
Take profit: disabled by default
Closing price touches or breaks below the lower Bollinger Band
SMA(200) turns downward, if the SMA filter is enabled
Reversal when a valid Short signal appears
Automatic position close at the end of the trading session
Short entry:
Closing price < lower Bollinger Band
AND SMA(200) is falling, if the SMA filter is enabled
AND the signal appears during the trading session
AND trade direction allows Short entries
Short exit:
Stop loss: 10 points from entry price
Take profit: disabled by default
Closing price touches or breaks above the upper Bollinger Band
SMA(200) turns upward, if the SMA filter is enabled
Reversal when a valid Long signal appears
Automatic position close at the end of the trading session
Risk disclaimer:
Futures trading involves a high level of risk and prices can move sharply. This script is provided for reference, research, and backtesting purposes only. Users should fully understand derivatives trading, their own risk tolerance, and the strategy logic before applying it to live trading.
All investment decisions are the responsibility of the user. phaisinh.online is not responsible for any losses arising from the use of this strategy in real trading. Past performance does not guarantee future results.
____________________________________________________________________
"Bollinger Bands Breakout với Bộ lọc Xu hướng SMA" là một chiến lược giao dịch theo xu hướng dựa trên sự bứt phá của biến động giá, được thiết kế nhằm nắm bắt các chuyển động mạnh theo một hướng khi giá vượt ra khỏi vùng dao động gần nhất. Chiến lược sử dụng Bollinger Bands, được xây dựng từ SMA(20) và 2 độ lệch chuẩn, để xác định tín hiệu mua khi giá đóng cửa vượt lên trên dải trên và tín hiệu bán khi giá đóng cửa xuống dưới dải dưới.
Để nâng cao chất lượng tín hiệu, chiến lược tích hợp bộ lọc xu hướng SMA(200) (có thể bật hoặc tắt), chỉ cho phép mở vị thế Long khi SMA đang dốc lên và vị thế Short khi SMA đang dốc xuống. Bằng cách kết hợp tín hiệu bứt phá theo biến động của Bollinger Bands với xác nhận xu hướng dài hạn, chiến lược hướng tới việc giảm thiểu các tín hiệu phá vỡ giả trong giai đoạn thị trường đi ngang, đồng thời tận dụng các xu hướng intraday kéo dài. Ngoài ra, chiến lược còn bao gồm các tùy chọn Stop Loss, Take Profit, bộ lọc khung thời gian giao dịch, cơ chế tự động đóng toàn bộ vị thế khi kết thúc phiên, cùng với điều kiện thoát lệnh khi xu hướng SMA đảo chiều, nhằm đảm bảo quản trị rủi ro một cách chặt chẽ và có kỷ luật.
Cài đặt & cấu hình chiến lược:
Biểu đồ: khuyến nghị khung 5 phút
Khối lượng giao dịch: 3 hợp đồng
Chu kỳ Bollinger Bands: 20
Hệ số nhân Bollinger Bands: 2.0
Chu kỳ SMA: 200
Cắt lỗ: 10 điểm
Chốt lời: tắt
Bộ lọc xu hướng SMA: Bật / Tắt
Dùng chốt lời: Bật / Tắt
Bộ lọc giờ: Bật / Tắt
Khung giờ giao dịch: 09:00 – 14:30
Chiều giao dịch: Mua / Bán / Cả hai
Cài đặt mặc định của script:
Chiến lược tính toán Bollinger Bands dựa trên đường SMA(20) của giá đóng cửa. Dải trên và dải dưới được tạo bằng cách cộng hoặc trừ hai độ lệch chuẩn quanh đường giữa.
Khi biến động tăng mạnh, hai dải Bollinger Bands sẽ mở rộng. Khi thị trường đi ngang hoặc biến động thấp, hai dải sẽ co hẹp lại.
Khi giá đóng cửa vượt lên trên dải trên Bollinger Bands, lực mua có thể đang chiếm ưu thế. Khi giá đóng cửa phá xuống dưới dải dưới Bollinger Bands, lực bán có thể đang chiếm ưu thế.
Khi bật bộ lọc xu hướng SMA(200), script chỉ cho phép lệnh Mua khi SMA(200) dốc lên và chỉ cho phép lệnh Bán khi SMA(200) dốc xuống. Khi tắt bộ lọc SMA, chiến lược có thể giao dịch cả hai chiều chỉ dựa trên tín hiệu breakout của Bollinger Bands.
Người dùng có thể thêm chỉ báo Bollinger Bands có sẵn trên PulseWire với tham số Length 20 và Multiplier 2.0 để quan sát tín hiệu trực quan trên biểu đồ giá.
Điều kiện vào và thoát lệnh:
Vào lệnh Mua:
Giá đóng cửa > dải trên Bollinger Bands
VÀ SMA(200) dốc lên, nếu bật bộ lọc SMA
VÀ tín hiệu xuất hiện trong khung giờ giao dịch
VÀ chiều giao dịch cho phép lệnh Mua
Thoát lệnh Mua:
Cắt lỗ: 10 điểm từ giá vào lệnh
Chốt lời: không dùng theo mặc định
Giá đóng cửa chạm hoặc phá xuống dải dưới Bollinger Bands
SMA(200) đảo chiều xuống, nếu bật bộ lọc SMA
Đảo chiều khi xuất hiện tín hiệu Bán hợp lệ
Tự động đóng lệnh khi hết khung giờ giao dịch
Vào lệnh Bán:
Giá đóng cửa < dải dưới Bollinger Bands
VÀ SMA(200) dốc xuống, nếu bật bộ lọc SMA
VÀ tín hiệu xuất hiện trong khung giờ giao dịch
VÀ chiều giao dịch cho phép lệnh Bán
Thoát lệnh Bán:
Cắt lỗ: 10 điểm từ giá vào lệnh
Chốt lời: không dùng theo mặc định
Giá đóng cửa chạm hoặc phá lên dải trên Bollinger Bands
SMA(200) đảo chiều lên, nếu bật bộ lọc SMA
Đảo chiều khi xuất hiện tín hiệu Mua hợp lệ
Tự động đóng lệnh khi hết khung giờ giao dịch
Tuyên bố rủi ro:
Giao dịch hợp đồng tương lai có mức độ rủi ro cao và giá có thể biến động mạnh. Script này chỉ phục vụ mục đích tham khảo, nghiên cứu và kiểm thử. Người dùng cần hiểu rõ giao dịch phái sinh, khẩu vị rủi ro cá nhân và logic của chiến lược trước khi áp dụng vào giao dịch thực tế.
Mọi quyết định đầu tư thuộc trách nhiệm của người dùng. phaisinh.online không chịu trách nhiệm cho bất kỳ khoản lỗ nào phát sinh từ việc sử dụng chiến lược này trong giao dịch thực tế. Hiệu quả trong quá khứ không đảm bảo kết quả trong tương lai.
Strategy

Entry Point X500Entry Point X500 is an overlay envelope built on Nadaraya–Watson kernel regression with a Gaussian kernel. It smooths price into a local estimate of the underlying trend, draws volatility bands around that estimate using mean absolute deviation (MAD), and marks mean-reversion events when price interacts with those bands.
What makes it useful
Standard moving averages weight bars with fixed linear or exponential schemes. This script estimates price with a Gaussian kernel: bars closer to the estimation point receive higher weight, which helps reduce noise while still reacting to genuine structure changes.
Two calculation modes are included:
Fixed mode (default, non-repainting) — endpoint-anchored regression using past bars only. Historical bands and signals stay fixed after a bar closes. Use this mode for chart review, backtesting logic, and alerts.
Live mode (repainting) — full-window Nadaraya–Watson smoothing recalculated on every update of the last bar. The envelope can use a symmetrical neighborhood of bars around each point inside the lookback window. This can look smoother and more “responsive” on the current chart, but historical lines and signals may appear, move, or disappear as new data arrives.
How it works
Smoothing — a Gaussian kernel weight is applied across the lookback window to produce a regression estimate of price.
Bands — an envelope is built around the estimate using the mean absolute deviation of price from that estimate, scaled by the Deviation Multiplier. MAD reacts less aggressively to extreme outliers than a standard-deviation band.
Signals
Fixed mode: ▲ when close crosses under the lower band; ▼ when close crosses over the upper band. These mark breakouts into potential oversold/overbought extremes for mean-reversion context.
Live mode: ▲ when price returns inside the envelope from below the lower band; ▼ when price returns inside from above the upper band. These mark the start of a local move back toward the regression estimate.
A status label shows whether Live or Fixed mode is active.
Inputs
Kernel bandwidth — controls smoothness. Lower values follow price more closely; higher values create a slower, smoother filter.
Deviation multiplier — controls envelope width.
Price source — series used for the regression (default: close).
Live mode (repaints) — switches between Live and Fixed calculation. Default is OFF.
Live alert: last N bars — in Live mode, alerts fire only for newly appeared signals within the last N bars, to reduce noise while history is recalculated.
How to use
Use the envelope as a contextual overbought/oversold framework for mean-reversion analysis:
Price outside the bands = stretched relative to the local kernel estimate.
Signals highlight interactions with the bands; they are not standalone trade instructions.
Prefer Fixed mode when validating behavior historically or attaching alerts.
Treat Live mode as a real-time visual aid only, and always assume past signals can change.
Confirm with market structure, levels, volume, or other independent context. Do not trade the triangles alone.
Limitations (important)
Live mode repaints. Historical envelopes and triangles are redrawn on each last-bar update and must not be judged as stable historical signals.
Fixed and Live modes use different estimation methods and different signal rules; results will not match 1:1.
Like any smoothing tool, the script can lag or produce frequent signals in choppy markets, and fewer/later signals when bandwidth or deviation is high.
Non-standard chart types (Heikin Ashi, Renko, etc.) can distort signal interpretation; use standard candlesticks/bars for signal analysis.
Disclaimer
This script is for educational and analytical purposes only and does not constitute financial advice. Past visual behavior does not guarantee future results. Test settings carefully on historical data in Fixed mode before considering any real-money use. Indicator

Regression Trend [MiesOnCharts]Regression Trend - Mies
What it does
This indicator fits a linear regression line to price over a rolling window and draws a corridor around it based on the statistical error of that fit. The corridor is what decides the trend state. As long as price stays inside it, nothing changes. When price closes outside one side, the whole thing flips color and a triangle marks the bar.
The result is a trend line that carries its own tolerance band with it, so you can see at a glance both where the fitted trend sits and how much room price has before the state changes.
How it works
A least squares regression is fitted across the lookback window. That gives the center line.
Around it, the script computes the standard error of the estimate, which is the typical distance between actual price and the fitted line. It comes from the correlation between price and time:
r is the correlation of the source with bar index over the window
residual variance is the price variance scaled by (1 - r²)
the standard error is the square root of that, adjusted for the degrees of freedom of the fit.
This is the part that makes the corridor behave differently from a standard deviation band. The width responds to how well price is actually tracking the trend, not just to raw volatility. A strong, clean trend produces a high correlation, small residuals, and a narrow corridor, so the indicator stays sensitive.
Choppy price that wanders around the line produces a weak fit, a wide corridor, and a much higher bar for triggering a state change. The indicator effectively demands more evidence in exactly the conditions where evidence is thin.
The bands sit at the center line plus and minus a multiple of that standard error. A close above the upper band turns the state bullish, a close below the lower band turns it bearish, and everything in between leaves the previous state untouched. That hysteresis is intentional. It is what stops the indicator from flipping every time price crosses its own mean.
On the chart
Regression line, green when the state is bullish, red when bearish, gray before the first breakout
Upper and lower standard error bands with a light fill between them, colored to match the current state Triangle below the bar when the state flips bullish Triangle above the bar when the state flips bearish.
Display controls to hide the fill, or the bands entirely, if you want a bare trend line
Two alert conditions, one for each direction
Settings
Source sets which series gets fitted. Close is the standard choice. HL2 or a smoothed input will give a calmer line and fewer flips.
Regression Window sets how many bars the fit covers. Shorter windows follow recent structure and react fast. Longer windows describe the broader trend and produce fewer, slower signals. This is the main setting for matching the tool to your timeframe.
SE Band Multiplier controls how far price has to move from the fitted line before the state changes. Lower values tighten the corridor and generate more signals. Higher values require a more decisive break and filter more noise, at the cost of entering later.
Display group toggles the bands and the fill, and adjusts band opacity.
How to use it
The most direct use is as a trend filter. Trade only in the direction the line is colored and treat the opposite flip as your exit or your cue to step aside.
The corridor itself gives you two readable things. Its width tells you how well price is respecting the trend, so a corridor that has narrowed over recent bars means the fit is tightening and the move is orderly. A corridor that has ballooned means the fit has broken down and the state you are looking at is stale. The center line works as a dynamic reference within an established regime, since a pullback toward it is price returning to its own fitted mean rather than to an arbitrary level.
It pairs well with a volume or momentum check. A corridor break tells you the move is statistically unusual relative to the current fit, but it says nothing about whether there is participation behind it.
Behavior worth understanding
The regression is recalculated on every bar, and the corridor plotted on each bar is that bar's own fit. This is a running envelope, not a fixed channel anchored to a pivot, so the bands will look wavier than a manually drawn regression channel. The reference moves with price, which is what keeps the state stable through a sustained run.
Signals are evaluated on the live bar, so a flip can appear and then vanish before the bar closes. Wait for bar close if you need signals that hold.
Limitations
Linear regression assumes price is moving in a straight line across the window, which is never fully true. The fit degrades at sharp reversals and around gaps, and the corridor is slow to acknowledge a turn right after a strong move because that extension is still inside the window. Treat this as a description of current trend structure, not a forecast.
Disclaimer
The indicator provided is not financial advice. Always conduct your own research and consider multiple factors before making trading decisions. Trade at your own risk. Indicator

Indicator

Indicator

Log Regression Regime Channel Log Regression Regime Channel
A market regime, trend quality, price deviation, and directional momentum indicator built around a unified log-linear regression model.
The indicator is designed to evaluate five connected aspects of market behavior:
1. Is the current market statistically directional or neutral?
2. How well does the regression model describe recent price movement?
3. Where is the current price relative to its fitted trend?
4. Does short-term momentum support or oppose the current market regime?
5. Is the underlying regression trend strengthening, cooling, or remaining stable?
The indicator’s primary purpose is to organize several related measurements into one coherent analytical framework.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📐 Core Calculation: Log-Linear Regression
The script applies ordinary least-squares linear regression to the logarithm of closing prices over the selected Regression Length.
The model has the following form:
log(price) = intercept + slope × time
Using logarithmic prices allows the model to analyze proportional price movement rather than absolute movement in price units.
For example, a move from 10 to 11 is treated consistently with a move from 100 to 110 because both represent a 10% change.
After the regression is calculated in logarithmic space, the fitted values are converted back into regular price values using the exponential function.
The model calculates:
• Regression Slope — determines the direction of the fitted trend.
• Regression Intercept — defines the position of the fitted path.
• Residual Standard Deviation — measures the typical distance between observed log prices and the regression model.
• R² — measures how much of the variation in log prices is explained by the fitted trend.
• Fitted Price Values — represent the model values at the beginning and end of the regression window.
Only positive price observations can be used because the logarithm of zero or a negative value is undefined.
The indicator begins displaying the complete model after enough valid historical bars have accumulated.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Residual-Based Regression Channel
The channel width is not calculated from ATR, a fixed percentage, or the standard deviation of raw prices.
It is based on the standard deviation of regression residuals in logarithmic space.
A residual is the difference between:
the observed logarithmic price
and
the logarithmic price fitted by the regression model.
The channel includes:
• Regression Midline — the centerline of the current fitted model.
• Inner Residual Bands — the inner residual-deviation boundaries.
• Outer Residual Bands — the outer residual-deviation boundaries.
• Channel Ribbons — optional shaded areas between the inner and outer boundaries.
Because the boundaries are symmetrical in logarithmic space, they represent proportional deviations from the fitted model.
After conversion back into regular price values, the upper and lower parts of the channel may not appear perfectly symmetrical on a linear price scale.
Difference Between the Two Length Settings
Regression Length determines how many bars are used to calculate the statistical model.
Visible Channel Length determines only how many recent bars are used to draw the current channel.
Changing Visible Channel Length does not change the underlying regression calculation. It changes only the displayed length of the channel.
This separation makes it possible to use a longer model window without drawing the channel across the entire calculation period.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Price Deviation From the Model
Current price deviation is calculated as:
current logarithmic residual ÷ residual standard deviation
The result shows the current price’s distance from the regression model in residual standard deviations.
Price Location
Center — price is close to the fitted regression midline.
Upper — price is above the regression model.
Lower — price is below the regression model.
Deviation Zones
Normal — the absolute deviation remains inside the inner boundary.
Extended — the absolute deviation has reached the inner boundary.
Extreme — the absolute deviation has reached the outer boundary.
The Extended and Extreme states describe price location relative to the current model.
They do not automatically imply that price must reverse. During a strong trend, price may remain elevated or depressed relative to the regression path for an extended period.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Trend Quality and Trend Strength
The market is not classified as Bullish or Bearish from the direction of the regression slope alone.
The regime engine evaluates three characteristics together:
• the direction of the log-regression slope;
• Trend Quality;
• standardized Trend Strength.
Trend Quality
Trend Quality is measured using R² and displayed as a percentage.
R² indicates how consistently the movement of log prices is described by the regression model.
A higher value means that the fitted trend explains a larger proportion of the observed log-price variation.
Trend Strength
Trend Strength is calculated as the total fitted logarithmic movement across the regression window divided by the residual standard deviation.
It measures how large the directional move is relative to the normal dispersion of price around the model.
The value is expressed in residual standard deviations.
Why Both Measurements Are Used
A small but orderly slope and a large but irregular price movement do not represent the same market condition.
Using R² and Trend Strength together allows the indicator to evaluate:
• the consistency of the trend;
• the magnitude of the directional move;
• the amount of residual noise around the model.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔄 Market Regime Hysteresis
The script maintains one of three persistent market states:
🟢 Bullish
The regression slope is positive, while trend quality and strength satisfy the required thresholds.
⚪ Neutral
The conditions for a directional regime are not satisfied or are no longer sufficiently stable.
🔴 Bearish
The regression slope is negative, while trend quality and strength satisfy the required thresholds.
Different thresholds are used to enter a new directional regime and to preserve an existing regime.
Entering a New Regime
A new Bullish or Bearish regime must satisfy the stricter:
• Trend Entry Quality threshold;
• Trend Entry Strength threshold.
Preserving an Existing Regime
Once a directional regime has been established, it may remain active using the lower:
• Trend Exit Quality threshold;
• Trend Exit Strength threshold.
This mechanism is known as hysteresis.
It reduces frequent switching between directional and neutral states when the model measurements fluctuate around a single threshold.
Market Regime changes are committed only after the chart bar is confirmed. The persistent regime state therefore does not change while the current bar is still forming.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Directional Momentum
Current Momentum is not based on a standard RSI, MACD, or moving-average crossover.
It combines two normalized components:
1. Logarithmic Price Velocity
Measures the direction and speed of proportional price changes.
2. Residual-Deviation Velocity
Measures whether price is gaining or losing ground relative to the fitted regression path.
This makes it possible to distinguish between:
• absolute price movement;
• movement relative to the current statistical trend.
Each component is normalized by its own typical absolute movement.
Momentum Score Composition
75% — normalized logarithmic price velocity.
25% — normalized residual-deviation velocity.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧭 Adaptive Momentum Threshold
Momentum is classified using a dynamic threshold.
The script selects the larger of:
• the user-defined Minimum Momentum Threshold;
• the recent standard deviation of Momentum Score multiplied by the Adaptive Noise Multiplier.
When the Momentum Score becomes more unstable, the classification threshold automatically increases.
This helps reduce directional classifications during periods of elevated momentum noise.
Momentum Classification
🟢 Bullish Momentum — Momentum Score is above the positive adaptive threshold.
🔴 Bearish Momentum — Momentum Score is below the negative adaptive threshold.
⚪ Neutral Momentum — Momentum Score remains between the positive and negative thresholds.
Regression Line Color
A green line represents Bullish Momentum.
A red line represents Bearish Momentum.
A neutral-colored line indicates that momentum has not exceeded the adaptive threshold.
The optional Momentum Fill is drawn between the current fitted regression value and its smoothed reference line. Its color follows the current momentum classification.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 Trend Acceleration
Trend Acceleration measures changes in the standardized regression slope.
The regression slope is first divided by the residual standard deviation.
The change in this standardized slope is then:
• smoothed;
• compared with its typical absolute change;
• converted into a normalized acceleration score.
Interpretation During a Bullish Regime
Strengthening — positive acceleration exceeds the selected threshold.
Cooling — negative acceleration exceeds the threshold in absolute terms.
Stable — the change remains within the threshold.
Interpretation During a Bearish Regime
Strengthening — negative acceleration exceeds the selected threshold.
Cooling — positive acceleration exceeds the selected threshold.
Stable — the change remains within the threshold.
Interpretation During a Neutral Regime
Changing — the absolute change in the standardized slope exceeds the threshold.
Stable — the change remains within the threshold.
Trend Acceleration describes changes in the regression trend and is calculated separately from short-term directional momentum.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧩 Market Phase Engine
Market Phase is an interpretation layer that combines three measurements:
• confirmed Market Regime;
• current Current Momentum;
• current Price Deviation.
Market Phase is not a separate independent indicator and does not use an additional hidden calculation.
It describes the current combination of conditions already calculated by the model.
🟢 Bullish Regime Phases
Bullish Overextension — price has reached an extreme upper deviation during a Bullish regime.
Pullback Recovery — price is in the lower part of the channel, while directional momentum has turned Bullish again.
Bullish Pullback — price has moved into the lower part of the channel while short-term momentum remains Bearish.
Trend Continuation — the Bullish regime is supported by Bullish momentum.
Momentum Cooling — the Bullish regime remains active, but current momentum is Bearish.
Bullish Consolidation — the Bullish regime remains active without a clear directional momentum classification.
🔴 Bearish Regime Phases
Bearish Overextension — price has reached an extreme lower deviation during a Bearish regime.
Bounce Rejection — price is in the upper part of the channel, while directional momentum has turned Bearish again.
Bearish Bounce — price has moved into the upper part of the channel while short-term momentum remains Bullish.
Trend Continuation — the Bearish regime is supported by Bearish momentum.
Countertrend Bounce — the Bearish regime remains active, but current momentum is Bullish.
Bearish Consolidation — the Bearish regime remains active without a clear directional momentum classification.
⚪ Neutral Regime Phases
Upper Price Shock — price has reached an extreme upper deviation without an established directional regime.
Lower Price Shock — price has reached an extreme lower deviation without an established directional regime.
Neutral Upward Impulse — Bullish momentum has developed while the market regime remains Neutral.
Neutral Downward Impulse — Bearish momentum has developed while the market regime remains Neutral.
No Clear Trend — neither a directional regime nor a significant momentum impulse is present.
Market Phase labels describe the current combination of model conditions. They should be interpreted together with the underlying regime, momentum, and deviation measurements.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💎 Why These Components Are Combined
Log Regression Regime Channel is not a collection of unrelated indicators placed inside one script.
All major components are derived from, or directly connected to, the same log-regression model.
How the Components Are Connected
• The regression slope provides the directional foundation.
• R² evaluates the quality of the same regression model.
• Residual dispersion defines the width of the channel.
• Residual volatility standardizes Trend Strength.
• The current residual produces the Price Deviation measurement.
• Changes in residual deviation contribute to Directional Momentum.
• Changes in the standardized slope produce Trend Acceleration.
• Regime, momentum, and deviation are combined by the Market Phase engine.
The purpose of this architecture is to express direction, model quality, price location, momentum, and acceleration in compatible terms.
This differs from mechanically combining several independent oscillators that use unrelated formulas and scales.
Core Architectural Features
• a unified log-linear regression model;
• a residual-based channel instead of an ATR or fixed-percentage channel;
• combined evaluation of trend quality and trend strength;
• confirmed-bar regime hysteresis;
• normalized price and residual momentum;
• an adaptive momentum threshold;
• a separate trend-acceleration measurement;
• deterministic Market Phase classification.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🖥️ Dashboard
The dashboard contains six primary measurements.
Market Regime
Displays the confirmed market state:
Bullish, Neutral, or Bearish.
Trend Quality
Displays:
• R² as a percentage;
• standardized Trend Strength.
Price Deviation
Displays:
• whether price is above or below the model;
• the current deviation in residual standard deviations;
• the Normal, Extended, or Extreme deviation zone.
Current Momentum
Displays the current short-term directional momentum:
Bullish, Neutral, or Bearish.
Trend Acceleration
Displays the current regression-trend state:
Strengthening, Cooling, Stable, or Changing.
Market Phase
Displays the current interpretation of the combination of:
• market regime;
• directional momentum;
• price deviation.
The channel boundaries and regime label use the color of the confirmed Market Regime.
The rolling regression line uses the color of Current Momentum.
These colors represent different calculations and should not be interpreted as duplicate classifications.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ Default Settings
Regression Model
Regression Length — 120 bars
The number of bars used to calculate the log-linear regression model.
Visible Channel Length — 100 bars
The number of recent bars used to display the current regression channel.
Residual Channel
Inner Residual Band — 1.0σ
The inner channel boundary, measured in residual standard deviations.
Outer Residual Band — 2.0σ
The outer channel boundary, measured in residual standard deviations.
Regime Detection
Trend Entry Quality — 45% R²
The minimum model quality required to enter a Bullish or Bearish regime.
Trend Exit Quality — 35% R²
The minimum model quality required to preserve an existing directional regime.
Trend Entry Strength — 1.25σ
The minimum standardized trend strength required to enter a directional regime.
Trend Exit Strength — 0.90σ
The minimum trend strength required to preserve the current regime.
Directional Momentum
Momentum Length — 5 bars
The smoothing period used for short-term directional momentum.
Momentum Baseline — 18 bars
The period used to estimate typical price and residual movement.
Momentum Noise Window — 40 bars
The period used to estimate variation in the combined Momentum Score.
Minimum Momentum Threshold — 0.35
The minimum normalized threshold required for a directional momentum classification.
Adaptive Noise Multiplier — 0.30
The multiplier used to increase the momentum threshold when Momentum Score becomes more unstable.
Acceleration Threshold — 0.35
The minimum normalized change in slope required for an acceleration classification.
Built-In Parameter Safeguards
The script automatically controls relationships between dependent settings:
• the outer residual band remains wider than the inner band;
• exit thresholds cannot be stricter than their corresponding entry thresholds;
• Momentum Baseline remains longer than Momentum Length.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔍 How to Use the Indicator
The following sequence provides a structured way to interpret the model.
Step 1. Identify Market Regime
Determine whether the model currently recognizes:
• a Bullish regime;
• a Bearish regime;
• a Neutral environment.
Step 2. Evaluate Trend Quality
Use R² and Trend Strength to assess:
• how consistently price is moving;
• how large the fitted trend is relative to residual noise.
Step 3. Determine Price Location
Price Deviation shows:
• whether price is above or below the regression model;
• whether the deviation is Normal, Extended, or Extreme.
Step 4. Compare Momentum With Market Regime
When regime and momentum point in the same direction, the short-term movement is aligned with the broader statistical regime.
When they point in opposite directions, short-term movement is not supporting the current regime.
Step 5. Evaluate Trend Acceleration
Determine whether the current regression trend is:
• Strengthening;
• Cooling;
• Stable;
• Changing.
Step 6. Use Market Phase as the Combined Context
Market Phase combines regime, momentum, and price location into one descriptive classification.
It is best interpreted as a summary of the current market structure rather than separately from its underlying components.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛠️ How Settings Affect the Model
Regression Length
A longer period generally produces a slower and more stable model.
A shorter period reacts more quickly to price changes but may change market regime more frequently.
Entry Quality and Entry Strength
Higher values require a cleaner and stronger trend before a Bullish or Bearish regime can begin.
Residual Bands
Wider bands require a larger deviation from the regression model before price is classified as Extended or Extreme.
Momentum Thresholds
Higher thresholds reduce the number of Bullish and Bearish momentum classifications.
Acceleration Threshold
A higher threshold reduces the number of Strengthening, Cooling, and Changing classifications.
Settings should be evaluated in relation to the selected instrument, timeframe, and market behavior.
The default values provide a general starting point and are not optimized for every market or timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ Real-Time Behavior and Limitations
The visible channel represents the latest calculated regression model.
Its boundaries, slope, and shaded areas update as new market data becomes available. The current channel should therefore not be interpreted as a fixed historical object that existed in exactly the same position in the past.
The rolling regression line stores, on each historical bar, the value calculated from the information available at that time.
The Following Values Can Change on an Open Bar:
• regression-model values;
• residual-channel position;
• Price Deviation;
• Current Momentum;
• Trend Acceleration;
• Market Phase.
Market Regime changes only after the bar has been confirmed.
The script does not use future data or lookahead calculations.
However, log regression is sensitive to the selected calculation window.
The model can be materially affected by:
• large price gaps;
• sudden price movements;
• structural market changes;
• low liquidity;
• changes in volatility;
• the selected instrument and timeframe.
The indicator is an analytical tool. Its measurements should be considered together with independent market analysis, risk management, and the characteristics of the selected trading instrument. Indicator

Fast RSI Divergence at VWAP Signals# Fast RSI Divergence at VWAP Signals
Fast RSI Divergence at VWAP Signals is designed to identify early bullish and bearish RSI divergences while combining them with VWAP Standard Deviation bands to help highlight potential areas of price exhaustion.
Unlike traditional pivot-based divergence indicators that require multiple bars of confirmation, this script uses a dynamic reference-point approach. This allows divergences to be detected earlier while providing optional candle-close confirmation for traders who prefer additional validation.
## Features
• Fast bullish and bearish RSI divergence detection
• Dynamic reference-point algorithm instead of delayed pivot confirmation
• Daily anchored VWAP with configurable Standard Deviation bands
• Optional VWAP deviation filter
• Choice of wick-based or close-based divergence detection
• Optional candle-close confirmation
• Optional RSI momentum turn confirmation
• Optional candle direction confirmation
• Adjustable cooldown between consecutive signals
• Optional display of divergence reference points
• Built-in BUY and SELL alerts
## How It Works
The indicator continuously monitors RSI for overbought and oversold conditions.
When RSI reaches an extreme, a reference point is created. Instead of waiting for a confirmed pivot, the script immediately compares subsequent price action against that reference.
A bearish divergence is detected when:
• Price makes a higher high
• RSI forms a lower high
A bullish divergence is detected when:
• Price makes a lower low
• RSI forms a higher low
Additional filters can be enabled to require:
• Price touching or closing outside the selected VWAP Standard Deviation band
• RSI beginning to reverse direction
• Confirmation from candle direction
• Candle-close confirmation before the signal becomes final
After each confirmed signal, the reference point is automatically updated to prevent repeated signals from the same price movement.
## Recommended Usage
This indicator is designed to work best as part of a confluence-based trading approach rather than as a standalone signal generator.
For additional confirmation, it is recommended to use it together with **Bollinger Bands**. Confluence between RSI divergence, VWAP Standard Deviation extremes, and Bollinger Band extremes can help identify areas where price may be statistically extended.
Examples of higher-confluence setups include:
• Bullish RSI divergence occurring near both the lower VWAP Standard Deviation band and the lower Bollinger Band.
• Bearish RSI divergence occurring near both the upper VWAP Standard Deviation band and the upper Bollinger Band.
Additional confirmation from market structure, trend direction, support and resistance, or volume analysis may further improve trade selection.
## Inputs
The indicator provides extensive customization, including:
• RSI Length
• Overbought and Oversold Levels
• Maximum Divergence Lookback
• Minimum RSI Difference
• Minimum Price Extension
• VWAP Standard Deviation Multipliers
• Wick or Close Validation
• Candle Close Confirmation
• RSI Turn Confirmation
• Candle Direction Confirmation
• Signal Cooldown
• Display Options
## Alerts
Two alert conditions are included:
• Fast RSI Divergence BUY
• Fast RSI Divergence SELL
These alerts can be used with PulseWire's alert system or external automation.
## Notes
This indicator is intended to highlight potential momentum exhaustion near statistically extended price levels. Divergence signals indicate that momentum and price are no longer moving in sync, but they do not necessarily imply an immediate reversal.
As with any technical analysis tool, signals should be interpreted within the broader market context. No indicator can predict future price movements with certainty.
Indicator

Indicator

Apex Turn v4APEX TURN v4: Kalman Snapback with Fee Gate, Trend Guard and Fair Value Take Profit
Apex Turn is a mean reversion tool that hunts exhausted moves and trades the snap back to fair value. It was designed for crypto perpetual futures but works on any liquid market.
HOW IT WORKS
The script runs an adaptive Kalman filter on log price to estimate fair value, drawn as the orange line. The gap between price and fair value is normalized into a z score over a rolling window. When the z score stretches beyond the entry threshold (2.8 by default) and then hooks back toward the mean while still deeply stretched, the engine looks to trade against the extreme. Longs trigger at washed out lows and shorts trigger at blow off highs.
THREE GATES PROTECT EVERY SIGNAL
Gate one is the chop filter. The Kaufman Efficiency Ratio must confirm a ranging market before any mean reversion entry is allowed.
Gate two is the fee gate. The script projects the reward from current price to fair value, converts your maker and taker fees into R units based on the stop distance, and blocks any signal that would not cover all fees plus a minimum net gain of 0.35R. Blocked signals print as small gray crosses so you can see exactly what fees would have eaten.
Gate three is the strong trend guard. Fair value drift is measured in ATR per bar. When drift is strong, counter trend signals are suppressed until the market prints a release event: a momentum divergence on the z score, volume absorption at the extreme, or both together depending on the mode you select. Trend blocked signals print as orange squares and release events print as aqua diamonds.
EXITS
On entry the script freezes the current fair value as the take profit target, plotted in green, and places the stop in red at 1.5 ATR from entry. The default exit mode assumes you rest a reduce only limit order at the target so your winning exit pays the lower maker fee. Mean touch and overshoot exit modes are also included in the settings. A time stop closes stale positions after 45 bars.
ADAPTIVE ATR
The ATR length is anchored to real time rather than a fixed bar count. It always measures roughly 112 minutes of volatility, so stops, targets and fee math stay consistent whether you chart 30 seconds or 4 hours.
ALERTS
Four webhook ready alerts are included. Entry alerts carry the close price, the stop, the frozen take profit and the projected net R, so an automated system can place the full bracket the moment a position is born. Exit alerts fire for stop, target and time stop events.
SUGGESTED USE
Developed and tested for the 8 minute chart on liquid perpetual pairs. The 30 minute and 1 hour charts also suit the logic well. Timeframes under 5 minutes are not recommended because trading fees consume most of the edge there. Set the maker and taker fee inputs to match your own exchange tier before trusting the fee gate.
Signals are evaluated at bar close and do not repaint. Nothing in this script is financial advice and past behavior in testing does not guarantee future results. Always size positions responsibly and manage your own risk. Indicator

[Quadapt] Machine Learning Trader Machine Learning Trader
A multi-component Pine Script v6 trading assistant combining a kernel-regression MLMA trend model, dual-length signal envelopes, order block context, retest scoring, adaptive Fibonacci targets, stop loss projection, signal quality filtering, and optional webhook automation.
## Description
Machine Learning Trader is a full-featured market structure and signal confluence indicator built around a Machine Learning Moving Average (MLMA) trend model. It is designed to help traders analyze trend direction, signal quality, order block context, potential retest areas, and adaptive take-profit / stop-loss levels from one chart overlay.
The script is not a black-box strategy or a guaranteed signal generator. It is a discretionary analysis tool that combines several independent market-context modules into one workflow so traders can compare trend, volatility, structure, momentum, and risk levels before making a decision.
### What Makes This Script Different
The core of the indicator is a kernel-regression MLMA engine. Instead of using only a classic moving average, the script builds a regression-style trend estimate using configurable kernel functions and regression modes. This produces a smoothed adaptive trend line and cloud that can be used as a directional context filter.
The MLMA is combined with:
- dual-length nonlinear signal envelopes,
- market structure and order block detection,
- intelligent retest scoring,
- adaptive Fibonacci take-profit projection,
- stop-loss projection,
- multi-timeframe MLMA trend alignment,
- signal quality filtering,
- clustering prevention,
- market regime adaptation,
- optional webhook payload generation.
The result is a confluence-focused indicator: a buy or sell marker is not treated as useful by itself. It is evaluated against the MLMA trend, recent order blocks, volatility regime, momentum, volume, cloud position, and multi-timeframe alignment.
### MLMA Trend Engine
The MLMA module calculates a machine-learning-inspired moving average using kernel methods. The script supports several kernel types, including:
- RBF,
- Linear,
- Polynomial,
- Sigmoid,
- Laplacian,
- Matern,
- Periodic,
- Trigo.
The regression mode can be configured as:
- GPR,
- KRR,
- KPCR,
- SVR,
- Kernel Smoothing,
- Adaptive RQ.
The MLMA output forms the main trend reference. The script also builds upper and lower MLMA bands using an error envelope derived from average absolute deviation around the MLMA output. These bands are used for the cloud, trend state, signal validation, and context scoring.
When the MLMA state is bullish, the script treats price behavior above or near the bullish support side of the cloud as more constructive. When the MLMA state is bearish, the script treats price behavior below or near the resistance side of the cloud as more defensive.
### Instrument-Agnostic Envelope Logic
The signal envelope section is designed to work across instruments with very different price scales, including forex pairs, JPY pairs, metals, oil, gas, indices, and crypto. The nonlinear envelope transform keeps the original algorithmic shape, but price distance is normalized relative to the instrument's local price level before the transform and restored back into price units afterward.
This matters because a raw price move on EURUSD, GBPJPY, XAUUSD, or XNGUSD has a very different numerical size. Normalizing the envelope distance helps the signal engine behave more consistently across instruments instead of being tuned only for one price scale.
### Dual-Length Signal Engine
The script calculates two separate signal envelopes:
- Primary Length: the slower, broader signal model.
- Secondary Length: the faster signal model.
The dual-length system can run in three modes:
- Independent: either length can produce a signal.
- Consensus: both lengths must agree.
- Primary Priority: only the primary length drives the final signal.
This allows traders to choose between sensitivity and confirmation. Independent mode produces more signals, consensus mode is stricter, and primary priority keeps the chart focused on the slower model.
Signal labels can show regular and stronger buy/sell conditions. When both lengths align in Independent mode, the script can also mark BOTH signals.
### Order Block Detection
The order block module searches for volatility-based bullish and bearish blocks using candle direction, volatility expansion, momentum, optional volume confirmation, and trend alignment. Blocks can be displayed as chart boxes with volume and quality information.
Order block detection includes configurable controls for:
- volatility method,
- volatility length,
- smoothing length,
- minimum separation between blocks,
- maximum blocks per direction,
- consolidation filtering,
- trend filtering,
- volume filtering,
- momentum filtering,
- block display style.
The script assigns order block quality using factors such as block size, directional pressure, displacement, market structure, MLMA trend context, and volume. Higher-quality blocks can be emphasized while weaker blocks can be faded.
### Retest Detection
The retest engine evaluates whether price has returned to a recent order block in a meaningful way. Retests can be scored using:
- block strength,
- clean movement away from the block,
- volume confirmation,
- MLMA trend alignment,
- volatility regime,
- reaction quality near the block.
Retest labels can be displayed as simple `R` markers. Strong and weak retests can be controlled separately, and optional percentage display can show the retest confidence score.
### Adaptive Fibonacci Take Profit Levels
The script can project take-profit levels after valid buy or sell signals. The TP engine supports several methods:
- Dynamic ATR,
- Swing-Based,
- Adaptive Swing,
- Heuristic.
It can display multiple Fibonacci extension targets, optional confluence zones, and TP hit status. The TP table shows the current trade direction, entry reference, target levels, stop loss, and active status.
The TP logic is filtered through MLMA and order block context. For example, a buy signal is considered valid when MLMA context supports the buy, or when price is near a supportive bullish order block. This helps reduce target plotting during low-quality or conflicting conditions.
### Stop Loss Projection
The stop-loss module supports:
- ATR-based stops,
- swing-based stops,
- order-block-based stops,
- percentage-based stops.
Stop levels are plotted only after a valid trade setup is detected. The script also tracks whether price has reached the projected stop or take-profit levels.
### Signal Quality Engine
The signal quality engine scores buy and sell setups before final display. The quality score considers:
- MLMA trend context,
- price position relative to the MLMA,
- multi-timeframe alignment,
- order block support or opposition,
- volume quality,
- volatility regime,
- candle body behavior,
- momentum,
- choppy or no-trade conditions,
- cloud width and MLMA slope,
- recent loss-streak penalty logic.
Signals below the configured minimum score can be filtered out. If desired, rejected signals can also be displayed for research and tuning.
### Advanced Signal Filtering
The script includes adaptive clustering prevention and regime-aware filtering.
Clustering prevention reduces repeated signals in the same area by using a time window, ATR-based price window, decay factor, and maximum cluster count.
Regime-aware filtering adjusts confidence behavior using recent market context, including price movement, volatility trend, and volume trend. This helps the script respond differently in ranging, trending, quiet, and volatile periods.
### Multi-Timeframe Trend Table
The MLMA trend table summarizes the current trend state and several higher/lower timeframe states:
- current chart,
- 15m,
- 30m,
- 1H,
- 4H,
- 1D,
- 1W.
This table is useful for quickly checking whether the current signal is aligned with broader market direction.
### Market Exhaustion
The exhaustion module uses RSI, price extension, momentum change, and volume behavior to identify possible bullish or bearish exhaustion. Exhaustion markers are intended as context warnings, not standalone reversal signals.
### Webhook Automation
Optional webhook alerts can send structured payloads for external automation or journaling. The payload can include:
- symbol,
- ticker ID,
- timeframe,
- event type,
- action,
- account tag,
- risk percent,
- order type,
- entry,
- stop loss,
- TP levels,
- quality score,
- MLMA trend,
- bar time.
Webhook use is optional and should be tested privately before live use.
### Alerts Included
The script includes alert conditions for:
- ML Strong Buy Signal,
- ML Strong Sell Signal,
- ML Buy Signal,
- ML Sell Signal,
- rejected quality signals,
- wedge pattern,
- BOTH length signal,
- bullish order block,
- bearish order block,
- bullish exhaustion,
- bearish exhaustion,
- valid enhanced Fibonacci buy/sell signals,
- invalid buy/sell signals,
- Fibonacci TP hit,
- TP/SL levels set,
- order block retest,
- signal clustering,
- market regime change,
- advanced filtering active.
### How To Use
1. Add the indicator to a clean chart.
2. Start with the default settings.
3. Use the MLMA cloud and trend table to understand directional context.
4. Watch for buy/sell labels only when they align with trend, order block, and quality context.
5. Use order block boxes and retest markers to identify possible reaction zones.
6. Use TP/SL projections as planning references, not as automatic trade instructions.
7. Tune Primary Length, Secondary Length, Signal Mode, and Signal Quality settings for the instrument and timeframe you trade.
8. If using alerts or webhooks, test them on paper or in a private environment first.
### Practical Notes
- Lower lengths are more responsive but can produce more noise.
- Higher lengths are smoother but react later.
- Consensus mode is stricter than Independent mode.
- The Signal Quality Engine can remove many low-context signals.
- The Order Block module is most useful when combined with MLMA trend context.
- TP and SL levels are projections based on the selected method; they are not guarantees that price will reach those levels.
- Exhaustion markers are context warnings and should be confirmed with structure, trend, and volatility.
### Limitations
This indicator does not predict the future. It organizes market context using mathematical filters, kernel regression, volatility logic, order block heuristics, and signal-quality rules. It can still produce false signals, especially during news events, illiquid periods, low-volume sessions, strong trend exhaustion, sudden reversals, or choppy markets.
No indicator should be used alone. Traders should combine this tool with their own risk management, market understanding, and independent confirmation. Past chart behavior does not guarantee future results.
Indicator

Supply and Demand Zones with Market Structure [Jayadev Rana]Overview
This open-source overlay draws two closely related price-action concepts on a single chart: swing-based supply and demand zones, and market-structure mapping (swing labels, a zig-zag of confirmed swings, and Break of Structure markers). It is a visual analysis aid. It does not generate buy or sell signals, it does not place orders, and it makes no performance claim.
How swings are detected
Every element in the script is anchored to a confirmed swing pivot. Swings are found with symmetric pivots: a swing high requires its high to be the highest of the N bars on its left and the N bars on its right (and the mirror condition for a swing low), where N is the Swing High/Low Length input. Because a pivot needs N bars on both sides to exist, it is only confirmed N bars after the pivot bar. Once a swing is confirmed, its label, zone and zig-zag segment are fixed to that historical bar and do not move or repaint afterwards. The trade-off of this method is a fixed N-bar delay before a swing becomes visible. This is inherent to symmetric pivots and is disclosed here so the behavior is clear.
Supply and demand zones
When a swing high is confirmed, a supply zone is drawn from that swing high down to the top of the swing candle's body. When a swing low is confirmed, a demand zone is drawn from that swing low up to the bottom of the swing candle's body. This anchors each zone on the candle that produced the turning point. Because wick-only zones can be very thin, an optional ATR floor (on by default) gives each zone a minimum thickness equal to a configurable multiple of the 14-period ATR, so zones stay readable across different instruments and timeframes.
Each zone extends to the right until it is mitigated. A supply zone is treated as mitigated when price closes above it; a demand zone when price closes below it. On mitigation the zone is either removed or greyed out, depending on the When a zone is broken input. To respect the platform limit of 500 drawing objects and to keep the chart readable, only the newest N zones per side are retained (the Zones to keep per side input).
Market structure
Swing labels: each confirmed swing is labelled relative to the previous same-side swing. Highs are marked HH (higher high) or LH (lower high); lows are marked HL (higher low) or LL (lower low). Bullish structure (HH, HL) uses the bullish colour and bearish structure (LH, LL) uses the bearish colour.
Zig-zag: consecutive confirmed swings are joined by a line, giving a de-cluttered skeleton of price movement.
Break of Structure (BOS): the most recent confirmed swing high and swing low are tracked as reference levels. The first time price closes above the reference swing high a BOS is marked, and the mirror for a close below the reference swing low. Each level is marked only once.
Dashboard
An optional table in the top-right corner shows the current swing length, the number of active supply and demand zones, and the direction of the last Break of Structure.
Inputs
Structure and Swings: swing length, and toggles for the zig-zag, the swing labels and the BOS markers.
Supply and Demand Zones: master toggle, zones to keep per side, the ATR minimum-thickness option and multiplier, broken-zone handling (remove or grey out), and the right-extension toggle.
Colors: independent fill and border colours for supply, demand and broken zones, the zig-zag colour, and the bullish and bearish structure colours.
Dashboard: show or hide the summary table.
Alerts
Alert conditions are provided for a bullish BOS, a bearish BOS, a new supply zone, and a new demand zone.
How to use it
Supply and demand zones are commonly read as areas where price may react, while market structure (the sequence of HH, HL, LH, LL and BOS events) describes the prevailing trend and its changes. Reading the two layers together, for example a demand zone that coincides with bullish structure or a supply zone that coincides with bearish structure, is one way traders use this kind of tool. This script only draws the levels and the structure. It does not tell you when to enter or exit, and any decision you make is your own.
Originality and scope
This is an original implementation written from scratch. The underlying ideas, namely pivot-based swing detection, supply and demand zones, higher-high and lower-low structure labelling, and break of structure, are long-established public-domain price-action concepts rather than the property of any single author. The purpose of this publication is to combine them into one coherent, fully configurable, non-repainting overlay with readable code and a compact summary dashboard.
Limitations and disclaimer
Swings, and everything derived from them, appear with a fixed N-bar confirmation delay. This is by design and is not an error.
Zone mitigation is evaluated on bar close. On the developing (last) bar, states can still change until the bar closes.
Past behaviour of price around a zone or a structure point does not predict future results. This tool is for education and analysis only and is not financial advice. Test any approach yourself before relying on it. Indicator

RichmondHillCM - Log-Price Regression Channel V1.2RichmondHillCM - Log-Price Regression Channel V1.2
An OLS linear regression fitted to the logarithm of price, with standard-deviation bands (±1σ / ±2σ / ±3σ) projected around the fitted mean. Because the fit is done in log-space, the channel is geometric — it scales proportionally across very different price levels, which makes it well suited to long-trending instruments like SPY where a raw-price channel would distort.
⚠️ Designed for the WEEKLY (1W) timeframe. The default 252-bar lookback (~5 years of weekly data) and the band logic are tuned for weekly candles. A live banner at the top of the stats table turns red whenever the chart is not on a weekly timeframe.
Features
Log-space regression mean + ±1σ/±2σ/±3σ bands with optional fills
BUY / SELL labels on ±2σ crosses, optional STRONG BUY / SELL on ±3σ
Stats table: each band's price, % distance from current price, and Z-score
Background shading when price is stretched beyond ±2σ / ±3σ
Built-in alert conditions for every band cross and the mean
How to use
Best suited to long-term growth compounders like Google (GOOGL, SPY, NDX). Use it on the weekly (1W) timeframe and set your price axis to logarithmic scale for the bands to line up correctly.
Instrument: growth compounders / steady long-term trenders (e.g. GOOGL, MSFT, SPY)
Timeframe: weekly (1W)
Price axis: log scale (right-click the axis → "Logarithmic")
How to read it: price drifting toward ±2σ/±3σ is unusually far from its own trend; the bands act like a statistical rubber band. Use band touches as context, not standalone entries.
For research and educational purposes only. Not financial advice. Indicator

Adaptive Daytrade SignalThis is an adaptive day trading signal that analyzes market conditions using ADX+EMA; in trending markets, it automatically switches to VWAP+EMA to follow the trend on pullbacks, and in ranging markets, it switches to RSI + Bollinger Bands for counter-trend trading.
Recommended timeframes: 3- to 15-minute charts; Instruments: Nikkei 225 futures, S&P 500; for individual stocks, high-volume large-cap stocks; Session restrictions: For individual stocks, it’s effective to wait and see for the first 30 minutes after the open (adjust using “Limit to session”)
The key feature is that it automatically assesses market conditions and switches trading strategies accordingly. The chart background color lets you see the current market phase at a glance (green = uptrend, red = downtrend, gray = range-bound).
In trending phases (trend-following), the system waits for pullbacks or retracements to the EMA9 and enters only when the price is moving in the same direction as the VWAP. This is a classic approach in stock day trading and offers a good balance between win rate and potential profit.
In ranging phases (counter-trend), the system targets rebounds at the outer bands of the Bollinger Bands combined with RSI overbought conditions. Since attempting to follow the trend when there is no clear trend can result in being caught in a round-trip loss, the system automatically switches to this strategy when the ADX is weak.
In line with our opportunity-focused risk management policy, we set stop-losses relatively tight (based on the most recent swing or ATR × 1.0) and use a two-tiered profit-taking strategy: TP1 (1R) as a target for partial profit-taking, and TP2 (2.5R) to let profits run. Stop-loss and profit-taking lines are automatically displayed on the chart.
Since all parameters are adjustable, by adjusting the two settings—ADX trend threshold (trend detection sensitivity) and Volume vs. avg (volume filter)—you can balance the frequency of signals between prioritizing opportunities and prioritizing accuracy.
This indicator is calculated based on closing price candlesticks and does not use `request.security`, so there is no risk of repainting. However, signals are confirmed once the candlestick closes, and labels are displayed after the candlestick closes. Indicator

RSI Trendlines and Divergences with alertsRSI TRENDLINES AND DIVERGENCES
OVERVIEW
An all-in-one RSI toolkit that combines four independent analytical layers in a single indicator: automatic trendlines drawn on the RSI itself, automatic support/resistance trendlines on price, classic pivot-based RSI divergence, and a separate regression-based divergence engine. Instead of stacking several scripts, you get a coordinated set of momentum and structure tools that can confirm one another.
WHAT IT DOES
1. RSI Trendlines (oscillator pane)
Detects pivot highs and pivot lows directly on the RSI line and connects consecutive pivots into dynamic trendlines. Descending lines off RSI peaks act as momentum resistance; ascending lines off RSI troughs act as momentum support. A tolerance band (in RSI points) is drawn around each line and filled, and a break is only flagged when RSI crosses the line beyond that tolerance — which filters out noise. Counter-direction lines (for example, a rising line off highs) are automatically discarded, so only meaningful trendlines stay on the pane.
2. Price Trendlines (main chart)
The same pivot-to-pivot logic applied to price highs and lows, drawn as support and resistance lines directly on the price chart. Breaks use a percentage-based tolerance to reduce false signals, and optional up/down triangle labels mark confirmed breakouts.
3. Pivot Divergence
Classic regular divergence between price and RSI. A lower low in price against a higher low in RSI marks bullish divergence; a higher high in price against a lower high in RSI marks bearish divergence. Detection is limited to a recent window so stale readings are ignored, and results are shown as connecting lines and Bull/Bear labels on the RSI.
4. Regression Divergence (independent method)
A separate, math-driven divergence engine that fits a least-squares linear regression to both RSI and price over a configurable window. When the two regressions slope in opposite directions, and the move clears a minimum magnitude filter, a regression divergence is flagged with lines on both the RSI and the price, plus optional labels. Because it does not rely on pivots, it often catches divergences the pivot method misses, and vice versa.
SETTINGS
- RSI Settings: RSI length, signal SMA length, and source.
- Pivot Settings (Trend): left/right pivot bars, line extension after the 2nd pivot, break tolerance, and max trendlines per type. All lines share PulseWire's 500-line budget, so the trendline and regression limits are balanced against each other.
- Price Trendline Settings: independent pivot bars, extension, and a percentage-based break tolerance.
- Divergence Settings: enable/disable plus pivot length for the classic method.
- Regression Divergence: window length, minimum RSI slope, line and label toggles, number of stored line pairs, and colors.
- Style Settings: full color and transparency control for every element on both the RSI pane and the price chart.
ALERTS
Ready-made alert conditions for: bullish and bearish pivot divergence, upper and lower RSI trendline breaks, price resistance and support breaks, and regression bullish and bearish divergence.
HOW TO USE
Use the trendline breaks to time momentum shifts, the price trendlines for structural support and resistance, and treat agreement between the two divergence engines as stronger confluence. Combine these signals with your own market-structure and trend context — the tools highlight conditions, they are not standalone buy or sell calls.
CREDITS
Built on the RSI trendline concept by Uncle_the_shooter. The regression-divergence module is adapted from faytterro's "RSI Divergence." Thanks to both authors.
This script is for educational and informational purposes only and is not financial advice. Test on your own data and always manage risk.
Indicator

Indicator

Sistema Swing Completo (Konkorde + MAs + Fibo)// This source code is subject to the terms of the Mozilla Public License 2.0
//@version=6
indicator("Sistema Swing Completo (Konkorde + MAs + Fibo)", overlay=false)
// =====================================================================
// 1. KONCORDE (VOLUMEN DE BALLENAS VS MINORISTAS)
// =====================================================================
// Cálculo de PVI (Minoristas) y NVI (Ballenas)
var float pvi = 1000.0
var float nvi = 1000.0
if bar_index > 0
pvi := volume > volume ? pvi + ((close - close ) / close ) * pvi : pvi
nvi := volume < volume ? nvi + ((close - close ) / close ) * nvi : nvi
// Oscilación de Minoristas (Manos Débiles)
pvim = ta.ema(pvi, 15)
pvimax = ta.highest(pvim, 90)
pvimin = ta.lowest(pvim, 90)
minoristas = (pvi - pvim) * 100 / math.max(pvimax - pvimin, 1)
// Oscilación de Ballenas (Manos Fuertes)
nvim = ta.ema(nvi, 15)
nvimax = ta.highest(nvim, 90)
nvimin = ta.lowest(nvim, 90)
ballenas = (nvi - nvim) * 100 / math.max(nvimax - nvimin, 1)
plot(minoristas, color=color.new(color.green, 40), style=plot.style_area, title="Volumen Minorista (Verde)")
plot(ballenas, color=color.new(color.blue, 20), style=plot.style_area, title="Volumen Ballenas (Azul)")
// =====================================================================
// 2. INDICADOR DE MOMENTUM (MACD)
// =====================================================================
= ta.macd(close, 12, 26, 9)
escala_momentum = 5 // Multiplicador para igualar la escala del Konkorde visualmente
color_hist = hist > hist ? color.new(color.orange, 0) : color.new(color.red, 0)
plot(hist * escala_momentum, color=color_hist, style=plot.style_columns, title="Momentum (Columnas)")
hline(0, color=color.gray, linestyle=hline.style_dashed)
// =====================================================================
// 3. MEDIAS MÓVILES CONFIGURABLES (Proyectadas al gráfico superior)
// =====================================================================
len1 = input.int(9, title="Longitud EMA 1")
len2 = input.int(21, title="Longitud EMA 2")
len3 = input.int(50, title="Longitud EMA 3")
ema1 = ta.ema(close, len1)
ema2 = ta.ema(close, len2)
ema3 = ta.ema(close, len3)
// El uso de force_overlay=true envía estas líneas a las velas japonesas
plot(ema1, color=color.new(color.yellow, 0), linewidth=2, title="EMA Rápida", force_overlay=true)
plot(ema2, color=color.new(color.white, 0), linewidth=2, title="EMA Media", force_overlay=true)
plot(ema3, color=color.new(color.purple, 0), linewidth=2, title="EMA Lenta", force_overlay=true)
// =====================================================================
// 4. RETROCESO DE FIBONACCI (Proyectado al gráfico superior)
// =====================================================================
fibo_lookback = input.int(100, title="Periodo para Fibonacci")
hh = ta.highest(high, fibo_lookback)
ll = ta.lowest(low, fibo_lookback)
diff = hh - ll
plot(hh, color=color.new(color.red, 50), title="100% (Máximo)", force_overlay=true)
plot(hh - diff * 0.236, color=color.new(color.gray, 60), title="76.4%", force_overlay=true)
plot(hh - diff * 0.382, color=color.new(color.gray, 60), title="61.8%", force_overlay=true)
plot(hh - diff * 0.500, color=color.new(color.aqua, 20), linewidth=2, title="50.0% (Equilibrio)", force_overlay=true)
plot(hh - diff * 0.618, color=color.new(color.gray, 60), title="38.2%", force_overlay=true)
plot(ll, color=color.new(color.green, 50), title="0% (Mínimo)", force_overlay=true) Indicator

Indicator

Indicator

Volumetric Regression Heatmap [LuxAlgo]The Volumetric Regression Heatmap indicator is a sophisticated market analysis tool that combines dynamic linear regression with volume profile density to visualize fair value and liquidity zones. By projecting volume-weighted heatmaps within a trend-following channel, it allows traders to identify where the bulk of trading activity has occurred relative to the current price trajectory.
🔶 USAGE
The indicator provides a multi-layered view of market structure. The central heatmap shows the "hottest" areas of volume concentration, acting as a magnet for price, while the outer bands represent statistical extremes.
🔹 Mean Reversion Signals
The script includes a built-in signal system designed for sideways or "flat" markets. When the indicator detects a "Contraction" state (determined by the ratio of channel height to standard deviation), it plots small circles at the +2/-2 standard deviation levels.
Green Circles: Potential long opportunities when price crosses below the lower signal band during a flat market.
Red Circles: Potential short opportunities when price crosses above the upper signal band during a flat market.
🔹 Future Projections & Profile
The heatmap extends beyond the current bar, providing a "Future Projection" zone. This allows traders to anticipate where support and resistance levels will be in the coming sessions. To the right of the projection, a Bookmap-style volume profile histogram displays the total volume distribution, helping to identify high-volume nodes (HVN) and low-volume nodes (LVN) at a glance.
🔶 DETAILS
🔹 Dynamic Auto-Adjusting Period
Unlike standard regression channels that use a fixed lookback, this tool features an adaptive engine. It calculates the ratio between short-term and long-term volatility (ATR).
In high-volatility environments, the channel period shrinks to become more reactive.
In low-volatility or ranging environments, the period expands to capture a broader structural view.
🔹 Volumetric Delta Histograms
The script calculates the approximate buying and selling volume for every candle within the lookback period. This data is visualized as histograms extending from the outer bands:
Top Band (Green): Displays buying pressure delta.
Bottom Band (Red): Displays selling pressure delta.
This allows traders to see not just where price is, but the intensity of the volume driving it toward the channel extremes.
🔶 SETTINGS
🔹 Core Settings
Source: The price source used for the regression calculation.
Base Period: The anchor length for the regression fit.
Dynamic Auto-Adjusting Period: Enables/disables the volatility-based adaptive lookback.
🔹 Heatmap Settings
Grid Rows Each Side: Determines the vertical resolution of the heatmap bands.
Gradient Smoothing: Applies a smoothing algorithm to the volume distribution for a cleaner visual gradient.
Colors 1-5: Customizable colors ranging from low-volume areas to high-volume "hot" zones.
🔹 Mean Reversion Signals
Signal Band (SD Multiplier): The standard deviation level required to trigger a signal.
Flat Slope Threshold: Controls how "flat" the channel must be to allow signals to appear, preventing counter-trend signals in strong trending markets.
🔹 Delta Histograms
Histogram Height Scale: Adjusts the vertical magnitude of the delta bars.
Histogram Bar Width: Sets the thickness of the individual delta lines.
🔹 Style & Options
Future Projection Length: How many bars to project the heatmap into the future.
Show Volume Profile Histogram: Toggles the right-sided volume distribution boxes.
🔹 Dashboard
Dashboard: Toggles the on-screen analytics panel.
Position/Size: Adjusts the location and scale of the dashboard UI.
Indicator

Trend Structure & Untested LevelsTrend Structure & Tested Levels
Draws the swing trend as a zigzag, turns every swing into a support/resistance level, and tracks whether price has closed through it ("tested") or not ("untested").
Overview
A market-structure tool. It connects confirmed swing highs and lows into a clean zigzag trend line, then projects a horizontal level from each swing. Every level is classified by state — untested until a candle closes through it, after which the most recent break in each direction is flagged as Last Gained or Last Lost. The result is an at-a-glance map of the active structure and which levels are still in play.
What it does
Swing trend (zigzag). Connects confirmed pivot highs/lows into a trend line. A live, provisional leg always runs from the last confirmed pivot to the current price, so the structure reaches the current bar.
Automatic levels. Each swing high/low becomes a horizontal level — highs above price act as resistance, lows below price as support.
Tested vs untested. A level stays untested until a candle closes through it; a wick touch alone does not count.
Last Gained / Last Lost. The most recent resistance price closed above is tagged Last Gained (bullish break of structure); the most recent support price closed below is tagged Last Lost (bearish break).
Multi-timeframe
Levels — and the zigzag, in follow mode — can be drawn from the chart timeframe or any higher timeframe (e.g. D / W / M), labelled with a suffix such as (W). Higher-timeframe pivots are read without repainting forward-filled values and are anchored at the real pivot time, so an HTF level sits where it actually formed and runs horizontally across the whole chart.
Key settings
Pivot length — the master sensitivity control. Lower = a finer zigzag and more, smaller levels; higher = only the major structure.
Swing source — wicks (high/low) or candle bodies (open/close) to ignore wick spikes.
Zigzag follows levels timeframe — keep trend line and levels on one structure, or decouple the zigzag onto the chart timeframe.
Independent colours, line styles, widths, and a per-side cap on untested levels.
Notes
This is a visualisation of structure, not a signal or strategy — it says nothing about profitability; validate separately.
Repainting. Swings confirm pivot length bars after the fact, and the live leg moves with price until a new pivot confirms.
Not financial advice. Indicator

Indicator
