BOS Adaptive Structure Average (Zeiierman)█ Overview
BOS Adaptive Structure Average (Zeiierman) is a structure-aware trend framework that blends market structure logic with an adaptive moving average and directional cloud visualization. Rather than treating all price movements equally, the indicator reacts to confirmed Break of Structure (BOS) and Change of Character (ChoCH) events, using them to dynamically adjust the average's responsiveness and directional bias.
The result is a smoother trend tool that does not rely only on price slope, but also incorporates structural confirmation. Alongside the adaptive average, the script tracks live structural highs and lows, scores their relative strength, and visualizes directional bias through a cloud that expands around the average. This creates a more contextual trend model that helps map both current momentum and active market structure.
█ How It Works
⚪ Structure Engine 1: BOS / ChoCH Detection
The first structure engine identifies pivot highs and pivot lows using a configurable pivot length. Once a pivot is established, the script monitors whether the price breaks above the active high or below the active low.
A break above the tracked high triggers a bullish structural event.
A break below the tracked low triggers a bearish structural event.
Each event is labeled either as:
BOS when it continues the current structural direction
ChoCH when it breaks against the prior structure state and signals a regime shift
This state is stored internally and becomes the foundation for the adaptive behavior of the average.
structText(os, isBull) =>
isBull ? (os == -1 ? "ChoCH" : "BOS") : (os == 1 ? "ChoCH": "BOS")
⚪ Adaptive Average Core
At the center of the indicator is a dynamic average that adjusts its response speed using structure activity.
The script converts BOS events into a directional impulse:
bullish BOS → positive impulse
bearish BOS → negative impulse
This impulse is smoothed into:
bosAct = activity strength
bosBias = directional pressure
Those values control how quickly the average reacts and how strongly it gets pushed in the active structure direction. When the structure activity is quiet, the average behaves more slowly. When structure becomes active, it accelerates and leans into the prevailing directional break.
bosImp = bullBos1 ? 1.0 : bearBos1 ? -1.0 : 0.0
bosAct = ta.rma(math.abs(bosImp), 20)
bosBias = ta.rma(bosImp, 20)
alpha = aSlow + (aFast - aSlow) * bosAct
This produces a trend line that is both smoother than the raw price and more structurally aware than a standard moving average.
⚪ Multi-Speed Internal Average Stack
The adaptive average is not built from just one line. Internally, the script calculates five related adaptive components using different multipliers, creating a fast-to-slow response stack around the same structural core.
⚪ Structure Midpoint Anchoring
To keep the average tied to evolving market structure rather than drifting too freely with price, the script also uses the midpoint between the current active structure high and low as an anchor.
This midpoint acts as a stabilizing force. When the structure is well-defined, the internal averages are gently pulled back toward the structural center, helping the line remain more aligned with the active price framework.
mid = na(hi1) or na(lo1) ? na : (hi1 + lo1) / 2.0
anchW = 0.20 * bosAct
⚪ Live High / Low Structure Strength Model
The second structure engine tracks broader live highs and lows using a separate pivot length. These are not plotted as static levels — the script scores them based on the sequence of BOS and ChoCH events generated by Structure Engine 1.
Weights used in the current code:
ChoCH = 1
BOS = 3
These points are accumulated into bullish and bearish buckets for both the live high and live low. The net values are then translated into simple strength labels:
Weak
Medium
Strong
This creates a live read on whether the current high is stronger resistance or the current low is stronger support.
So the indicator is not only tracking structure breaks, but also maintaining a running estimate of how structurally strong the current high and low levels are.
⚪ Directional Cloud Model
This version uses a layered cloud derived from the adaptive average.
The main adaptive line is b3. That line is smoothed and then compared to a short EMA reference of hlc3 to create intermediate cloud layers between the adaptive line and the reference line. This produces a graded visual zone that reflects both slope and price relationship.
█ How to Use
⚪ Follow Trend Bias Through the Adaptive Average
Use the main adaptive line and cloud to quickly read market direction:
Bullish cloud + rising average → uptrend
Bearish cloud + falling average → downtrend
Flat, mixed, or narrow cloud → consolidation/indecision
Because the average reacts to structure (BOS/ChoCH) instead of just price movement, it tends to give a clearer trend read than standard moving averages, especially in structurally driven markets.
⚪ Use BOS / ChoCH for Regime Shifts
The BOS and ChoCH labels are useful for identifying when the structure is continuing versus when it is changing character.
ChoCH suggests a meaningful break against prior structure and may indicate an early regime shift.
BOS suggests continuation in the active structural direction
This makes the indicator useful not only for trend following but also for spotting when a prior directional assumption may be weakening.
⚪ Map Live Support and Resistance Strength
The live High / Low lines and their strength labels help frame the current structure map.
A Strong High suggests overhead resistance is being reinforced by bearish structure.
A Strong Low suggests support is being reinforced by bullish structure.
Weak readings suggest the level is less structurally defended.
This can be useful for filtering breakout expectations, fade setups, or risk placement around active market boundaries.
█ Settings
Fast Response Length – Controls how quickly the adaptive average reacts during active structure conditions. Lower values make the fast side of the average more responsive.
Slow Response Length – Controls the baseline smoothness of the adaptive average when structure activity is low. Higher values slow the line down and reduce noise.
BOS Directional Push – Adds directional pressure to the adaptive average using smoothed BOS bias and ATR. Higher values increase directional drift after structural confirmation.
Pivot Length (Structure Engine 1) – Defines how sensitive the BOS / ChoCH engine is. Lower values generate more structure events; higher values focus on broader swings.
Pivot Length (Structure Engine 2) – Defines the broader live high/low structure map. Higher values create more stable but less reactive levels.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
อินดิเคเตอร์ Pine Script®






















