Индикатор

Fractal Support & Resistance Zones invincible]Fractal Support & Resistance Zones
Fractal Support & Resistance Zones is an advanced market-structure and price-reaction framework designed to identify, evaluate, and dynamically manage support and resistance zones derived from confirmed fractal pivots.
Unlike traditional support and resistance indicators that simply draw horizontal levels at swing highs and lows, this indicator treats every zone as a dynamic market structure object. Each zone develops through its own lifecycle based on price interaction, independent retests, reaction strength, penetration, estimated buying and selling activity, structural confirmation, trend alignment, and eventual support/resistance role reversal.
The objective is not simply to show where price previously turned.
The objective is to evaluate which zones are still technically relevant, which have gained confirmation, which are weakening, and which may provide better structural trade locations.
---------------------------------------------------------------------------------------------
Fractal-Based Zone Detection
The indicator identifies two independent classes of fractal pivots:
Weak Fractals
Shorter-length pivots designed to capture local price reactions and minor structural turning points.
Major Fractals
Higher-strength pivots based on a larger fractal window. These represent more significant swing highs and swing lows and receive greater importance within the zone-quality model.
Fractal support zones are created from confirmed pivot lows, while fractal resistance zones are generated from confirmed pivot highs.
The detection timeframe can be independently selected, allowing zones from a higher timeframe to be displayed on a lower-timeframe chart.
Higher-timeframe fractal data is requested with lookahead disabled to prevent future data from being intentionally introduced into the pivot calculation.
---------------------------------------------------------------------------------------------
Dynamic Support and Resistance Zones
The indicator creates price zones rather than single horizontal lines.
Markets rarely react from one exact price. Orders, liquidity, and previous positioning are often distributed across a price range. The zone model therefore attempts to represent the broader reaction area surrounding a fractal pivot.
Three zone-width methods are available:
ATR
Zone width is calculated from Average True Range and automatically adapts to market volatility.
Pivot Candle
The structure of the original fractal candle is used to determine the zone width.
Hybrid Candle + ATR
Combines pivot-candle structure with an ATR-based volatility limit.
The hybrid method is designed to prevent unusually large pivot candles from creating excessively wide support or resistance areas.
A minimum tick-based width can also be configured for instruments with very small price movements.
---------------------------------------------------------------------------------------------
Fractal Zone Clustering
Markets frequently produce several nearby fractal pivots around the same price area.
Drawing every pivot independently can create overlapping boxes and unnecessary chart congestion.
The indicator therefore includes a fractal clustering engine.
Nearby same-side fractals may be merged into a common structural zone when:
* They are within the configured ATR merge distance.
* The resulting merged zone does not exceed the maximum permitted ATR width.
* The maximum cluster count has not been exceeded.
* Fresh major zones are not being merged into previously tested or damaged zones when protection is enabled.
The cluster count becomes one component of the zone-quality model.
A cluster does not automatically mean a zone is strong. It simply indicates that multiple independent fractal structures developed around a similar price area.
---------------------------------------------------------------------------------------------
Independent Retest Detection
A major feature of the indicator is the distinction between bars inside a zone and independent zone retests.
If price remains inside a support or resistance area for several candles, those candles are not counted as multiple tests.
A new test is counted only after price:
1. Interacts with the zone.
2. Moves sufficiently away from the zone.
3. Travels the configured ATR reset distance.
4. Returns to the zone again.
This creates a more realistic retest model and avoids artificially increasing the test count during sideways congestion.
The label displays the number of independent tests recorded for each selected zone.
---------------------------------------------------------------------------------------------
ATR-Based Reaction Measurement
After an independent zone retest, the indicator measures how strongly price reacts away from the zone.
Reaction strength is normalized using ATR.
For a support zone, the engine measures upward movement from the reaction anchor.
For a resistance zone, the engine measures downward movement from the reaction anchor.
The strongest reaction generated by the zone is stored as its **Best Reaction ATR**.
Two configurable reaction thresholds are used:
Verified Reaction
The zone has produced the minimum ATR reaction required for technical validation.
Proven Reaction
The zone has generated a stronger ATR reaction and has also accumulated sufficient independent testing.
This prevents a zone from receiving a high structural status simply because price briefly touched it.
The market must demonstrate an actual directional response.
---------------------------------------------------------------------------------------------
Dynamic Zone Status System
Every zone is continuously classified according to its current structural condition.
FRESH
A newly created major zone that has not yet received an independent retest.
Fresh zones may represent relatively untouched structural areas.
WEAK
A zone originating from the shorter weak-fractal detection model.
Weak zones can still produce valid reactions but receive a lower fractal-grade contribution in the quality model.
VERIFIED
A zone that has been tested and remains structurally active.
Reaction behaviour and zone validation contribute dynamically to its score.
PROVEN
A zone that has accumulated multiple independent tests and generated a reaction exceeding the configured Proven Reaction ATR threshold.
Proven zones represent areas with demonstrated historical reaction behaviour.
DAMAGED
Price has penetrated a configurable percentage of the zone.
A damaged zone has not necessarily broken, but deeper penetration reduces its quality score.
BROKEN
Price has invalidated the zone according to the selected break-confirmation method.
Break confirmation can use either:
* Close Beyond Zone
* Full Candle Beyond Zone
Broken zones may optionally remain visible for historical analysis.
FLIPPED SUPPORT / FLIPPED RESISTANCE
A previously broken zone has confirmed a structural role reversal.
Previous support may become resistance.
Previous resistance may become support.
The indicator does not immediately flip a zone when price crosses it. A separate role-reversal confirmation process is required.
---------------------------------------------------------------------------------------------
Zone Damage and Penetration Tracking
Zone quality is not binary.
A support or resistance area may gradually weaken before it completely breaks.
The indicator continuously measures the maximum percentage of zone penetration.
For support, penetration is measured downward through the support area.
For resistance, penetration is measured upward through the resistance area.
When penetration exceeds the configured damage threshold, the zone is classified as ** DAMAGED
Damage also applies a progressive penalty to the quality score.
This means a deeply penetrated zone may remain technically valid while receiving a lower structural ranking.
---------------------------------------------------------------------------------------------
Support and Resistance Role Reversal
The indicator contains a dedicated zone-flip engine.
After a support or resistance zone breaks, the engine monitors whether price moves sufficiently beyond the former zone.
The broken zone must first establish separation from price using a configurable ATR distance.
Price must then return to the previous structural area.
Depending on the selected confirmation mode, the indicator can require:
Zone Reclaim Only
The opposite-side retest itself is sufficient.
Close Away
Price must close a configurable ATR distance away from the zone.
Rejection or Engulfing
The retest can be confirmed through rejection behaviour, an engulfing candle, or a sufficiently strong close away from the zone.
Once confirmed:
* Broken support can become resistance.
* Broken resistance can become support.
The zone is then reset into a new lifecycle as a flipped structural area.
---------------------------------------------------------------------------------------------
Estimated Buy and Sell Activity
The indicator includes an estimated directional volume model.
Because standard TradingView volume does not directly provide true executed bid and ask volume for every market, buying and selling activity is estimated from candle position within the candle range.
A close nearer the candle high allocates a greater portion of volume to estimated buying activity.
A close nearer the candle low allocates a greater portion of volume to estimated selling activity.
The model can use:
* Pivot volume only.
* Pivot volume plus independent retest activity.
Selected zone labels display estimated activity as:
B 64% | S 36%
This should be interpreted as an estimated directional participation model rather than true exchange-level order-flow delta.
---------------------------------------------------------------------------------------------
Multi-Factor Zone Quality Model
Every zone receives a dynamic quality score from 0 to 10.
The score is not based on a single condition.
The model combines several structural factors.
Fractal Grade
Major fractals receive a stronger contribution than weak fractals.
Rejection Wick
The pivot candle's rejection wick is normalized against ATR.
Larger relative rejection can increase the origin score.
Independent Retests
The model evaluates how many genuinely independent zone tests have occurred.
Importantly, unlimited retests do not continuously improve quality.
Excessive testing can weaken a zone.
Reaction Strength
The strongest measured ATR reaction contributes to zone validation.
Estimated Volume Confirmation
Pivot volume participation and directional estimated activity contribute to the score.
Fractal Cluster
Multiple nearby fractals can increase structural confidence.
Freshness
Newer zones receive a greater freshness contribution.
As a zone ages, this component gradually decreases.
The weight of every major quality component can be adjusted by the user.
---------------------------------------------------------------------------------------------
Origin Score and Validation Score
Internally, the quality engine separates zone evaluation into two conceptual stages.
Origin Quality
Evaluates how the zone was created.
This includes:
* Fractal grade.
* Pivot rejection wick.
* Pivot volume participation.
* Fractal clustering.
* Zone freshness.
Validation Quality
Evaluates what price did after the zone was created.
This includes:
* Independent retests.
* Reaction strength.
* Directional estimated activity.
Fresh zones are influenced more heavily by origin quality.
As price begins interacting with a zone, validation behaviour receives greater influence.
This allows the quality score to evolve with market behaviour rather than remaining permanently fixed at zone creation.
---------------------------------------------------------------------------------------------
Retest Exhaustion Penalty
A common assumption is that more support or resistance tests always make a zone stronger.
This indicator does not use that assumption.
Repeated interaction may gradually consume resting liquidity around a price area.
After the configured number of retests, the indicator begins applying an excess retest penalty.
The penalty increases with each additional independent test.
As a result, a heavily tested zone may receive a lower quality score even if it has not formally broken.
---------------------------------------------------------------------------------------------
Congestion Penalty
Price remaining inside a zone for an extended period may indicate balance, absorption, or structural deterioration.
The indicator tracks consecutive bars interacting with each zone.
After the configured congestion threshold, a progressive quality penalty is applied.
This helps distinguish a clean rejection from prolonged price acceptance inside the area.
---------------------------------------------------------------------------------------------
Trend Regime Alignment
An optional EMA-based trend regime is included in the quality model.
Support zones located in an unfavourable bearish regime can receive a counter-trend penalty.
Resistance zones located in an unfavourable bullish regime can also receive a penalty.
The trend filter does not automatically delete zones.
Instead, it modifies their relative quality.
This allows historically valid support and resistance areas to remain visible while acknowledging the current directional regime.
---------------------------------------------------------------------------------------------
Market Structure Break Detection
The indicator includes an independent Market Structure Break, or **MSB**, engine.
Confirmed swing highs and swing lows are detected using a configurable pivot length.
A bullish MSB occurs when price closes above the latest eligible structural high with sufficient momentum confirmation.
A bearish MSB occurs when price closes below the latest eligible structural low with sufficient negative momentum confirmation.
Momentum is normalized using a Z-score calculated from recent price changes.
This reduces the number of minor structural crossings classified as meaningful breaks.
Each structural pivot can generate only one MSB event, preventing repeated labels from appearing after the same swing has already been broken.
---------------------------------------------------------------------------------------------
Zone-to-Structure Confirmation
Market Structure Breaks can also validate previously tested zones.
When a bullish MSB occurs, the indicator searches for a recently touched support zone.
When a bearish MSB occurs, it searches for a recently touched resistance zone.
The most recent eligible zone can receive structural confirmation.
A configurable quality bonus is then applied.
This creates a basic structural sequence:
Zone interaction → Price reaction → Market Structure Break
The intention is to distinguish zones that merely produced a temporary bounce from zones followed by a measurable structural shift.
---------------------------------------------------------------------------------------------
Premium and Discount Trade Location
The indicator uses the latest structural swing high and swing low to estimate the current swing midpoint.
The midpoint represents the 50% equilibrium level of the structural range.
When Premium/Discount grading is enabled:
* Support zones are favoured when positioned in the discount portion of the swing.
* Resistance zones are favoured when positioned in the premium portion of the swing.
This condition contributes to the displayed Trade Grade.
It does not remove zones from the chart.
---------------------------------------------------------------------------------------------
Trade Grade System
Selected zones receive a simplified structural trade grade.
Grade A+
Reserved for high-quality zones with strong alignment between:
* Zone quality.
* Trend regime.
* Premium/discount location.
* Low structural damage.
* Limited retest exhaustion.
Grade A
Strong-quality zones with favourable trend alignment and low damage.
Grade B
Moderate-to-strong structural zones that are not classified as weak fractals.
Grade C
Lower-quality but still technically visible zones.
Grade D
Zones with poor overall structural quality.
The Trade Grade is a contextual ranking system.
It is not an automatic buy or sell signal.
---------------------------------------------------------------------------------------------
Star-Based Quality Display
To make the detailed labels easier to read, the numerical quality model is represented using stars.
★★★★★ = Quality 8.0 or higher
★★★★ = Quality 6.0 to 7.99
★★★ = Quality 4.0 to 5.99
★★ = Quality 2.0 to 3.99
★ = Quality below 2.0
The stars provide a quick visual representation of the underlying 0–10 quality score.
---------------------------------------------------------------------------------------------
Compact Detailed Labels
Selected zones can display compact one-line labels such as:
VERIFIED SUP | B 64% | S 36% | ★★★★ | Tests: 2 | Grade A
The label contains:
* Current zone status.
* Support or resistance classification.
* Estimated buying activity.
* Estimated selling activity.
* Quality stars.
* Independent retest count.
* Structural Trade Grade.
Because displaying a detailed label on every zone can create significant chart congestion, two label modes are available.
Nearest + Strongest
Prioritizes the nearest support, nearest resistance, and the highest-quality remaining zones.
All Visible Zones
Displays labels for every currently visible zone.
The maximum number of detailed labels can also be controlled.
---------------------------------------------------------------------------------------------
Nearest Zone Highlighting
The indicator continuously identifies:
* The nearest active support below price.
* The nearest active resistance above price.
These zones can receive stronger border highlighting.
This makes the most immediately relevant structural areas easier to identify without removing historical zones from the chart.
---------------------------------------------------------------------------------------------
Structural Equilibrium Zone
The latest confirmed structural swing high and swing low are used to calculate a 50% equilibrium area.
The indicator plots:
* Swing origin.
* Swing destination.
* 50% midpoint.
* Configurable equilibrium zone thickness.
Before price interacts with the equilibrium area, the zone is displayed as the current structural midpoint.
After price touches the area, the indicator changes its state to:
Equilibrium touched · wait for structure
This is intended to remind the trader that equilibrium interaction alone is not necessarily directional confirmation.
Additional market structure may be required.
---------------------------------------------------------------------------------------------
Alert Conditions
The indicator provides alert conditions for important zone and market-structure events:
* New fractal support zone.
* New fractal resistance zone.
* Independent zone retest.
* Zone verified by ATR reaction.
* Zone reaching Proven status.
* Zone becoming Damaged.
* Zone break.
* Support/resistance role reversal.
* Bullish Market Structure Break.
* Bearish Market Structure Break.
These alerts can be used to monitor structural changes without continuously watching the chart.
---------------------------------------------------------------------------------------------
Suggested Interpretation
This indicator is designed as a market context and structural analysis tool.
A possible analytical workflow is:
1. Identify the nearest active support and resistance.
2. Review the zone's current status.
3. Check estimated buy/sell activity.
4. Evaluate the quality stars.
5. Review the independent test count.
6. Check whether the zone is fresh, validated, damaged, or exhausted.
7. Evaluate trend alignment.
8. Check premium or discount location.
9. Observe whether price produces a structural break after the zone reaction.
10. Use the Trade Grade as an additional contextual ranking.
No single factor should be interpreted independently.
A five-star zone can still break.
A damaged zone can still generate a reaction.
A weak fractal can still become structurally relevant.
The purpose of the model is to organize multiple price-action variables into a consistent framework.
---------------------------------------------------------------------------------------------
Important Volume Note
The Buy and Sell percentages displayed by this indicator are estimated directional volume statistics.
They are calculated by allocating candle volume according to the closing position within the candle's high-low range.
They do not represent true bid/ask volume, footprint delta, or exchange-level aggressive buying and selling.
The values should therefore be used as a relative activity estimate only.
---------------------------------------------------------------------------------------------
Non-Repainting Considerations
Fractal pivots require confirmation bars.
A zone is created only after the corresponding pivot has been confirmed by the selected fractal length.
Higher-timeframe fractal calculations use `lookahead_off`.
Therefore, historical zones should be interpreted from the point at which the fractal became technically confirmed rather than assuming the pivot was known at the exact swing candle in real time.
Market Structure Break conditions are also evaluated using confirmed price and momentum conditions.
---------------------------------------------------------------------------------------------
Final Note
Fractal Support & Resistance Zones is designed for traders who prefer **dynamic structural zones instead of static support and resistance lines**.
The indicator combines fractal structure, volatility-normalized zone construction, independent retests, reaction measurement, damage analysis, estimated directional activity, structural breaks, trend regime, premium/discount location, and role reversal into a unified zone lifecycle model.
It is intended to help answer three practical questions:
Where is the important price structure?
How has price behaved around that structure?
Is the zone gaining validation, remaining fresh, or gradually losing structural quality?
This indicator is intended for technical analysis and research purposes only. It does not constitute financial advice. Traders should independently evaluate market conditions and apply appropriate risk management.
Индикатор

Market Zone [Jannu]1. Description
Markets do not move in straight lines. Price frequently departs from equilibrium through gaps, rapid displacement, or impulsive expansion from compressed bases. These departures leave behind areas of unresolved imbalance; zones where the auction process was incomplete. Market Zone is the foundational Imbalance component of the ET Massif Framework research suite. It identifies three distinct forms of such imbalance and renders them as dynamic, self-managing zones on the chart.
2. Features
The indicator combines three detection methods:
Fair Value Gaps (FVGs)
Three-candle imbalances where a qualifying middle candle displaces price fast enough that the gap between the outer candles remains unfilled. Detection requires ATR expansion, minimum gap size, VWAP position relative to the gap, volume, and candle body proportion.
Session Gaps
Price discontinuities between consecutive session closes and opens, filtered by ATR magnitude.
Points of Interest (POI)
The consolidation base that preceded a significant impulsive move. Once an impulse exceeding a defined ATR multiple is confirmed, the indicator locates the tight-range candle immediately before the expansion and uses its high/low as the zone boundary.
3. Detection Logic
A. Fair Value Gaps (FVG)
Detected using a qualified three-candle imbalance structure.
Criteria:
Low > High (Bullish) or High < Low (Bearish)
Middle candle range > 1.1× ATR
Gap size > 1.0× ATR
Middle candle VWAP above High (Bullish) or below Low (Bearish)
Volume > 1.2× 180-bar average volume
Candle body > 65% of total range
Qualifying FVGs display a diamond marker at the middle candle VWAP. Diamond size scales with relative volume. Boxes extend forward with each new bar and contract as candle bodies close into the zone. Zones are removed once fully covered.
B. Session Gaps (FVG)
Detects price discontinuities between the current open and the prior close.
Criteria:
Absolute gap > 1.5× ATR
Gap boxes are drawn between the prior close and the current open, extend forward, and contract as candle bodies close into them. Zones are removed once fully covered.
C. Points of Interest (POI)
Identifies the consolidation base preceding a significant directional expansion.
Criteria:
An impulsive move within the previous 5 bars exceeding 2.0× ATR
Majority of bars within the move are directional
Once an impulse is confirmed, the indicator searches the preceding bars for the first candle whose range is below 0.5× ATR. That candle's high and low define the POI zone. A 20-bar cooldown prevents overlapping detections. Zones are invalidated when a candle body closes through the zone boundary. Invalidated zones remain on the chart in grey. All criteria are configurable via settings. Use stricter rules for lower timeframes or volatile assets.
4 . Use
Jannu is a structural reference tool. The zones mark where price departed from equilibrium; Determining which outcome is unfolding requires the broader analytical context in which the indicator is used.
The same zone type can carry different interpretations depending on context. On the CRWD daily chart in early 2026, a cluster of large bearish FVGs formed during a sharp sell-off, yet price reversed immediately and never returned to those zones. The imbalance was not evidence of sellers in control; it was the mechanism through which aggressive selling exhausted supply before buyers drove price upward. Contrast this with the series of bearish FVGs that formed during ADBE's long decline from late 2024. Same structure, different character. The indicator marks the zone; contextual analysis is required.
日本語概要 (Japanese Summary)
Jannuは、価格が均衡から乖離した領域を可視化するリファレンス指標であり、ET Massifインジケーターフレームワークの一部として開発されました。セッションギャップ、フェアバリューギャップ(FVG)、ポイント・オブ・インタレスト(POI)の3種類の価格不均衡を検出し、動的なゾーンとしてチャート上に表示します。これらのゾーンは、ローソク足の実体が内部に進入するにつれて縮小し、完全に埋まった時点で自動的に削除されます。市場構造の参照フレームワークとして機能します。
中文概要(Chinese Summary)
Jannu 是一款將價格偏離均衡的區域進行視覺化呈現的參考指標,作為 ET Massif 指標框架的一部分所開發。本指標可偵測三種價格失衡類型:開盤缺口(Session Gap)、合理價值 gap(FVG)以及關注區域(POI),並將其作為動態區間顯示於圖表上。這些區間會隨著 K 線實體進入而縮減,並在完全填補時自動刪除。本指標作為市場結構的參考框架使用。
Disclaimer:
This script is a research tool for market structure analysis and educational purposes only. It does not constitute financial advice. Trading involves risk. Индикатор

Forward P/E: Price-Reactive and Reported [Pro]How to Interpret the Forward P/E: Price-Reactive and Reported Indicator and Table:
What this indicator does
This indicator compares two versions of forward P/E:
Term
Meaning
Reactive
Daily price-adjusted forward P/E using the latest anchored forward EPS
Reported
TradingView’s reported forward P/E from its financial data source
The chart itself plots the Reactive Forward P/E, while the table shows both Reactive / Reported valuation context.
The main question it answers is:
Has the stock’s valuation moved too far compared with its own history?
Best default settings
Setting
Suggested
Financial Period Mode
Auto FY then FQ
Historical Lookback
3 Years or 5 Years
Require Full Lookback History
Off
Minimum Valid Bars
63 or 126
Smoothing Type
EMA
Smoothing Length
10
Signal Length
20
Percentile / Z-Score Source
Raw Price-Reactive P/E
Show Reported Line
Off
Show Reactive Adaptive Bands
On
Fill Extreme Zones
On
For newer stocks, use 6 Months, 1 Year, or 2 Years.
Main table readings
Reactive / Reported P/E
Example:
42.5x / 38.9x
This means:
Side
Meaning
Reactive P/E
Price-adjusted forward P/E based on current price
Reported P/E
TradingView’s reported forward P/E
If Reactive P/E is much higher than Reported P/E, the stock price may have run up since the last reported valuation update.
Smoothed Reactive P/E
This is the smoother plotted value.
Use it to read the trend, not the exact current valuation.
Reading
Best use
Reactive P/E
Current valuation estimate
Smoothed Reactive P/E
Cleaner visual trend
Anchored Forward EPS
This is the estimated forward EPS base used to calculate the Reactive P/E.
Reactive P/E = Current Price / Anchored Forward EPS
If the anchored EPS is stale, the Reactive P/E may still move daily with price, but the earnings base may be outdated.
Reactive / Reported Rank
This is one of the most important rows.
Example:
91% / 78%
Side
Meaning
Reactive Rank
Where the price-adjusted P/E ranks versus its own history
Reported Rank
Where the reported P/E ranks versus its own history
Interpretation:
Percentile Rank
Meaning
95%+
Extremely expensive
90–95%
Expensive / stretched
75–90%
Above-normal valuation
25–75%
Normal valuation range
10–25%
Below-normal valuation
5–10%
Historically cheap
Below 5%
Deep valuation discount
A major warning setup is:
Reactive Rank above 90%
Reported Rank much lower
That can mean price has moved ahead of the last reported valuation update.
Reactive / Reported Median
Example:
31.0x / 29.5x
This shows the stock’s historical “normal” P/E level for each method.
Use this to see whether the current valuation is above or below its own normal range.
Reactive / Reported Premium
Example:
+37% / +28%
This means valuation is above its historical median.
Reading
Meaning
+50%
Very rich versus normal
+20%
Above normal
0%
Near median valuation
-20%
Below normal
-40%
Potentially cheap
This is one of the easiest rows to use.
Reactive / Reported P95
This shows each method’s historical expensive zone.
Example:
52x / 48x
If the Reactive P/E is near or above its P95, the stock is historically expensive based on current price movement.
Reactive / Reported P05
This shows each method’s historical cheap zone.
Example:
18x / 16x
If the Reactive P/E is near or below P05, the stock is historically cheap versus its own valuation history.
Reactive / Reported Yield
This converts forward P/E into earnings yield.
Forward Earnings Yield = 100 / Forward P/E
Examples:
P/E
Earnings Yield
10x
10.0%
20x
5.0%
40x
2.5%
80x
1.25%
Lower yield means richer valuation.
Reactive Room to P95
This shows how much room remains before the Reactive P/E reaches its historical expensive zone.
Reading
Meaning
Positive
Still below historical expensive extreme
Near zero
Near historical expensive extreme
Negative
Already above historical expensive extreme
Example:
Reactive Room to P95: -3.5x
The stock is already above its historical 95th percentile valuation level.
Reactive Room above P05
This shows how far the Reactive P/E is above its historical cheap zone.
Reading
Meaning
Large positive
Not cheap
Near zero
Near historical cheap zone
Negative
Below historical cheap extreme
EPS / Multiple Trend
This shows whether the anchored EPS base and valuation multiple are rising, falling, or stable.
Reading
Meaning
Rising / Expansion
EPS anchor rising and multiple rising
Rising / Compression
EPS anchor rising while valuation gets cheaper
Falling / Expansion
EPS anchor falling while valuation rises — riskier
Falling / Compression
EPS anchor falling and multiple falling
Stable / Stable
Little change
Most concerning:
Falling / Expansion
That means investors are paying a higher multiple while the earnings base is worsening.
Driver
This explains what is mostly driving the valuation move.
Driver
Meaning
Price-Led Multiple Expansion
Price is pushing valuation higher
Price-Led Multiple Compression
Price decline is compressing valuation
EPS Anchor Improved
Earnings base improved
EPS Anchor Deteriorated
Earnings base worsened
Stable
No major change
For overextension, watch for:
Price-Led Multiple Expansion
especially when Reactive Rank is above 90%.
PEG / Fwd P/S
These are supplemental checks.
Metric
Use
PEG
P/E adjusted for growth
Forward P/S
Useful when earnings are unstable or distorted
A high P/E is less concerning if growth is strong and PEG is reasonable. A high P/E with a high PEG is more concerning.
Data Quality
This row tells you whether the indicator has enough usable history.
Message
Meaning
Full reactive history
Most reliable
Limited reactive history
Usable, but be cautious
Too little reactive history
Percentiles are weak
No valid reported P/E
TradingView does not have usable forward P/E
Bars since anchor
How long since the reported P/E last updated
If “bars since anchor” is very high, the Reactive P/E is still useful for price movement, but the earnings base may be stale.
Status readings
Reactive Status
This is the main status because the chart is price-reactive.
Status
Meaning
Extreme Expensive
Reactive Rank 95%+
Expensive / Stretched
Reactive Rank 90–95%
Above Normal Valuation
Reactive Rank 75–90%
Normal Valuation Range
Reactive Rank 25–75%
Below Normal Valuation
Reactive Rank 10–25%
Historically Cheap
Reactive Rank 5–10%
Deep Valuation Discount
Reactive Rank below 5%
Limited / Building History
Not enough data yet
Reported Status
This is the slower TradingView-reported valuation status.
Use it as confirmation.
Best warning setup:
Reactive Status = Expensive / Stretched
Reported Status = Normal Valuation Range
That can mean the stock price has moved ahead of the last reported valuation update.
How to use it practically
Avoid chasing
Be cautious when you see:
Reactive Rank above 90%
Reactive Premium strongly positive
Reactive Room to P95 near zero or negative
Driver = Price-Led Multiple Expansion
That means valuation is stretched mainly because price has moved up.
Look for possible value
Look closer when you see:
Reactive Rank below 10%
Reactive Premium negative
Reactive Room above P05 near zero or negative
Reported Status also cheap
That means the stock may be cheap versus its own history.
Best long setup
The healthier setup is often:
Reactive Rank 25–75%
EPS trend Rising
Multiple Stable or Compressing
Price trend improving
That means the stock may not be overextended, and the earnings base may be improving.
Main takeaway
Use this indicator as a stock-specific valuation stretch tool.
The most important rows are:
Reactive / Reported P/E
Reactive / Reported Rank
Reactive / Reported Premium
Reactive Room to P95
Reactive Status
Reported Status
Data Quality
The key idea:
Reactive = what valuation looks like today after price movement.
Reported = what TradingView’s financial data currently reports.
Here is the source code:
//@version=6
indicator("Price-Reactive Forward P/E Extremes ", shorttitle="PRFPE+", overlay=false, max_bars_back=3000)
//====================================================
// INPUTS
//====================================================
grp1 = "Forward Valuation Settings"
financialMode = input.string("Auto FY then FQ", "Financial Period Mode", options= , group=grp1)
minValidPE = input.float(0.1, "Minimum Valid Forward P/E", minval=0.0, step=0.1, group=grp1)
maxValidPE = input.float(500.0, "Maximum Valid Forward P/E", minval=1.0, step=5.0, group=grp1)
grp2 = "Historical Lookback Settings"
lookbackChoice = input.string("5 Years", "Historical Lookback", options= , group=grp2)
requireFullHistory = input.bool(false, "Require Full Lookback History?", group=grp2)
minValidBars = input.int(63, "Minimum Valid Bars in Limited-History Mode", minval=20, maxval=1260, group=grp2)
usePriorHistoryOnly = input.bool(true, "Rank Current Reading vs Prior History Only?", group=grp2)
grp3 = "Smoothing Settings"
smoothType = input.string("EMA", "Price-Reactive P/E Smoothing Type", options= , group=grp3)
smoothLen = input.int(10, "Smoothing Length", minval=1, group=grp3)
signalLength = input.int(20, "Signal Line Length", minval=1, group=grp3)
rankSource = input.string("Raw Price-Reactive P/E", "Percentile / Z-Score Source", options= , group=grp3)
grp4 = "EPS / Multiple Trend Settings"
epsTrendLen = input.int(63, "EPS / Multiple Trend Lookback", minval=1, group=grp4)
trendThreshold = input.float(2.5, "Trend Threshold %", minval=0.0, step=0.5, group=grp4)
grp5 = "Visuals & UI"
showHistogram = input.bool(false, "Show Price-Reactive P/E Histogram?", group=grp5)
showReportedLine = input.bool(false, "Show Reported Forward P/E Step Line?", group=grp5)
showAdaptiveBands = input.bool(true, "Show Reactive Adaptive Percentile Bands?", group=grp5)
showZoneFills = input.bool(true, "Fill Extreme Zones?", group=grp5)
showFixedBands = input.bool(false, "Show Fixed Forward P/E Bands?", group=grp5)
showTable = input.bool(true, "Show Current Reading Table?", group=grp5)
showBgHighlight = input.bool(false, "Highlight Extreme Background?", group=grp5)
fixedUpper1 = input.float(30.0, "Fixed Upper Band 1", step=0.5, group=grp5)
fixedUpper2 = input.float(45.0, "Fixed Upper Band 2", step=0.5, group=grp5)
fixedLower1 = input.float(15.0, "Fixed Lower Band 1", step=0.5, group=grp5)
fixedLower2 = input.float(10.0, "Fixed Lower Band 2", step=0.5, group=grp5)
//====================================================
// LOOKBACK CONVERSION
//====================================================
historyBars = lookbackChoice == "6 Months" ? 126 : lookbackChoice == "1 Year" ? 252 : lookbackChoice == "2 Years" ? 504 : lookbackChoice == "3 Years" ? 756 : lookbackChoice == "4 Years" ? 1008 : 1260
requiredBars = requireFullHistory ? historyBars : minValidBars
//====================================================
// REPORTED FINANCIAL DATA
//====================================================
peFY = request.financial(syminfo.tickerid, "PRICE_EARNINGS_FORWARD", "FY", barmerge.gaps_off, true)
peFQ = request.financial(syminfo.tickerid, "PRICE_EARNINGS_FORWARD", "FQ", barmerge.gaps_off, true)
pegFY = request.financial(syminfo.tickerid, "PEG_RATIO", "FY", barmerge.gaps_off, true)
pegFQ = request.financial(syminfo.tickerid, "PEG_RATIO", "FQ", barmerge.gaps_off, true)
psFY = request.financial(syminfo.tickerid, "PRICE_SALES_FORWARD", "FY", barmerge.gaps_off, true)
psFQ = request.financial(syminfo.tickerid, "PRICE_SALES_FORWARD", "FQ", barmerge.gaps_off, true)
f_valid_pe(_v) =>
not na(_v) and _v >= minValidPE and _v <= maxValidPE ? _v : na
validPEFY = f_valid_pe(peFY)
validPEFQ = f_valid_pe(peFQ)
float reportedPE = na
string effectivePeriod = "n/a"
if financialMode == "FY"
reportedPE := validPEFY
effectivePeriod := "FY"
else if financialMode == "FQ"
reportedPE := validPEFQ
effectivePeriod := "FQ"
else if financialMode == "Auto FY then FQ"
if not na(validPEFY)
reportedPE := validPEFY
effectivePeriod := "FY"
else
reportedPE := validPEFQ
effectivePeriod := "FQ"
else
if not na(validPEFQ)
reportedPE := validPEFQ
effectivePeriod := "FQ"
else
reportedPE := validPEFY
effectivePeriod := "FY"
pegRatioData = effectivePeriod == "FY" ? pegFY : effectivePeriod == "FQ" ? pegFQ : na
forwardPSData = effectivePeriod == "FY" ? psFY : effectivePeriod == "FQ" ? psFQ : na
//====================================================
// PRICE-REACTIVE FORWARD P/E
//====================================================
reportedUpdated = not na(reportedPE) and (na(reportedPE ) or reportedPE != reportedPE )
var float anchoredForwardEPS = na
if reportedUpdated and reportedPE > 0.0
anchoredForwardEPS := close / reportedPE
else
anchoredForwardEPS := anchoredForwardEPS
priceReactivePE = not na(anchoredForwardEPS) and anchoredForwardEPS > 0.0 ? close / anchoredForwardEPS : na
barsSinceReportedUpdate = ta.barssince(reportedUpdated)
//====================================================
// SMOOTHING
//====================================================
f_smooth(_src, _len) =>
if smoothType == "None" or _len <= 1
_src
else if smoothType == "SMA"
ta.sma(_src, _len)
else if smoothType == "EMA"
ta.ema(_src, _len)
else
ta.rma(_src, _len)
smoothedReactivePE = f_smooth(priceReactivePE, smoothLen)
rankReactivePE = rankSource == "Raw Price-Reactive P/E" ? priceReactivePE : smoothedReactivePE
signalLine = f_smooth(smoothedReactivePE, signalLength)
//====================================================
// HISTORICAL STATS FUNCTIONS
//====================================================
f_array_percentile(_arr, _pct) =>
int _n = array.size(_arr)
float _result = na
if _n > 0
float _pos = (_pct / 100.0) * (_n - 1)
int _lo = int(math.floor(_pos))
int _hi = int(math.ceil(_pos))
float _weight = _pos - _lo
float _loVal = array.get(_arr, _lo)
float _hiVal = array.get(_arr, _hi)
_result := _loVal + ((_hiVal - _loVal) * _weight)
_result
f_hist_stats(_series, _x, _len, _priorOnly) =>
array _values = array.new_float(0)
float _sum = 0.0
float _sumSq = 0.0
int _start = _priorOnly ? 1 : 0
int _finish = _priorOnly ? _len : _len - 1
for i = _start to _finish
_v = _series
if not na(_v)
array.push(_values, _v)
_sum += _v
_sumSq += _v * _v
int _n = array.size(_values)
float _p95 = na
float _p90 = na
float _p75 = na
float _p50 = na
float _p25 = na
float _p10 = na
float _p05 = na
float _rank = na
float _mean = na
float _stdev = na
if _n > 0
array.sort(_values, order.ascending)
_p95 := f_array_percentile(_values, 95)
_p90 := f_array_percentile(_values, 90)
_p75 := f_array_percentile(_values, 75)
_p50 := f_array_percentile(_values, 50)
_p25 := f_array_percentile(_values, 25)
_p10 := f_array_percentile(_values, 10)
_p05 := f_array_percentile(_values, 5)
if not na(_x)
float _countBelowOrEqual = 0.0
for j = 0 to _n - 1
if array.get(_values, j) <= _x
_countBelowOrEqual += 1.0
_rank := (_countBelowOrEqual / _n) * 100.0
_mean := _sum / _n
if _n > 1
float _variance = (_sumSq - ((_sum * _sum) / _n)) / (_n - 1)
_stdev := _variance >= 0.0 ? math.sqrt(_variance) : na
//====================================================
// REACTIVE HISTORICAL STATS
//====================================================
= f_hist_stats(rankReactivePE, rankReactivePE, historyBars, usePriorHistoryOnly)
hasEnoughReactiveHistory = not na(priceReactivePE) and reactiveHistoryCount >= requiredBars
rP95 = hasEnoughReactiveHistory ? rP95Raw : na
rP90 = hasEnoughReactiveHistory ? rP90Raw : na
rP75 = hasEnoughReactiveHistory ? rP75Raw : na
rP50 = hasEnoughReactiveHistory ? rP50Raw : na
rP25 = hasEnoughReactiveHistory ? rP25Raw : na
rP10 = hasEnoughReactiveHistory ? rP10Raw : na
rP05 = hasEnoughReactiveHistory ? rP05Raw : na
reactivePercentRank = hasEnoughReactiveHistory ? rRankRaw : na
reactiveZScore = hasEnoughReactiveHistory and not na(rStdevRaw) and rStdevRaw != 0.0 ? (rankReactivePE - rAvgRaw) / rStdevRaw : na
//====================================================
// REPORTED HISTORICAL STATS
//====================================================
= f_hist_stats(reportedPE, reportedPE, historyBars, usePriorHistoryOnly)
hasEnoughReportedHistory = not na(reportedPE) and reportedHistoryCount >= requiredBars
reportedP95 = hasEnoughReportedHistory ? fP95Raw : na
reportedP90 = hasEnoughReportedHistory ? fP90Raw : na
reportedP75 = hasEnoughReportedHistory ? fP75Raw : na
reportedP50 = hasEnoughReportedHistory ? fP50Raw : na
reportedP25 = hasEnoughReportedHistory ? fP25Raw : na
reportedP10 = hasEnoughReportedHistory ? fP10Raw : na
reportedP05 = hasEnoughReportedHistory ? fP05Raw : na
reportedPercentRank = hasEnoughReportedHistory ? fRankRaw : na
reportedZScore = hasEnoughReportedHistory and not na(fStdevRaw) and fStdevRaw != 0.0 ? (reportedPE - fAvgRaw) / fStdevRaw : na
//====================================================
// VALUATION CONTEXT
//====================================================
reactivePremiumToMedian = not na(rP50) and rP50 != 0.0 and not na(rankReactivePE) ? ((rankReactivePE - rP50) / rP50) * 100.0 : na
reportedPremiumToMedian = not na(reportedP50) and reportedP50 != 0.0 and not na(reportedPE) ? ((reportedPE - reportedP50) / reportedP50) * 100.0 : na
reactiveRoomToP95 = not na(rP95) and not na(rankReactivePE) ? rP95 - rankReactivePE : na
reportedRoomToP95 = not na(reportedP95) and not na(reportedPE) ? reportedP95 - reportedPE : na
reactiveRoomAboveP05 = not na(rP05) and not na(rankReactivePE) ? rankReactivePE - rP05 : na
reportedRoomAboveP05 = not na(reportedP05) and not na(reportedPE) ? reportedPE - reportedP05 : na
reactiveEarningsYield = not na(priceReactivePE) and priceReactivePE > 0.0 ? 100.0 / priceReactivePE : na
reportedEarningsYield = not na(reportedPE) and reportedPE > 0.0 ? 100.0 / reportedPE : na
anchoredEPSChangePct = not na(anchoredForwardEPS ) and anchoredForwardEPS != 0.0 ? ((anchoredForwardEPS - anchoredForwardEPS ) / math.abs(anchoredForwardEPS )) * 100.0 : na
reactivePEChangePct = not na(rankReactivePE ) and rankReactivePE != 0.0 ? ((rankReactivePE - rankReactivePE ) / math.abs(rankReactivePE )) * 100.0 : na
priceChangePct = not na(close ) and close != 0.0 ? ((close - close ) / close ) * 100.0 : na
//====================================================
// DATA QUALITY
//====================================================
string reactiveDataQualityText = "n/a"
if na(reportedPE)
reactiveDataQualityText := "No valid reported P/E"
else if na(anchoredForwardEPS)
reactiveDataQualityText := "No anchored EPS yet"
else if reactiveHistoryCount < minValidBars
reactiveDataQualityText := "Too little reactive history: " + str.tostring(reactiveHistoryCount, "#") + " bars"
else if requireFullHistory and reactiveHistoryCount < historyBars
reactiveDataQualityText := "Need full reactive lookback: " + str.tostring(reactiveHistoryCount, "#") + "/" + str.tostring(historyBars)
else if reactiveHistoryCount < historyBars
reactiveDataQualityText := "Limited reactive history: " + str.tostring(reactiveHistoryCount, "#") + "/" + str.tostring(historyBars)
else
reactiveDataQualityText := "Full reactive history: " + str.tostring(reactiveHistoryCount, "#") + "/" + str.tostring(historyBars)
string reportedDataQualityText = "n/a"
if na(reportedPE)
reportedDataQualityText := "No valid reported P/E"
else if reportedHistoryCount < minValidBars
reportedDataQualityText := "Too little reported history: " + str.tostring(reportedHistoryCount, "#") + " bars"
else if requireFullHistory and reportedHistoryCount < historyBars
reportedDataQualityText := "Need full reported lookback: " + str.tostring(reportedHistoryCount, "#") + "/" + str.tostring(historyBars)
else if reportedHistoryCount < historyBars
reportedDataQualityText := "Limited reported history: " + str.tostring(reportedHistoryCount, "#") + "/" + str.tostring(historyBars)
else
reportedDataQualityText := "Full reported history: " + str.tostring(reportedHistoryCount, "#") + "/" + str.tostring(historyBars)
//====================================================
// STATUS LOGIC
//====================================================
f_status(_hasEnough, _rank, _valueIsValid) =>
string _status = "Neutral"
if not _valueIsValid
_status := "No Forward P/E Data"
else if not _hasEnough
_status := "Limited / Building History"
else if _rank >= 95
_status := "Extreme Expensive"
else if _rank >= 90
_status := "Expensive / Stretched"
else if _rank >= 75
_status := "Above Normal Valuation"
else if _rank <= 5
_status := "Deep Valuation Discount"
else if _rank <= 10
_status := "Historically Cheap"
else if _rank <= 25
_status := "Below Normal Valuation"
else
_status := "Normal Valuation Range"
_status
reactiveStatusText = f_status(hasEnoughReactiveHistory, reactivePercentRank, not na(priceReactivePE))
reportedStatusText = f_status(hasEnoughReportedHistory, reportedPercentRank, not na(reportedPE))
isReady = hasEnoughReactiveHistory and not na(reactivePercentRank)
isExtremeExpensive = isReady and reactivePercentRank >= 95
isExpensive = isReady and reactivePercentRank >= 90 and reactivePercentRank < 95
isAboveNormal = isReady and reactivePercentRank >= 75 and reactivePercentRank < 90
isDeepDiscount = isReady and reactivePercentRank <= 5
isCheap = isReady and reactivePercentRank > 5 and reactivePercentRank <= 10
isBelowNormal = isReady and reactivePercentRank > 10 and reactivePercentRank <= 25
string epsTrendText = "n/a"
if not na(anchoredEPSChangePct)
if anchoredEPSChangePct > trendThreshold
epsTrendText := "Rising"
else if anchoredEPSChangePct < -trendThreshold
epsTrendText := "Falling"
else
epsTrendText := "Flat"
string multipleTrendText = "n/a"
if not na(reactivePEChangePct)
if reactivePEChangePct > trendThreshold
multipleTrendText := "Expansion"
else if reactivePEChangePct < -trendThreshold
multipleTrendText := "Compression"
else
multipleTrendText := "Stable"
string driverText = "n/a"
if not na(priceChangePct) and not na(reactivePEChangePct)
if priceChangePct > trendThreshold and reactivePEChangePct > trendThreshold
driverText := "Price-Led Multiple Expansion"
else if priceChangePct < -trendThreshold and reactivePEChangePct < -trendThreshold
driverText := "Price-Led Multiple Compression"
else if priceChangePct > trendThreshold and reactivePEChangePct < -trendThreshold
driverText := "EPS Anchor Improved"
else if priceChangePct < -trendThreshold and reactivePEChangePct > trendThreshold
driverText := "EPS Anchor Deteriorated"
else
driverText := "Stable"
color dynamicColor = color.gray
if isReady
if reactivePercentRank > 50
dynamicColor := color.from_gradient(reactivePercentRank, 50, 100, color.new(color.gray, 45), color.new(color.red, 0))
else
dynamicColor := color.from_gradient(reactivePercentRank, 0, 50, color.new(color.blue, 0), color.new(color.gray, 45))
color statusColor = color.gray
if isReady
if isExtremeExpensive
statusColor := color.red
else if isExpensive
statusColor := color.orange
else if isAboveNormal
statusColor := color.yellow
else if isDeepDiscount
statusColor := color.blue
else if isCheap
statusColor := color.aqua
else if isBelowNormal
statusColor := color.teal
else
statusColor := color.gray
//====================================================
// PLOTS — PRICE-REACTIVE ONLY
//====================================================
plot(showHistogram ? smoothedReactivePE : na, title="Smoothed Price-Reactive Forward P/E Histogram", style=plot.style_columns, color=color.new(dynamicColor, 45))
plot(showReportedLine ? reportedPE : na, title="Reported Forward P/E Step Line", color=color.new(color.white, 65), linewidth=1, style=plot.style_stepline)
plot(smoothedReactivePE, title="Price-Reactive Forward P/E", color=dynamicColor, linewidth=3)
plot(signalLine, title="Price-Reactive Forward P/E Signal Line", color=color.new(color.yellow, 0), linewidth=2)
p95Plot = plot(showAdaptiveBands ? rP95 : na, title="Reactive 95th Percentile", color=color.new(color.red, 20), linewidth=2)
p90Plot = plot(showAdaptiveBands ? rP90 : na, title="Reactive 90th Percentile", color=color.new(color.red, 65), linewidth=1)
p75Plot = plot(showAdaptiveBands ? rP75 : na, title="Reactive 75th Percentile", color=color.new(color.gray, 75), linewidth=1)
p50Plot = plot(showAdaptiveBands ? rP50 : na, title="Reactive 50th Percentile / Median", color=color.new(color.gray, 20), linewidth=2)
p25Plot = plot(showAdaptiveBands ? rP25 : na, title="Reactive 25th Percentile", color=color.new(color.gray, 75), linewidth=1)
p10Plot = plot(showAdaptiveBands ? rP10 : na, title="Reactive 10th Percentile", color=color.new(color.blue, 65), linewidth=1)
p05Plot = plot(showAdaptiveBands ? rP05 : na, title="Reactive 5th Percentile", color=color.new(color.blue, 20), linewidth=2)
fill(p95Plot, p90Plot, color=showAdaptiveBands and showZoneFills ? color.new(color.red, 88) : na, title="Reactive Expensive Zone Fill")
fill(p10Plot, p05Plot, color=showAdaptiveBands and showZoneFills ? color.new(color.blue, 88) : na, title="Reactive Cheap Zone Fill")
fill(p75Plot, p25Plot, color=showAdaptiveBands and showZoneFills ? color.new(color.gray, 94) : na, title="Reactive Normal Zone Fill")
plot(showFixedBands ? fixedUpper1 : na, title="Fixed Upper Band 1", color=color.new(color.orange, 45), linewidth=1)
plot(showFixedBands ? fixedUpper2 : na, title="Fixed Upper Band 2", color=color.new(color.red, 45), linewidth=1)
plot(showFixedBands ? fixedLower1 : na, title="Fixed Lower Band 1", color=color.new(color.aqua, 45), linewidth=1)
plot(showFixedBands ? fixedLower2 : na, title="Fixed Lower Band 2", color=color.new(color.blue, 45), linewidth=1)
bgcolor(showBgHighlight and isExtremeExpensive ? color.new(color.red, 90) : showBgHighlight and isDeepDiscount ? color.new(color.blue, 90) : na)
//====================================================
// TABLE
//====================================================
f_x(_value) =>
na(_value) ? "n/a" : str.tostring(_value, "#.##") + "x"
f_pct(_value) =>
na(_value) ? "n/a" : str.tostring(_value, "#.##") + "%"
f_num(_value) =>
na(_value) ? "n/a" : str.tostring(_value, "#.##")
f_price(_value) =>
na(_value) ? "n/a" : str.tostring(_value, format.mintick)
f_bars(_value) =>
na(_value) ? "n/a" : str.tostring(_value, "#")
var table infoTable = table.new(position.top_right, 2, 18, border_width=1, border_color=color.new(color.gray, 75))
if showTable and barstate.islast
table.cell(infoTable, 0, 0, "Metric", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(infoTable, 1, 0, "Current", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(infoTable, 0, 1, "Reactive / Reported P/E", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 1, f_x(priceReactivePE) + " / " + f_x(reportedPE), text_color=color.white, bgcolor=color.new(dynamicColor, 25))
table.cell(infoTable, 0, 2, "Smoothed Reactive P/E", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 2, f_x(smoothedReactivePE), text_color=color.white, bgcolor=color.new(dynamicColor, 25))
table.cell(infoTable, 0, 3, "Anchored Forward EPS", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 3, f_price(anchoredForwardEPS), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 4, "Reactive / Reported Rank", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 4, f_pct(reactivePercentRank) + " / " + f_pct(reportedPercentRank), text_color=color.white, bgcolor=color.new(dynamicColor, 25))
table.cell(infoTable, 0, 5, "Reactive / Reported Median", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 5, f_x(rP50) + " / " + f_x(reportedP50), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 6, "Reactive / Reported Premium", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 6, f_pct(reactivePremiumToMedian) + " / " + f_pct(reportedPremiumToMedian), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 7, "Reactive / Reported P95", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 7, f_x(rP95) + " / " + f_x(reportedP95), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 8, "Reactive / Reported P05", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 8, f_x(rP05) + " / " + f_x(reportedP05), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 9, "Reactive / Reported Yield", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 9, f_pct(reactiveEarningsYield) + " / " + f_pct(reportedEarningsYield), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 10, "Reactive Room to P95", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 10, f_x(reactiveRoomToP95), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 11, "Reactive Room above P05", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 11, f_x(reactiveRoomAboveP05), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 12, "EPS / Multiple Trend", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 12, epsTrendText + " / " + multipleTrendText, text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 13, "Driver", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 13, driverText, text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 14, "PEG / Fwd P/S", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 14, f_x(pegRatioData) + " / " + f_x(forwardPSData), text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 15, "Data Quality", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 15, reactiveDataQualityText + " / " + effectivePeriod + " / " + f_bars(barsSinceReportedUpdate) + " bars since anchor", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 0, 16, "Reactive Status", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 16, reactiveStatusText, text_color=color.white, bgcolor=color.new(statusColor, 20))
table.cell(infoTable, 0, 17, "Reported Status", text_color=color.white, bgcolor=color.new(color.black, 50))
table.cell(infoTable, 1, 17, reportedStatusText, text_color=color.white, bgcolor=color.new(color.black, 50))
if not showTable and barstate.islast
table.clear(infoTable, 0, 0, 1, 17)
//====================================================
// ALERTS — PRICE-REACTIVE ONLY
//====================================================
crossOver95 = ta.crossover(reactivePercentRank, 95)
crossUnder95 = ta.crossunder(reactivePercentRank, 95)
crossOver90 = ta.crossover(reactivePercentRank, 90)
crossUnder90 = ta.crossunder(reactivePercentRank, 90)
crossUnder5 = ta.crossunder(reactivePercentRank, 5)
crossOver5 = ta.crossover(reactivePercentRank, 5)
crossUnder10 = ta.crossunder(reactivePercentRank, 10)
crossOver10 = ta.crossover(reactivePercentRank, 10)
crossOverMedian = ta.crossover(rankReactivePE, rP50)
crossUnderMedian = ta.crossunder(rankReactivePE, rP50)
peCrossAboveSignal = ta.crossover(smoothedReactivePE, signalLine)
peCrossBelowSignal = ta.crossunder(smoothedReactivePE, signalLine)
enteredExtremeExpensive = isReady and crossOver95
exitedExtremeExpensive = isReady and crossUnder95
enteredExpensive = isReady and crossOver90
exitedExpensive = isReady and crossUnder90
enteredDeepDiscount = isReady and crossUnder5
exitedDeepDiscount = isReady and crossOver5
enteredCheap = isReady and crossUnder10
exitedCheap = isReady and crossOver10
expensiveMultipleCompression = isReady and reactivePercentRank >= 90 and peCrossBelowSignal
cheapReRating = isReady and reactivePercentRank <= 10 and peCrossAboveSignal
alertcondition(enteredExtremeExpensive, title="Entered Extreme Expensive Zone", message="Price-reactive forward P/E entered its 95th percentile extreme expensive zone.")
alertcondition(exitedExtremeExpensive, title="Exited Extreme Expensive Zone", message="Price-reactive forward P/E exited its 95th percentile extreme expensive zone.")
alertcondition(enteredExpensive, title="Entered Expensive Zone", message="Price-reactive forward P/E entered its 90th percentile expensive zone.")
alertcondition(exitedExpensive, title="Exited Expensive Zone", message="Price-reactive forward P/E exited its 90th percentile expensive zone.")
alertcondition(enteredDeepDiscount, title="Entered Deep Discount Zone", message="Price-reactive forward P/E entered its 5th percentile deep discount zone.")
alertcondition(exitedDeepDiscount, title="Exited Deep Discount Zone", message="Price-reactive forward P/E exited its 5th percentile deep discount zone.")
alertcondition(enteredCheap, title="Entered Historically Cheap Zone", message="Price-reactive forward P/E entered its 10th percentile historically cheap zone.")
alertcondition(exitedCheap, title="Exited Historically Cheap Zone", message="Price-reactive forward P/E exited its 10th percentile historically cheap zone.")
alertcondition(crossOverMedian, title="Reactive P/E Crossed Above Median", message="Price-reactive forward P/E crossed above its historical median.")
alertcondition(crossUnderMedian, title="Reactive P/E Crossed Below Median", message="Price-reactive forward P/E crossed below its historical median.")
alertcondition(expensiveMultipleCompression, title="Expensive Multiple Compression Warning", message="Price-reactive forward P/E is historically expensive and crossed below its signal line.")
alertcondition(cheapReRating, title="Cheap Re-Rating Warning", message="Price-reactive forward P/E is historically cheap and crossed above its signal line.") Индикатор

Cost Basis Map [FEELS]Who is in profit at this level, and who is trapped? Cost Basis Map estimates the answer for any symbol and any timeframe from nothing but price and volume. On-chain analytics answers the same question for Bitcoin with realized price and supply in profit, but those metrics need blockchain data, so they stop at BTC. This script rebuilds that framework from OHLCV for everything else.
The headline number is the share of open positions that is underwater right now. Everything else on the chart is built from the same ledger.
HOW THE LEDGER WORKS
The script maintains a ledger of open positions. Every bar adds its traded volume to the ledger at that bar's price, and the same volume closes a proportional share of the older positions. Old entries rotate out at a pace set by turnover rather than time: a few high-volume bars can replace a big part of the book, a quiet stretch barely touches it. The result is a bar-by-bar estimate of which positions are still open and what they paid. From it the script derives:
- Break-even line: the volume-weighted average entry of all open positions. This is the market's collective cost basis, the same construction on-chain research calls realized price.
- Underwater share: the % of open positions whose entry sits above the current price. It drives the headline, the fill color and the sentiment states (euphoria, healthy uptrend, mixed, majority trapped, extreme pain).
- Open-positions profile: the right-side histogram shows where the open positions were entered. Red rows above price are trapped positions waiting overhead, which tends to act as resistance and as squeeze fuel once price runs through it. Teal rows below are holders in profit, where support usually forms. The widest row is tagged as the heaviest entries.
- Capitulation marker: printed when an unusually large amount of volume (a z-score test) realizes losses below break-even. On everything I tested these cluster near major bottoms.
- Euphoria marker: printed when nearly every position is in profit and turnover is elevated, a condition typical of late trend.
- Recent entries line: the average entry of the newest cohort, the positions most likely to panic or chase first.
Positions are money-weighted by default (volume × price), with an option to weight by raw volume units instead.
HOW TO TRADE IT
1. Regime first. Price holding above a rising break-even line with a low underwater share is a healthy trend, and pullbacks into the line are buyable by ordinary trend rules. When price loses the break-even line the regime flips: the average holder is now at a loss, and rallies back into the line run into their exit orders.
2. Read the profile as a map of who needs what. Heavy red rows above price mark where trapped holders wait to break even, so expect supply there. Heavy teal rows below mark profitable entries that tend to get defended.
3. Extremes are mean-reversion territory. A capitulation marker on top of an extreme underwater share has marked the areas where selling exhausts. A euphoria marker with a single-digit underwater share is the same warning on the upside.
HONESTY
This is an estimation model built from price and volume. Real per-account position data does not exist anywhere on any platform; on-chain analytics estimates it too, just from a different source. The model's assumptions are simple and disclosed: entries at the bar's typical price, proportional volume-driven rotation of old positions. A fixed marker cooldown keeps signal episodes readable. Markers print on bar close and do not repaint. The tool is most informative on volatile assets and intraday-to-daily timeframes; on slow index weeklies the market spends years in profit and the picture is honestly boring. Volume quality matters: prefer a real exchange feed (e.g. Bitstamp, Coinbase, a specific futures contract) over composite indices, because aggregated feeds smooth out the volume spikes the engine reads. On symbols with no volume data the script falls back to equal weighting.
ALERTS
Cost basis reclaimed · Cost basis lost · Majority underwater (60%+) · Nearly all in profit · Capitulation volume · Euphoria turnover.
SETTINGS
Every input has a tooltip. The main ones: "Position memory" sets how long the ledger remembers (volume-weighted), "Ledger resolution" sets the price granularity, profile size/spacing and all colors are adjustable, "Text size" scales the captions for presentations.
ORIGINALITY
A volume profile shows where volume traded. This ledger goes one step further and estimates which of those positions are still open and what they paid, i.e. cost-basis analytics of the kind used in on-chain research, reconstructed from OHLCV for any market. The break-even line is not an MA or a VWAP band in disguise: it is computed from the position ledger, not from a lookback window. Engine and rendering are written from scratch. Индикатор

Индикатор

Индикатор

AlgoZ Pro Price ActionAlgoZ Pro Price Action is a clean price action based forex indicator built to help traders identify potential Buy, Sell, and Exit areas using a combination of market structure, trend filtering, volatility logic, and dynamic trade management.
This indicator is designed around the idea that not every trade needs to have a high win rate to be useful. Instead of only looking for quick scalp targets, AlgoZ Pro Price Action is built to manage trades with a runner-style approach. The goal is to cut weak trades faster, protect trades that start moving in the right direction, and allow stronger moves to continue when momentum is present.
The default settings are best suited for 1-minute EUR/USD forex trading. Other forex pairs and timeframes may work differently and should be tested before use.
The indicator uses market structure breaks to identify possible directional shifts. When price breaks key internal support or resistance levels, the script checks multiple filters before plotting a signal. These filters are designed to reduce low-quality signals during chop, weak momentum, or overextended conditions.
AlgoZ Pro Price Action includes Buy, Sell, and Exit labels directly on the chart. Buy signals are shown in teal, Sell signals are shown in pink, and Exit signals are shown in a neutral color. The bars can also be colored based on the active signal direction so it is easier to visually track the current market bias.
One of the main parts of this indicator is the trend lock system. The trend lock helps prevent the indicator from flipping back and forth too quickly during noisy market conditions. It uses EMA trend structure, slope behavior, and confirmation bars to decide whether the market is currently favoring Buy-side or Sell-side continuation. Countertrend signals must be stronger before they are allowed through, which helps reduce random reversal signals during an active move.
The indicator also includes automatic forex pair adjustment. It detects whether the chart is a JPY pair or a non-JPY forex pair and automatically adjusts pip size calculations. This helps prevent issues where a stop or exit calculation is too tight or too wide because of the symbol’s price format. The script also includes auto volatility tuning, which uses ATR-based logic to scale stop size, runner triggers, trailing stop distance, dead-trade protection, and cooldown behavior based on the current pair’s movement.
Trade management is handled through a dynamic exit engine. Instead of using only fixed take profit levels, the indicator uses runner logic. Once a trade moves far enough in profit, the trade can enter runner mode. From there, the script can move the stop, protect profit, and trail the trade if the move continues. This allows stronger trades to breathe while still giving the indicator a way to exit when momentum fades.
AlgoZ Pro Price Action also includes dead-trade protection. If a trade has been open for a certain number of bars and has failed to make meaningful progress, the script can plot an Exit signal. This is designed to help remove weak trades that are not moving enough to justify staying in them.
The indicator includes several optional filters and controls, including EMA trend filtering, ADX strength filtering, chop filtering, candle body quality filtering, minimum EMA separation, price distance from the slow EMA, overextension protection, post-exit cooldown, and emergency protection logic.
Main features include:
• Buy, Sell, and Exit labels
• Teal and pink AlgoZ Pro visual theme
• Price action and market structure based signals
• Internal support and resistance break logic
• Optional BOS / CHoCH structure markings
• EMA trend filtering
• ADX trend strength filter
• Chop and range filter
• Candle quality filter
• Trend lock system
• Countertrend signal protection
• Auto pip size detection
• Auto adjustment for JPY and non-JPY forex pairs
• ATR-based auto pair tuning
• Dynamic stop logic
• Runner-style trade management
• Breakeven / profit lock logic
• Trailing stop logic for stronger moves
• Dead-trade exit protection
• Optional bar coloring
• Optional entry and stop lines
• Optional status table
Recommended default use:
1-minute EUR/USD forex chart.
Other forex pairs and timeframes may require adjustment depending on spread, volatility, session, and market conditions. Индикатор

HTF Support/Resistance Multi-TapThe HTF Multi-Tap S/R Zones is an advanced structural indicator designed for lower timeframe traders who need higher timeframe confluence without cluttering their charts.
Instead of drawing infinite lines everywhere, this indicator tracks historical pivot points from a Higher Timeframe (HTF) of your choice and dynamically builds highly-validated "Zones of Interest" directly onto your current chart. It is specifically engineered to find areas where price has repeatedly struggled to break through.
Core Features:
Dynamic Wick Absorption (Zones): When price wicks into the same general area, the script doesn't just plot a single static line. It dynamically expands the top and bottom borders of a "Zone" to encompass the full range of the historical wicks, giving you a literal block of rejection to trade against.
Zone Merging: If two adjacent zones expand enough to touch each other, the indicator will seamlessly merge them into one massive, highly significant structural block.
Volume & Tap Tracking: Every time price taps a zone, the script records the touch and pulls the exact volume that occurred on that HTF candle. The zone's label clearly displays the total accumulated volume and the number of taps it took to build it.
Automated Volume Grading: The indicator continuously scans the active zones on your chart and automatically tags the zone with the absolute highest historical volume with a (⭐ Max Vol) label, instantly showing you the strongest defensive wall on the board.
Clean & Focused: By default, it only displays the 3 closest Support zones and the 3 closest Resistance zones to the current price, keeping your chart clean and focused strictly on the levels that matter right now.
How to Use (Confluence):
This is not a standalone entry signal; it is a confluence tool.
If you are trading on a 1-minute or 5-minute chart, set the indicator's HTF to 15m or 1H. Use these projected zones as high-probability areas to look for your lower timeframe entry models (like break of structure, fair value gaps, or engulfing candles). The (⭐ Max Vol) zones are prime locations for strong reversals or major breakout continuations.
Settings:
Higher Timeframe: Choose which timeframe to pull structural pivots from.
Proximity Threshold %: Adjust how close price needs to come to an existing zone to be considered a "Tap" and expand the box. Increase this slightly for highly volatile assets to absorb larger wicks.
Minimum Taps: Determine how many times a level must be tested before it is considered valid and plotted on your screen.
Индикатор

Swing Ladder Trend Engine [Jayadev Rana]OVERVIEW
Swing Ladder Trend Engine is a pure price-action trend-following tool. It builds its entire read of the market from confirmed swing highs and swing lows — no moving averages, no ATR, no oscillators. From that swing structure it derives three things: the current trend state, entry and exit signals, and a structure-anchored trailing stop (the "ladder") that only steps in the direction of the trade.
HOW IT WORKS
1. Swing structure. Confirmed pivot highs and lows (Swing Detection Length bars on each side) are classified as HH, HL, LH or LL and tagged on the chart.
2. Trend engine. When a bar closes beyond the most recent confirmed swing high, the trend state flips bullish; a close below the last confirmed swing low flips it bearish. Each swing level can only be broken once, so continuation breaks are tracked cleanly and bars are tinted by the active trend.
3. Ladder stop. Instead of a volatility trail, the stop is anchored to structure itself: in an uptrend it sits below the last confirmed swing low, offset by a configurable percentage of the current swing range, and it can only ratchet upward as new higher lows confirm. The result is a stepped "ladder" that gives the trade room where structure says it needs room, and tightens where structure tightens.
4. Pullback-quality entries. In the default Pullback mode a structure break only arms a setup. The entry itself requires the market to retrace into the breakout leg (between the Min and Max Retracement %), and then print a resumption candle: a close beyond the previous bar's extreme with a directional body of at least the Trigger Body Dominance fraction of its range. Retracements deeper than the maximum void the setup. A Breakout mode is included for traders who prefer to enter on the structure break itself.
SIGNALS: ENTRY, EXIT AND STOP
LONG / SHORT labels mark entries; the label tooltip stores the entry price and the ladder stop at that moment. A trade is closed either when price closes through the ladder stop or when the structure flips against it — the ✕ exit label's tooltip reports the reason and the approximate result in R (risk multiples, measured from entry to the initial ladder stop). All signals are evaluated on confirmed bars only.
DASHBOARD AND ALERTS
A compact dashboard shows the live trend state, the latest swing structure tags, the active signal, the current ladder stop level and the open trade's running R. Six alerts are available: long entry, short entry, exit long, exit short, and bullish/bearish trend flips.
SETTINGS
Swing Detection Length controls the size of the structure being tracked (larger = bigger swings, later confirmation). Entry Mode switches between Pullback and Breakout logic. Min/Max Retracement % and Trigger Body Dominance define what counts as a quality pullback entry. Stop Buffer sets how far beyond the protected swing the ladder sits, as a % of the current swing range. Dashboard position/size, structure labels, bar coloring and colors are all configurable.
LIMITATIONS
Swing points confirm only after the chosen number of right-side bars, so structure tags appear with a delay by design — this is what keeps the logic non-repainting on confirmed bars. Signals fire on bar close, not intrabar. Like any trend-following method, it gives back ground in choppy, range-bound conditions; the pullback filters reduce but do not remove that. R values shown in tooltips and the dashboard are approximations based on closing prices and do not account for gaps, fees or slippage. This is an analysis tool, not financial advice — always test settings on your own market and timeframe before relying on them.
WHY IT IS ORIGINAL
The combination of a swing-anchored ratcheting stop whose buffer adapts to the current swing range, plus an entry gate built from retracement depth and candle body dominance — all derived exclusively from raw price structure — is what this script contributes. It is not a mashup of built-in indicators; every state in the engine comes from the swing ladder itself. Индикатор

Potential Well MapOverview
A volume or time profile tells you where price spent time. Potential Well Map tells you the forces acting at each level. It models the market as a particle drifting in a one-dimensional energy landscape and estimates that landscape directly from recent price action — the local drift (average next move) and diffusion (variance of the next move) at each price level — then integrates them into a potential curve. Its valleys are attractors (dynamical support/resistance that pulls price in); its peaks are barriers (levels price is repelled from). Two levels with identical occupancy can be opposite in dynamics — one an attractor, one a barrier — and this map tells them apart. It is a descriptive structure-and-risk map, not a predictive signal.
Why these components are ONE tool (mashup justification)
This is a four-stage chain where each stage produces something the previous one can't, and the honesty layer keeps the whole thing accountable:
Drift + diffusion per level — the raw forces. For every price bin, exponentially-decayed accumulators track the count, sum, and sum-of-squares of the next one-bar move that started there, giving the conditional first two moments (drift and diffusion) with recent regime weighted most. This is O(N) per bar — no window rebuild, no timeout.
The potential curve — the integral of drift ÷ diffusion. This turns the raw forces into a landscape whose valleys and peaks are attractors and barriers. It is the object an occupancy profile fundamentally cannot produce, because occupancy measures time spent, not the pull at a level.
Escape pressure — a bounded 0–100 breakout gauge derived from the remaining wall height between price and the nearest barrier. Because the potential is already diffusion-normalized, the escape factor is a clean exponential of the wall height, and it concentrates toward 100 as price approaches a wall.
The calibration harness — the honesty layer. When a barrier escape is flagged, did price actually travel that way more often than the unconditional base rate? It reports Hit / Base / Edge, resolved forward on confirmed bars only. The forces are a picture; the harness is the proof. Remove any one stage and the map either asserts structure it never tested, or shows a level with no dynamics behind it.
How it works
Price is detrended into a coordinate x = ln(price) − ln(slow anchor) so the distribution stays roughly centred as price trends. A grid of x-bins spans a few volatility units either side of zero. For each bin, the decayed accumulators build drift and diffusion; neighbour bins are sample-weighted-smoothed; the force (drift ÷ diffusion) is integrated into the potential; valleys and peaks that clear a prominence margin are marked as wells and barriers; and the escape pressure to each adjacent barrier is computed. Bins with too few effective samples are greyed out rather than trusted.
How to use it
Read the landscape as context. The green valley line is the active attractor — a mean-revert target. The dashed red lines are the barriers above and below. The shaded box is the expected range of a stiff well. In the dashboard, the escape pressures rise toward 100 as price nears a wall; a pin (fade-to-mean) is flagged only when price sits mid-well in a stiff, bounded valley, and an escape is flagged when price crosses a barrier after that side's pressure was already elevated. Watch the Edge row: a positive, matured Edge means escapes have led price on this instrument; near-zero means treat the map as structure only, not a trigger. It is never a standalone signal.
Universal & non-repainting
The source is an input and everything is self-scaling (vol-scaled grid, detrended coordinate), so it runs on any symbol and timeframe; defaults suit a liquid index/futures intraday chart. All statistics use closed past bars only — both the drift/diffusion accumulators and the calibration harness update solely on confirmed bars, so their numbers never inflate intrabar. The displayed landscape naturally evolves bar to bar because it is a live estimate, not a fixed level; confirmed escape and pin marks settle on the close of their bar. Edge figures are in-sample, close-to-close, with no costs — a study aid, not a backtest.
Originality
The building blocks are public physics and statistics: stochastic drift-diffusion dynamics, conditional-moment estimation of the drift and diffusion coefficients, and escape-rate theory. What's original is the application to a price series as a live, decayed, per-level energy landscape — the detrended coordinate, the exponential-memory conditional-moment accumulators, the diffusion-normalized potential integral, the prominence-gated well/barrier detection, the escape-pressure gauge, and the forward-calibration harness that scores escapes against their base rate. This is a clean-room implementation; no third-party Pine code is reused.
Concept credits
Stochastic drift-diffusion (Langevin) dynamics and the Fokker–Planck description of a probability landscape — Paul Langevin, Adriaan Fokker, Max Planck
Estimating drift and diffusion from the conditional moments of increments (Kramers–Moyal expansion) — Hendrik Kramers, José Enrique Moyal; exposition after Hannes Risken
Barrier escape / escape-rate theory — Kramers' escape-rate framework
Forward base-rate calibration discipline — standard out-of-sample evaluation practice
Disclaimer
Research and educational tool only. Not financial advice, no recommendation, no guarantee of results. It is an effective, empirical 1-D approximation of a memoryful, multi-factor market — treat "escape pressure" as a relative, normalized gauge, not a literal probability. Estimates are noisy where samples are sparse (the greyed bins). Indicators describe past behaviour; they do not predict the future. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability. Индикатор

Regime Classifier [RC Tools]RC Tools — Regime Classifier
─────────────────────────────────────────────────────────────
█ OVERVIEW
Most indicators assume a single market condition and quietly fail in another. This tool doesn't generate signals — it tells you which of four market regimes you are currently in, so you can judge whether your existing tools are operating in conditions that suit them. It is a context tool, not a decision tool.
█ WHAT IT DOES
Classifies each confirmed bar into one of four states and colours the chart background accordingly:
• Trending — Expansion: directional, volatility rising
• Trending — Exhaustion: directional, volatility compressing
• Ranging — Quiet: no direction, low volatility
• Ranging — Volatile: no direction, high volatility (chop)
A table (top-right by default, repositionable) shows the current regime, how long price has been in it, and historical base rates — the average forward return and win rate seen after each regime, going back over the chart's full history.
█ THE THEORY BEHIND IT
Market behaviour is not stationary. A trend-following tool that performs well in directional expansion will bleed in volatile chop; a mean-reversion tool does the reverse. Rather than attempting to fix any single indicator, this tool identifies which environment you are in, using two independent dimensions — directionality and volatility state — that measure genuinely different properties of price behaviour rather than two correlated views of the same one.
█ HOW IT IS CALCULATED
DIRECTIONALITY — Efficiency Ratio over N bars:
ER = |close − close | ÷ Σ|close − close |
Bounded 0–1. A value near 1 means price travelled almost directly from A to B (trending); near 0 means it wandered (ranging). No fitted parameters beyond the lookback. The Efficiency Ratio was introduced by Perry Kaufman as the core input to his Adaptive Moving Average (KAMA); it is used here purely as a directionality measure, independent of any moving average.
VOLATILITY STATE — realised volatility, percentile-ranked:
RV = stdev(log(close/close ), N)
RV is then ranked as a percentile against its own trailing distribution (default: 750 bars, ≈3 years on daily). An absolute volatility threshold is meaningless across assets — percentile ranking makes the classification behave identically on BTC, gold and equities with no parameter tuning.
The two dimensions are crossed to yield the four states. Classification occurs ONLY on confirmed bar close — the background never updates mid-bar and then flips back.
The base-rate table works by recording, for every historical bar, the forward N-bar return and whether it was positive, attributed back to whichever regime was active N bars earlier. Only fully-elapsed, already-known returns are used — nothing is looked up ahead of the current bar.
█ SETTINGS & CONFIGURATION
• Efficiency Ratio Lookback (default 20) — shorter = more responsive, noisier
• Realised Volatility Lookback (default 20)
• Percentile Ranking Window (default 750 bars ≈ 3 years daily) — longer = more stable, needs more history
• Directionality Threshold (default 0.35) — the ER above which price is considered trending
• Volatility Percentile Threshold (default 50) — the split between low and high volatility states
• Forward Return Window (default 20 bars) — the horizon used for the base-rate table
• Table position and background colours are fully configurable; the main-chart background painting can be toggled off if you only want the diagnostic pane
█ HOW TO USE IT
Use it as a filter on your existing process, not as an entry trigger. Example: if you run a breakout system, check whether it has historically performed in Ranging — Volatile; if not, consider standing aside when the background flags that state. Example: a mean-reversion system will typically show its worst results in Trending — Expansion.
Works on any asset and timeframe with sufficient history for the percentile window. Best used on daily and above, where regime persistence is greatest.
█ LIMITATIONS
This tool classifies the PRESENT. It does not predict the future, and any use of it as a forecast is a misuse.
• Regime identification is backward-looking by construction. The tool will confirm a regime change several bars AFTER it occurred. This lag cannot be removed without curve-fitting or repainting, and has not been.
• Classification is unstable near threshold boundaries; expect flickering between states when ER or volatility percentile sit close to the cut-offs.
• The percentile ranking requires substantial history. On assets with short histories, the ranking is unreliable and the tool should not be trusted.
• The base-rate table's early entries are built on fewer samples than its later ones — treat statistics as provisional until a state has accumulated a meaningful sample count.
• Four states is a deliberate simplification of a continuous reality. Markets do not actually occupy discrete regimes.
• This script does NOT repaint. All classification is computed on confirmed bar close only.
█ DISCLAIMER
For educational and informational purposes only. Nothing here is financial advice. Past behaviour of any market regime does not indicate future results. Trade at your own risk.
Индикатор

ICT Pulse - Bias & Stats DashboardICT Pulse — Bias & Session Dashboard
ICT Pulse is a dashboard-style indicator designed to summarize higher-timeframe context, session status, and liquidity conditions for discretionary ICT-style futures trading.
The script does not generate buy or sell signals. Its purpose is to organize market context into a compact dashboard so traders can quickly understand where price is trading relative to previous ranges and whether session liquidity has been taken.
How it works
ICT Pulse compares the current price to the previous daily, weekly, and monthly ranges. For each range, it calculates whether price is trading in premium or discount by measuring the current close relative to the prior high, low, and midpoint.
The dashboard then combines this higher-timeframe information with session conditions. It tracks the active Asia, London, and New York sessions, records each session’s high and low, and monitors whether those levels have later been traded through.
The confluence score is a simple context score, not a signal system. Bullish and bearish scores are built from five conditions:
* Daily range position
* Weekly range position
* Monthly range position
* Whether opposing-side liquidity has been taken
* Whether price is above or below the active session midpoint
For example, the bullish score increases when price is in premium on higher timeframes, when downside liquidity has been taken, and when price is holding above the current session midpoint. The bearish score uses the opposite conditions.
Main features
* Daily, weekly, and monthly bias summary
* Premium/discount status for previous daily, weekly, and monthly ranges
* Active session detection
* Current session range tracking
* Asia, London, and New York high/low sweep status
* Bullish and bearish confluence score
* Dashboard-only layout to reduce chart clutter
How to use it
ICT Pulse is best used as a market-context tool before looking for entries. A trader can use it to check whether higher-timeframe conditions are aligned, whether important session liquidity has already been taken, and whether the current session is supporting bullish, bearish, or neutral conditions.
Suggested workflow:
1. Check daily, weekly, and monthly bias.
2. Check whether price is in premium or discount.
3. Check whether Asia, London, or New York liquidity has been taken.
4. Compare the bullish and bearish confluence scores.
5. Use a separate execution model for entries, stops, and trade management.
This script is intended for educational and analytical use only. It does not provide financial advice, trade recommendations, or guaranteed outcomes. Futures and financial market trading involves risk.
Индикатор

Bitcoin Almanac [WillyAlgoTrader]₿ Bitcoin Almanac is an overlay indicator that maps the entire Bitcoin macro landscape on one chart: a fixed-length cycle time model (bull/bear phases projected from a single anchor date), two hyperbolic curves fitted through historical cycle lows and cycle highs in log-price space, Fibonacci grids stretched between every macro pivot, halving markers, accumulation and distribution zones, and a hypothetical price path for the next bull leg — all summarized in a live dashboard with projected turn dates, curve prices, and historical correction depths.
The core insight: Bitcoin's completed cycles show a remarkably stable time rhythm (roughly 1064 days up, 364 days down) and a decelerating growth pattern that a hyperbola in log10(price) captures with surprisingly small error. Neither observation is a law of nature — but when the time model and the price curves are combined on one chart, they produce concrete, falsifiable reference points: a projected top date with a curve price, a projected bottom date with a curve price, and buy/sell zones derived from both. The indicator makes the whole framework explicit, configurable, and honest about its assumptions.
Everything is driven by dates and user-defined pivots — not by real-time price action — so nothing repaints: the lines you see today are the lines you saw yesterday.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A cycle-date model alone answers WHEN but not AT WHAT PRICE. A curve through historical lows answers WHERE support migrates but not WHEN price will meet it. Fibonacci retracements answer WHERE pullbacks tend to end, but only if you know which macro leg to anchor them to. Used separately, each tool leaves you guessing at the missing dimension.
Bitcoin Almanac chains them into one pipeline:
Cycle time model (anchor + phase lengths) → projected turn dates → hyperbolic lows/highs curves → curve price AT each projected date → Fibonacci grids between macro pivots → 0.786–0.836 accumulation zones bounded by cycle end dates → ±% distribution zones around each high → replayed bull-path projection between the two curve endpoints → dashboard synthesis
The time model supplies the X-coordinate of every future event. The two hyperbolas supply the Y-coordinate: the lows curve is evaluated exactly at the projected bottom date, the highs curve exactly at the projected top date — the "◎ cycle × curve" labels mark these intersections with date and price. The Fibonacci grids are then anchored to the same pivots the curves are built from, so the 0.786–0.836 buy zone of the current leg stretches in time precisely to the model's next cycle-bottom date. Finally, the projection module takes the two curve × date intersections as endpoints and fills the path between them by replaying the shape of the previous bull phase in log space.
No single component can do this: the intersection of an independent time model with an independent price model is what turns two vague trajectories into specific, checkable coordinates.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Fixed-rhythm cycle engine — pure time math, zero price input.
The phase of any bar is computed directly from calendar time:
daysSince = (barTime − anchor) / 86 400 000
phasePos = daysSince mod (bullDays + bearDays)
isBull = phasePos < bullDays
Defaults: anchor = 07 Nov 2022, bullDays = 1064, bearDays = 364 (each ≈ the average of the three completed BTC cycles). A true mathematical modulo (always ≥ 0) phases bars BEFORE the anchor correctly, so past cycles line up too. With defaults this reproduces the well-known projected dates: top ≈ 06 Oct 2025, bottom ≈ 05 Oct 2026. An alternative anchor (21 Nov 2022 — the actual lowest trade of the cycle) is documented right in the input tooltip and shifts the bottom to 19 Oct 2026.
Why this matters: because the phase depends only on time, the bull/bear background, turn lines and flip alerts are deterministic and cannot repaint — the model's claims are fully falsifiable in advance.
2️⃣ Hyperbolic curve through cycle lows — exact geometry or least-squares fit, with the error printed on the chart.
The lows model is log10(price) = a + b / (c − t), where t is days from the first pivot. The hyperbola has a vertical asymptote in the past and a horizontal asymptote in the future — it encodes decelerating growth, which a straight log-regression line cannot.
— With exactly 3 enabled lows (default: Aug 2015 ≈ $169, Dec 2018 ≈ $3 122, Nov 2022 ≈ $15 476) the three parameters are solved exactly — the curve passes through the pivots by construction. This is geometry, not statistics, and the label says so: "exact through 3 lows".
— With 4+ enabled lows (three optional early-history slots: 2011, 2013, 2015 are provided) the indicator switches to a least-squares fit: a coarse log-spaced search over 250 candidate asymptote positions, followed by a 200-step linear refinement around the best candidate. The curve label then reports the number of points and the RMSE in log10 units — the fit quality is never hidden.
A fit is accepted only if b > 0 and the asymptote c lies before the earliest pivot — degenerate solutions are rejected and the curve simply doesn't draw.
3️⃣ Second independent hyperbola through cycle highs.
The same model is fitted to cycle tops (defaults: Nov 2013 ≈ $1 238, Dec 2017 ≈ $19 700, Nov 2021 ≈ $69 000, Oct 2025 ≈ $126 200 — four points, so LS fit with visible RMSE). A fifth, disabled slot exists only if you want to force the fit through your own future target; you never need it for the projection, because the future top is marked automatically at the crossing of the highs curve with the projected top date.
Why two curves: lows and highs decelerate at different rates. Fitting them independently (instead of offsetting one curve) lets the model express a narrowing channel without assuming its shape.
4️⃣ "Cycle × curve" intersection labels — the model's testable predictions.
At the projected bottom date the lows curve is evaluated: ◎ label with date ≈ price. At the projected top date the highs curve is evaluated: ◎ label with date ≈ price. These two points are the indicator's headline output — a date AND a price for each future turn, derived from two independent models. Both curves extend beyond their intersection as dashed lines (lows: default 10 years, highs: 5 years) to show the long-term trajectory.
5️⃣ Macro Fibonacci grids with a time-bounded 0.786–0.836 accumulation zone.
All enabled lows and highs are merged chronologically; every leg between two pivots of opposite type receives a grid (low→high = bull grid, high→low = bear grid; same-type neighbours are skipped). Levels are fully user-defined (default: 0, 0.236, 0.382, 0.5, 0.618, 0.786, 0.836, 0.886, 1; values > 1 add extensions).
Two non-standard options:
— Log-scale interpolation : level price = 10^(log10(pA) + f × (log10(pB) − log10(pA))) — matches a fib tool drawn on a log chart. Off by default (arithmetic levels for a linear chart).
— Reverse mode (default ON): ratio 0 sits at the END of the leg, so on a bull leg 0.618 is the classic retracement below the high.
The 0.786–0.836 zone of each bull leg is highlighted as a "BUY ZONE" box — and here is the original part: the box stretches in time from the leg start to the end date of the cycle the leg belongs to (the next projected cycle bottom). Depth from the fib model, deadline from the time model — the zone is a rectangle in (price × time), not just a price band.
6️⃣ Distribution zones tied to the cycle skeleton.
Every enabled high gets a "SELL ZONE" box spanning high ± sellPct (default 5% → from high × 0.95 to high × 1.05). The time span runs from the LATER of (a) the latest enabled low before that high or (b) the model's cycle bottom immediately preceding it — so a projected 2029 high starts its zone at the projected Oct-2026 bottom, not at a 2022 pivot. If no enabled high exists in the upcoming cycle, a projected sell zone is created automatically at the highs-curve × projected-date crossing (duplicate-guarded within half a cycle).
7️⃣ Bull-path projection — fractal replay of the previous bull, rescaled in log space.
The path for the NEXT bull phase (with defaults: 05 Oct 2026 → 03 Sep 2029) is drawn between two model-derived endpoints: start = lows curve at the projected bottom, end = highs curve at the following projected top. Two shapes:
— Replay last bull (default): the log-price trajectory of the previous bull phase is recorded bar by bar (confirmed bars only, thinned to ≤ 400 samples for memory safety on intraday timeframes), then linearly rescaled: y(progress) = yStart + (ref(progress) − ref(0)) × (yEnd − yStart) / (ref(1) − ref(0)). The result keeps the timing character of the last cycle — early acceleration, mid-cycle chop, late blow-off — mapped onto the new endpoints.
— Log-linear : a straight line on a log chart between the endpoints. The replay mode automatically falls back to log-linear if the reference phase covers less than 90% of the bull duration.
The path is explicitly labeled "◇ PROJECTED PATH (hypothetical)" — it is a scenario generator, not a forecast.
8️⃣ Corrections table — every macro drawdown since 2014, including the unfinished one.
The dashboard lists every completed high → following-low leg between enabled pivots since 2014 as a % drop (e.g. 2017–2018: −84%). If the latest pivot is a high with no low after it, the current correction is projected : measured from that high to the lows-curve price at the next model bottom, and marked "(proj.)" in accent color. You always see how the ongoing decline compares with history.
9️⃣ Full-transparency dashboard with a phase gauge and next-leg scenario PNL.
Four toggleable sections: Cycle (phase, day X / Y, ██████░░░░ progress gauge), Projection (top and bottom dates with days-left counters and curve prices, plus the hypothetical PNL of the next bull leg: (topCurve / bottomCurve − 1) × 100% and the × multiple), Corrections (see 8️⃣), Ranges (nearest upcoming buy range = the 0.786–0.836 zone prices; nearest sell range = the ±% zone around the next projected high). The footer states the calibration chart (INDEX:BTCUSD · W · linear scale, with a live ✓ when you're on it), a timeframe warning, and the sample-size caveat "⚠ Sample size: 3 cycles" — the model's biggest limitation is printed on the chart itself.
🔟 Efficient, tick-stable rendering.
All drawings (500+ polyline points, fib grids, boxes, dashboard) are anchored to bar-open times and first-bar curve fits — nothing changes within a bar. A redraw gate rebuilds them once per new bar instead of on every real-time tick, and both curve fits run exactly once on the first bar. The chart stays responsive even with all modules enabled.
📐 HOW IT WORKS — CALCULATION FLOW
Step 1 — Parse pivots: on the first bar, all enabled lows and highs are converted to (days-from-first-pivot, log10(price)) pairs.
Step 2 — Fit the curves: each set is fitted to log10(price) = a + b/(c − t) — exact solve for 3 points, two-stage least-squares search for 4+. Fit validity is checked (b > 0, asymptote before the data).
Step 3 — Phase every bar: calendar-time modulo against the anchor determines bull/bear phase, day-in-phase, and the timestamps of the current, next bottom and next top.
Step 4 — Evaluate intersections: the lows curve at the projected bottom date and the highs curve at the projected top date become the model's price targets.
Step 5 — Record the reference bull: during the anchor cycle's bull phase, confirmed closes are stored as (progress, log10 price) — the shape later replayed by the projection.
Step 6 — Draw (once per bar): turn lines and labels for N past and M future cycles, both hyperbolas with dashed extensions, fib grids per alternating pivot leg, buy/sell zone boxes, halving lines (2012 / 2016 / 2020 / 2024 solid, Apr 2028 dashed "(est.)"), the projected path, the dashboard and the watermark.
Step 7 — Alert: on confirmed bars, phase flips and the pre-turn countdown fire alert() calls in text or JSON format.
📖 HOW TO USE
🎯 Quick start:
1. Open the INDEX:BTCUSD chart, Weekly timeframe, regular (linear) price scale — the model is calibrated there, and the dashboard shows a ✓ when the symbol and timeframe match (the scale must be checked manually — Pine cannot detect it).
2. Add the indicator. The green/red background immediately shows the model's current phase; the dashboard shows the day count and progress gauge.
3. Find the two ◎ labels — the projected bottom (orange, lows curve) and the projected top (red, highs curve). These are the model's date + price coordinates for the next turns.
4. Check the yellow boxes: BUY ZONE (0.786–0.836 of the current bull leg, extended to the cycle end date) and SELL ZONE (±5% around each high).
5. Create ONE alert with condition "Any alert() function call" to receive flips and the pre-turn countdown.
👁️ Reading the chart:
— 🟢 Green background = model bull phase; 🔴 red = bear phase
— Solid green verticals = cycle bottoms; dashed red verticals = cycle tops; future turns are labeled ★ PROJECTED and drawn brighter
— 🟠 Orange curve = hyperbola through cycle lows (solid to the projected bottom, then dashed extension)
— 🔴 Red curve = hyperbola through cycle highs (solid to the projected top, then dashed extension)
— Small circles = the exact pivots each curve is built from
— ◎ labels = cycle × curve intersections with date, ≈ price, and fit info (point count + RMSE, or "exact through 3")
— Fib grids between macro pivots: solid edges (0 / 1), dashed 0.5, dotted intermediate levels, price + ratio labels on the right
— 🟡 Yellow boxes = BUY ZONE (0.786–0.836, time-bounded by the cycle end) and SELL ZONE (±% around highs; "(proj.)" = auto-generated at the projected top)
— ⛏ Grey verticals = halvings; the 2028 line is dashed and marked "(est.)"
— 🔵 Blue dashed path = hypothetical next-bull trajectory with its ◇ end label
📊 Dashboard fields:
— Phase / Phase day / Progress : current model phase, day within it, and a 10-segment gauge
— Proj. top / Proj. bottom : projected turn dates, days remaining, and the curve price at each date
— Next leg PNL : hypothetical bottom→top move of the next bull leg in % and as a × multiple — a scenario, not a forecast
— Corrections : every completed macro drawdown since 2014 (high → following low, %), plus the unfinished one projected to the curve bottom and marked (proj.)
— Next buy range / Next sell range : the price boundaries of the nearest upcoming accumulation and distribution zones
— Footer: recommended chart check, timeframe warning, sample-size caveat, version
🔧 Tuning guide:
— Curve doesn't draw: fewer than 3 pivots enabled, or the fit was rejected as degenerate — enable at least 3 lows (or highs) with sensible dates/prices.
— You disagree with a pivot price: every pivot is an editable date + price input — correct it and both the curve and the fib grids rebuild instantly.
— Want dates matching the actual price low: switch the anchor to 21 Nov 2022 (documented in the tooltip); the projected bottom moves to 19 Oct 2026.
— Fib levels look wrong on a log chart: enable "Log-scale levels" (keep it OFF on the recommended linear chart).
— Chart feels crowded: disable individual modules (grids, zones, halvings, projection) or dashboard sections — every block has its own switch.
— Curious about 2030+: enable "Show 2nd projected cycle" for one more bottom/top pair (~Sep 2030 / ~Aug 2033) — off by default because those dates carry double model uncertainty.
💡 Trading ideas:
— Accumulation planning : scale into the 0.786–0.836 BUY ZONE while the model is in its bear phase; the zone's right edge tells you the model's deadline.
— Distribution planning : scale out inside the ±5% SELL ZONE as the projected top date approaches; the pre-alert (default 30 days) gives you a heads-up.
— Scenario testing : move pivots, change phase lengths, or force High #5 to your own target and watch how the whole framework (curves, zones, PNL) responds — the model is a sandbox, not an oracle.
⚙️ KEY SETTINGS
⚙️ Cycle Model:
— Anchor — cycle bottom (default 07 Nov 2022): date all phases are projected from; alternative 21 Nov 2022 documented in the tooltip
— Bull phase length (default 1064 days) / Bear phase length (default 364 days): ≈ averages of the 3 completed cycles
— Cycles to draw back (default 3) / forward (default 1): how many turn lines and labels are drawn
— Show 2nd projected cycle (default off): one extra bottom/top pair with doubled uncertainty
🎨 Visual Settings:
— Theme (Auto / Dark / Light): Auto detects from the chart background; all text colors adapt
— Phase background , Cycle turn lines , Turn labels , Watermark : independent toggles with color inputs
📊 Dashboard:
— Position (4 corners), font size (Small–Huge; dividers render one step smaller), and per-section switches: Cycle / Projection / Corrections / Ranges
📈 Hyperbola — Lows:
— 3 main cycle lows (2015 / 2018 / 2022, on by default) + 3 optional early-history lows (2011 / 2013 / 2015) — each is a checkbox + date + price
— Dashed extension (default 10 years), curve color, anchor-point markers
📉 Hyperbola — Highs:
— 4 cycle highs (2013 / 2017 / 2021 / 2025, on by default) + a spare projected slot (off), extension (default 5 years), curve color
🔢 Fibonacci Grids:
— Bull grids (default on) / Bear grids (default off) with separate colors
— Levels (default "0, 0.236, 0.382, 0.5, 0.618, 0.786, 0.836, 0.886, 1"; values > 1 = extensions)
— Highlight 0.786–0.836 zone (default on), Log-scale levels (default off), Reverse (default on), level labels
⛏ Halvings: lines + labels toggles, color
🟡 Sell Zones: toggle, color, Zone size % from high (default 5%)
🔮 Price Projection: toggle, Path shape (Replay last bull / Log-linear), color
🔔 Alerts: master switch, Webhook JSON Format (default off), Pre-alert days (default 30)
🔔 ALERTS
— 🟢 CYCLE FLIP → BULL — model bottom date reached; payload: ticker, timeframe, price, next projected top date
— 🔴 CYCLE FLIP → BEAR — model top date reached; payload: ticker, timeframe, price, next projected bottom date
— ⏳ CYCLE TURN APPROACHING — fires once, N days (default 30) before the next projected turn; payload: turn type (TOP/BOTTOM), days left, date
All alerts fire on confirmed bars only (once per bar close) and support both human-readable text and JSON webhook payloads for bot integration. Create a single alert with condition "Any alert() function call".
⚠️ IMPORTANT NOTES
— 🚫 No repainting. The cycle phase is pure calendar-time math against a fixed anchor; the curves are fitted once from user-defined historical pivots; the reference bull shape is recorded from confirmed bars only; all alerts use bar-close frequency. Nothing in the model reads unconfirmed real-time data, so no line, zone or label moves after the fact.
— 📐 Sample size: 3 completed cycles. Every statistical claim in this model rests on three observations. The hyperbolic fits are geometry/regression over 3–6 points. Treat all projected dates and prices as reference scenarios with wide error bars — the dashboard says "Rhythm ≠ law" for a reason.
— 📏 Calibrated chart: INDEX:BTCUSD, Weekly, regular (linear) price scale. Exchange charts start later and distort early-history fits. Keep the fib "Log-scale levels" input OFF on a linear chart. The dashboard's ✓ confirms symbol and timeframe; the scale must be checked manually.
— ⚖️ Scope: this is a macro-cycle framework for Bitcoin. It produces no intraday entry signals, no stop placement, and no position sizing. The projected path is explicitly hypothetical.
— 🛠️ This is a cycle-analysis and scenario-visualization tool, not an automated trading bot. It provides projected turn dates, curve-based price references, and accumulation/distribution zones — trade decisions remain yours.
— 🌐 The script runs on any symbol and timeframe, but the model is designed for Bitcoin on Daily/Weekly charts — a dashboard warning appears on intraday timeframes.
Bitcoin Almanac · v1.5.2 Индикатор

Moving Averages TrendFour independently configurable moving averages (type, length, source, color each) let you build the classic multi-MA trend stack in one indicator — a long-term filter to define the overall regime, an intermediate MA for the broader trend, and a fast pair for tactical entries on pullbacks within it. Used purely as an overlay, this is a continuation tool: you only take trades in the direction the slower MAs already agree on, using the faster pair to time entries once price pulls back into alignment.
The MA3/MA4 cross-signal layer is what sets this apart from a plain crossover system. Instead of waiting for the two faster MAs to physically cross — which is already stale information by the time it happens — it takes each MA's recent slope and projects it forward by a configurable number of bars, firing the buy/sell label as soon as that projected path crosses rather than the actual one, giving you a signal a few bars earlier than a textbook crossover. A minimum-separation filter (scaled to ATR) throws out weak "touch and go" near-misses, and the signal only fires when price is already sitting on the correct side of both MAs and each MA is still actively moving in that direction on the current bar — all of which is meant to filter out low-conviction crosses in choppy conditions. An optional daily+-only restriction keeps the signal from firing on intraday noise for traders who only want to act on it at swing timeframes.
Best applied in trending or newly-trending markets, as a combined trend filter (from the 4 plotted MAs) and tactical entry trigger (from the cross signal) rather than as a mean-reversion tool — it has little to offer in a flat, range-bound market since the slope and separation conditions are designed specifically to avoid firing in that environment. Индикатор

MHIDa Relative-Weakness vs BTCWHAT IT DOES
This indicator measures how much the asset on your chart is underperforming Bitcoin (or any reference symbol you choose) over a rolling window of bars. It plots the difference between the asset return and the reference return over the same window, in percent, in a separate pane. Values below zero mean the asset is weaker than the reference.
HOW IT WORKS
- It takes the asset return over the last N bars (default 10) and subtracts the reference symbol return over the same N bars. The comparison uses the just-closed bar (close versus close ), so the reading is based on completed bars.
- Relative weakness = (asset return - reference return) * 100.
- When this value drops below your chosen threshold (default 8%), the pane background is shaded: that is an excess-of-weakness zone.
- If, inside that zone, the current candle closes green (close above open), a small watch triangle prints at the bottom of the pane: the underperformance is extreme AND a first sign of stabilization has appeared. The marker draws only on standard chart types.
WHY THESE PIECES ARE TOGETHER
The shaded zone alone tells you the underperformance is extreme, but an extreme can keep getting worse. The green-candle condition adds the first hint that the fall against the reference is cooling off. Neither piece is a trade signal on its own; together they point at spots worth examining by eye.
HOW TO USE IT
Works on any symbol and timeframe. Inputs: reference symbol (default BTC), window length in bars, weakness threshold in percent, and whether to require a green candle before flagging. An optional alert fires on the flag - it is a reminder to go look at the chart, not an order.
HONEST LIMITS
This is a context tool, not a signal and not financial advice. It is not a winning system on its own. The decision, the context and the risk stay with you. Индикатор

Opening Range Breakout ORB - Signals, Targets & Alerts [LunqFX]The Opening Range Breakout (ORB) is one of the most traded intraday strategies — but most ORB indicators only draw the opening range box and leave you guessing. This Opening Range Breakout indicator goes further: it marks the opening range, detects the first genuine breakout, filters fakeouts, projects measured-move targets, and — uniquely — builds a live breakout statistics engine from the last 100 trading days of the symbol on your chart.
What makes this ORB indicator different
Instead of a static box, you get a data-driven read on how your market actually behaves after the opening range:
First-break direction split — how often the day breaks up vs down
Hold rate — how often the first breakout direction holds into the close
Fakeout rate — how often the first breakout fails back inside the range
Target hit rates — how often price reaches 1x and 2x the opening-range height
So before you take the trade you can see, for example, that on this symbol the upside breakout holds into the close 62% of the time and the 1R target is reached on 48% of breakout days.
How the opening range breakout is calculated
Auto mode works on every market with zero setup. The opening range starts at each day's open of the symbol's own exchange — stocks at the 09:30 session open, crypto at the 00:00 UTC daily open, forex and futures at their session open — and lasts a chosen number of minutes (the classic 5-minute, 15-minute or 30-minute ORB). A Custom mode lets you define any session window, such as the London or New York open.
When the opening-range window closes, the range high and low are locked and projected forward as levels.
The first candle close beyond the range (or wick, if you prefer) is treated as the breakout. Targets are projected at 1x and 2x the range height in the breakout direction.
A close back inside the range before the first target is reached is flagged as a fakeout. A breakout that reaches 1R first and only then returns is counted as a valid breakout, not a fakeout.
At the end of each trading day the outcome is recorded — direction, hold, fakeout, targets — and the dashboard percentages are plain rolling hit rates. No repainting, no curve fitting.
How to use it
Breakout day trading: trade the first breakout with more context — use the hold rate to judge whether the break on your symbol is worth taking, and size your target from the 1R / 2R hit rates.
Fakeout fade: when a symbol shows a high fakeout rate, the failed breakout back inside the range is often the better setup; the fakeout is marked in real time.
Range-quality filter: the dashboard shows the opening range as a multiple of ATR, so you can skip abnormally small ranges that tend to break out randomly.
Works on any symbol and any intraday timeframe (1m–15m recommended): index futures and CFDs (NAS100, SPX500, US30, NQ, ES), stocks and ETFs (SPY, QQQ), gold (XAUUSD), Bitcoin and crypto, and forex majors.
Dashboard
A clean on-chart panel shows today's live status (building range → inside range → breakout → target hit or fakeout), the opening-range high/low and its size in ATR, and the full statistics block with the sample size always visible.
Settings
Auto anchor (any market, zero setup) or fully custom session window with timezone control — 5 / 15 / 30-minute ORB or any session open
Close-based or wick-based breakout logic
Adjustable target multiples, rolling statistics window, and visuals
Alerts for range locked, breakout up, breakout down, fakeout, target 1 and target 2
Optional gradient momentum candles that can be switched off
No repainting
The opening range is fixed the moment its window closes. Breakouts, fakeouts and targets are confirmed on closed bars only, and the statistics are built exclusively from completed trading days — never recalculated backwards.
This indicator is an educational market-analysis tool, not financial advice. Historical statistics describe past behavior and are not a guarantee of future results. Always confirm with your own analysis and manage your risk.
Индикатор

Education Trend | Wizard AcademyEducativ Trend | Wizard Academy
educativ trend is an educational trend-reading module built to teach traders how to identify real market structure, understand trend direction, avoid weak market conditions, and recognize clean pullback locations.
the tool is designed for beginners who want a clear framework, but it also gives advanced traders a structured way to read price action without relying on emotion or random candle reactions.
the main idea is simple:
a trend is not a feeling.
a trend is not only price above or below a moving average.
a trend is a sequence of swing points.
an uptrend is confirmed by:
higher high + higher low
a downtrend is confirmed by:
lower high + lower low
anything else is treated as range, transition, or unclear structure.
main features
confirmed market structure
the indicator detects confirmed swing highs and swing lows, then classifies them as:
HH = higher high
HL = higher low
LH = lower high
LL = lower low
EQH = equal high
EQL = equal low
each swing label includes educational context so the trader can understand what happened and why it matters.
trend state engine
the trend state is decided from structure only.
uptrend = HH + HL
downtrend = LH + LL
range = mixed or unclear structure
this helps traders avoid the common mistake of forcing trend trades inside a range.
ema context
the tool includes two moving averages:
fast ema
slow ema
the slow ema is used as long-term bias.
the fast ema is used as short-term fair value and pullback context.
the moving averages are not treated as the trend definition. they are used as context around the real structure.
bos and choch
the indicator marks important structure breaks:
BOS = break of structure
CHoCH = change of character
a bullish BOS shows continuation above the last confirmed swing high.
a bearish BOS shows continuation below the last confirmed swing low.
a bullish CHoCH appears when a bearish structure is damaged by a break above the last swing high.
a bearish CHoCH appears when a bullish structure is damaged by a break below the last swing low.
pullback module
the tool highlights textbook pullbacks into the fast ema when trend structure and bias agree.
a long pullback setup can appear when:
structure is bullish
price is above the slow ema
price pulls into the fast ema
price closes back above the fast ema
the candle closes bullish
a short pullback setup can appear when:
structure is bearish
price is below the slow ema
price rallies into the fast ema
price closes back below the fast ema
the candle closes bearish
this helps beginners avoid chasing breakouts and focus on better trade locations.
projected swing levels
the last confirmed swing high and swing low can be projected to the right side of the chart.
these levels show what price needs to break next.
close above the last swing high can create bullish BOS or bullish CHoCH.
close below the last swing low can create bearish BOS or bearish CHoCH.
dashboard
the live dashboard gives a quick read of the current market state.
it displays:
trend structure
last swing high
last swing low
price vs slow ema
fast ema vs slow ema
fast ema slope
distance from slow ema
checklist quality
live coaching message
the first title row uses an orange accent for a clean institutional look.
lesson card
the lesson card gives a simple nine-rule framework for reading trends.
it teaches:
structure first
ema second
entry last
do not chase breakouts
pullbacks are cleaner locations
ranges are dangerous for beginners
invalidation matters
glossary card
the glossary card explains the main structure terms directly on the chart.
it includes:
HH
HL
LH
LL
BOS
CHoCH
EQH / EQL
golden cross
death cross
PB
each panel can be moved to different chart positions, including corners and middle placements.
how to use the indicator
step 1: read the trend state
start with the dashboard.
if the dashboard says uptrend, the market has confirmed HH + HL.
if the dashboard says downtrend, the market has confirmed LH + LL.
if the dashboard says range, the highs and lows do not agree.
beginners should avoid forcing trend trades when the dashboard shows range.
step 2: check the slow ema bias
look at price versus the slow ema.
price above the slow ema shows bullish long-term context.
price below the slow ema shows bearish long-term context.
the ema does not define the trend by itself, but it helps confirm whether structure and bias agree.
step 3: check the fast ema pullback zone
the fast ema acts like short-term fair value.
in a bullish trend, price often pulls back into the fast ema before continuing.
in a bearish trend, price often rallies into the fast ema before continuing lower.
the cleanest entries usually come after a pullback, not after chasing a breakout candle.
step 4: watch the last swing levels
the projected swing high and swing low show the next important structure levels.
if price closes above the last swing high, bullish structure is strengthened or a bearish trend is damaged.
if price closes below the last swing low, bearish structure is strengthened or a bullish trend is damaged.
step 5: use bos and choch correctly
BOS is usually continuation.
CHoCH is usually the first warning that a trend may be changing.
a CHoCH is not automatically an entry. it is a warning to stop blindly trading the old trend and wait for new structure.
beginner long example
1. the dashboard shows uptrend
2. the last structure is HH + HL
3. price is above the slow ema
4. the fast ema is above the slow ema
5. price pulls back into the fast ema
6. price closes bullish above the fast ema
7. the indicator marks a pullback long
8. risk can be planned below the most recent higher low
this is a cleaner long setup than buying after a vertical breakout.
beginner short example
1. the dashboard shows downtrend
2. the last structure is LH + LL
3. price is below the slow ema
4. the fast ema is below the slow ema
5. price rallies into the fast ema
6. price closes bearish below the fast ema
7. the indicator marks a pullback short
8. risk can be planned above the most recent lower high
this is a cleaner short setup than selling after a large breakdown candle.
how to read the checklist
the checklist gives a simple structure-quality score.
3 / 3 = textbook condition
2 / 3 = partial condition
1 / 3 = weak condition
0 / 3 = avoid
a textbook condition means structure, ema bias, and alignment agree.
a partial condition means the market is not fully aligned yet.
a weak condition means the setup is not clean.
best beginner settings
fast ema: 20
slow ema: 200
swing left bars: 5
swing right bars: 5
equal high/low tolerance: 0.05 × atr
show structure labels: on
show bos / choch: on
show pullbacks: on
show dashboard: on
show lesson card: on
show glossary card: on
for faster markets
reduce swing left/right bars to 3 or 4.
this creates faster structure detection, but it can also create more noise.
for cleaner structure
increase swing left/right bars to 7, 8, or 10.
this gives fewer swings, but the structure is stronger and easier to read.
tips
do not use moving averages alone as a trend definition.
do not buy only because price is above the slow ema.
do not short only because price is below the slow ema.
wait for structure confirmation.
avoid trading in the middle of ranges.
a higher high alone does not confirm an uptrend.
a lower low alone does not confirm a downtrend.
the best long setups usually come after a higher low.
the best short setups usually come after a lower high.
BOS confirms strength.
CHoCH warns that the previous trend may be damaged.
equal highs and equal lows often act as liquidity zones.
do not chase extended candles far away from the fast ema.
wait for price to return to value.
use the most recent HL or LH as invalidation.
alerts
available alerts include:
uptrend confirmed
downtrend confirmed
trend lost / range
bullish BOS
bearish BOS
bullish CHoCH
bearish CHoCH
textbook pullback long
textbook pullback short
golden cross
death cross
for cleaner alerts, use once per bar close.
important note
this tool is built as an educational structure-reading module.
it is designed to help traders understand trend logic, market structure, pullbacks, continuation, transition, and invalidation.
always use risk management, position sizing, and confirmation from your own trading plan.
Индикатор

Breakout Confluence Score█ OVERVIEW
Breakout Confluence Score is an indicator designed to filter breakouts from consolidation by evaluating the overall market context before generating a signal.
The core assumption of the indicator is that not every breakout from consolidation has the same value. In practice, the success rate of a breakout depends on many independent factors such as market direction, trend strength, momentum, participant activity, and the quality of the consolidation itself.
Instead of treating every breakout equally, the indicator analyzes a series of independent market elements and assigns each of them a specific number of points. The final result creates the so-called Confluence Score — an assessment of how well multiple factors support a given breakout.
Only after reaching the minimum required score is a LONG or SHORT signal generated.
This approach significantly reduces the number of weak breakouts that appear during choppy price action, while still offering full configuration flexibility. Every scoring element can be individually enabled, disabled, or assigned its own point weight.
In addition to generating signals, the indicator also serves as a tool for ongoing market evaluation. The built-in scoring table shows the current status of all conditions even before a breakout occurs, allowing the trader to observe whether market conditions are gradually improving or deteriorating.
An integral part of the indicator is also the Signal Tester, which enables quick evaluation of the historical performance of the signals without the need to create a separate TradingView strategy. The tester was designed as a tool for assessing signal quality rather than as a full backtesting engine. This allows it to offer several capabilities that are difficult or impossible to achieve in classic strategies.
All modules of the indicator can operate independently, which means Breakout Confluence Score can be used as a simple breakout detector, a consolidation analysis tool, a market condition evaluation system, or a complete trade signal filter.
█ CONCEPTS
Most breakout indicators assume that every breakout from consolidation has similar chances of success.
In reality, the market does not work that way.
Price constantly moves through phases of trend, accumulation, distribution, and choppy movements without a clear direction. Two almost identical-looking breakouts can lead to completely different outcomes solely because of different market conditions.
That is why Breakout Confluence Score separates the signal generation process into two independent stages:
• detection of the breakout,
• evaluation of the quality of market conditions supporting that breakout.
A signal appears only when both conditions are met.
Building Consolidation and Boxes
The foundation of the indicator is automatic consolidation detection.
Consolidation begins when a defined number of consecutive candles remain inside the High-Low range of the base candle. The first candle that meets this condition defines the boundaries of the entire consolidation zone.
Its high becomes the upper boundary of the box, while its low defines the lower boundary. As long as every subsequent candle stays inside this range, the consolidation continues and the box is gradually extended to the right with each new candle.
As a result, a visual equilibrium zone appears on the chart, showing the area where neither buyers nor sellers have yet gained a clear advantage.
Consolidation ends in one of three cases:
• price breaks above the upper boundary of the box,
• price breaks below the lower boundary of the box,
• consolidation lasts too long and exceeds the maximum allowed number of candles.
Optionally, the indicator can also prevent a new consolidation from starting after a candle with an exceptionally large range. For this purpose, it uses ATR calculated before the analyzed candle, so a single large impulse cannot artificially inflate the volatility threshold and facilitate the creation of a new consolidation zone.
Why the Breakout Alone Is Not Enough
A breakout from consolidation does not automatically mean a good trading opportunity.
Very often breakouts occur:
• without clear momentum,
• against the dominant trend,
• on low volume,
• during a weak trend,
• without real buying or selling pressure.
Technically these are valid breakouts, but statistically their success rate tends to be much lower.
For this reason, the indicator does not evaluate only the fact of the breakout itself, but also the entire market environment in which it occurs. In practice, this means that two identical breakouts can receive completely different point scores. It is the scoring system that determines the quality of the signal.
Scoring and Market Context Evaluation
The purpose of scoring is to determine the current market situation as accurately as possible.
The breakout itself only informs that price has left the consolidation zone.
Scoring answers a much more important question:
“Does the market have sufficient conditions to continue the move after the breakout?”
Each scoring element analyzes a different aspect of market behavior.
Thanks to this, the final score is not based on a single indicator, but represents a combination of multiple independent sources of information.
EMA – Trend Direction
The Price vs EMA condition determines the dominant market direction.
If price is above the EMA, the LONG side receives an advantage.
If price is below the EMA, the SHORT side receives an advantage.
EMA is therefore responsible for identifying the dominant trend.
EMA Slope – Trend Development
The mere location of price relative to the EMA does not yet tell us whether the trend is developing actively.
That is why the slope of the average is also analyzed.
A rising EMA indicates a developing uptrend.
A falling EMA indicates a developing downtrend.
EMA Slope is responsible for assessing the quality and direction of trend development.
RSI – Momentum
RSI is used as a momentum indicator.
It is not used here to find overbought or oversold zones.
Its task is to assess which side of the market currently has greater strength.
RSI above 50 supports LONG signals.
RSI below 50 supports SHORT signals.
RSI is responsible for evaluating current market momentum.
ADX – Trend Strength
ADX measures the strength of the move regardless of its direction.
A high ADX value means the market is moving in a decisive and orderly manner.
A low ADX value indicates the lack of a clear advantage for either side.
ADX is responsible for assessing trend strength.
Volume – Market Participant Activity
Volume allows evaluation of whether increased participant activity stands behind the breakout.
Breakouts that occur on above-average volume are generally more reliable than breakouts that occur during low activity.
Volume is responsible for assessing market interest.
Body Size – Strength of the Breakout Candle
A large body of the breakout candle indicates a decisive advantage of one side of the market.
If the candle body is clearly larger than the average of recent candles, the breakout receives additional points.
Body Size is responsible for evaluating the strength of the breakout impulse itself.
Zone Tightness – Market Compression
Not all consolidations have the same value.
The narrower the box relative to the current ATR, the higher the probability that the market is in a compression phase preceding a stronger move.
Zone Tightness is responsible for assessing the quality and compression of the consolidation.
Duration Premium – Maturity of Consolidation
Longer consolidations often lead to more decisive breakouts.
Therefore, the indicator additionally rewards zones that have lasted for a sufficient amount of time.
Duration Premium is responsible for assessing the maturity of the consolidation.
Live Market Analysis
Scoring does not work only at the moment of breakout.
The scoring table analyzes all conditions in real time, even before a signal appears.
This allows the trader to observe how the market situation is changing and which side of the market is gradually gaining an advantage.
In practice, the indicator becomes not only a signal system, but also a tool for continuous evaluation of the current market environment.
Signal Tester
The Signal Tester was designed as a quick tool for evaluating the quality of generated signals.
It is not a full backtesting engine like TradingView Strategy and its results should not be treated as an accurate simulation of real trading.
A simplified operating model was deliberately used because it enables functionalities that are difficult or impossible to achieve in classic strategies.
The tester can simultaneously maintain multiple positions, manage LONG and SHORT trades independently, and — depending on the settings — allow simultaneous opening of positions in both directions. It can also block new entries until the previous position is closed or reject signals that appear too close to already open trades.
Each position receives its own Entry, Take Profit, and Stop Loss levels calculated based on ATR, which makes it possible to quickly compare different scoring configurations without building a full strategy.
The tester’s results are calculated conservatively.
If both the Take Profit and Stop Loss levels could have been reached during a single candle, the tester always assumes that the Stop Loss was hit.
Because the real sequence of price movements inside a single candle is unknown, this approach deliberately underestimates rather than overestimates the results. This effect becomes especially visible with small TP and SL distances, for example 0.5 ATR, where both levels can very often be reached within one candle. The smaller the TP and SL values relative to ATR, the more conservative the tester’s statistics will be.
The tester also does not account for commissions, spreads, or slippage. Therefore its results should be treated as a tool for comparing signal quality and optimizing indicator settings, not as an accurate simulation of real trading results.
█ FEATURES
Consolidation
* Minimum number of candles in consolidation – Minimum number of consecutive candles required to recognize a consolidation zone
* Show consolidation zones – Enables/disables drawing of consolidation boxes on the chart
* Show breakout signals – Enables/disables display of breakout signals (triangles and/or score labels)
* Remove box if breakout did NOT produce a signal (score < threshold) – Automatically removes the box if the breakout did not reach the minimum scoring threshold
* Display signals as – Choose signal display style: triangles only, labels only, or both
* Maximum number of candles in consolidation (0 = no limit) – Maximum duration of consolidation — after exceeding it the box is closed without generating a signal
Candle Size Filter
* Block consolidation start on oversized candle – Prevents starting consolidation after a candle with a very large range
* Max candle range (high-low) × ATR – Threshold for candle size (multiple of ATR calculated before the candle)
Scoring - General
* Minimum score for a signal (weighted sum) – Minimum required Confluence Score to generate a signal
Scoring - Candle Body
* Average body period – Period used to calculate average candle body size
* Signal body multiplier (body > avg × mult) – Multiplier for required body size of the breakout candle
* Condition weight: large body – Point weight of the large body condition
Scoring - ADX
* ADX — period (DMI) – Period of the ADX indicator
* ADX — minimum value – Minimum ADX value required to award a point
* Condition weight: ADX – Point weight of the ADX condition
Scoring - EMA
* EMA — period (trend) – Period of the EMA used for trend evaluation
* Condition weight: price vs EMA – Point weight of the price vs EMA condition
* Condition weight: EMA direction (slope) – Point weight of the EMA slope condition
Scoring - RSI
* RSI — period – Period of the RSI indicator
* Condition weight: RSI – Point weight of the RSI above/below 50 condition
Scoring - Volume
* Volume — average period – Period used to calculate average volume
* Volume — multiplier (vol > avg × mult) – Multiplier for required volume on breakout
* Condition weight: high volume – Point weight of the high volume condition
Scoring - Consolidation Structure
* Zone tightness: max (top-bottom)/ATR – Threshold for zone width relative to ATR (compression)
* Condition weight: zone tightness – Point weight of the zone tightness condition
* Premium: extra candles above minimum – Additional number of candles above minimum required for duration premium
* Condition weight: duration (premium) – Point weight of the duration premium condition
Table
* Table position – Position of the scoring table on the chart
* Table text size – Text size in the scoring table
Colors
* Bullish Color (Long) – Color used for LONG elements
* Bearish Color (Short) – Color used for SHORT elements
* Neutral Color – Color used for neutral elements / no signal
Signal Tester (TP/SL)
* Enable signal tester – Enable/disable the signal tester
* Tester — ATR period – ATR period used by the tester
* Tester — Take Profit × ATR – Take Profit distance in ATR multiples
* Tester — Stop Loss × ATR – Stop Loss distance in ATR multiples
* Block new signals while a position is open – Block new signals until the previous position is closed
* Block signals too close to an existing position – Filter for minimum distance between signals
* Min. distance between signals × ATR – Minimum distance (in ATR) between signals in the same direction
Signal Tester - Table
* Tester table position – Position of the tester statistics table
* Tester table text size – Text size in the tester statistics table
Signal Tester - TP/SL Visualization
* Show TP/SL levels on chart – Display Entry / TP / SL levels on the chart
* Level line width – Width of TP/SL level lines
* Show risk/reward zone fill – Fill color for risk and reward zones
█ APPLICATIONS
The main task of the indicator is to evaluate the quality of the breakout by analyzing the confluence of multiple independent market factors (trend direction and strength, momentum, volume, impulse strength, zone compression, and consolidation maturity). A LONG or SHORT signal is generated only when the total score exceeds the set threshold.
Thanks to this approach, the indicator effectively eliminates a large portion of weak and false breakouts that occur in low-confluence conditions.
The scoring table operates in real time — even before a signal is generated — and allows the trader to observe how a potential opportunity is gradually building up (or falling apart). This is especially useful for early detection of moments when the market begins to meet more and more conditions favorable for a breakout.
The built-in Signal Tester enables quick and convenient comparison of different scoring configurations without the need to write a separate strategy. It allows checking in just a few seconds how changing weights or thresholds affects the historical performance of the signals.
The indicator achieves the best results when used together with support and resistance zone analysis. For example, opening a long position directly under strong resistance is generally not advisable, while a long signal aligned with a support zone usually produces significantly better results. Similarly, short signals appearing near resistance tend to be more effective than those generated without reference to key levels.
The indicator works best when combined with support and resistance analysis.
█ NOTES
* Each of the eight scoring conditions can be independently enabled or disabled by setting its weight to 0.
* The scoring table shows the current market state in real time — it can be used even when signal generation is disabled.
* The Signal Tester operates in conservative mode: if both TP and SL could have been reached on the same candle, it always counts it as a loss. This approach deliberately underestimates results to provide a more realistic picture.
* The tester does not account for commissions, spreads, or slippage — it serves only for comparing signal quality and optimizing settings.
* All modules of the indicator (consolidation detection, scoring, table, tester, TP/SL visualization) can operate completely independently.
* Very long consolidations exceeding the “Maximum number of candles” limit are automatically closed without generating a signal to avoid outdated zones.
* The best results are achieved when the indicator is used together with support and resistance zone analysis. Long signals near support and short signals near resistance are generally significantly more effective. Индикатор

Liquidity Rejection Auto TargetOverview
Liquidity Rejection Auto Target is a price action indicator designed to identify potential liquidity sweeps followed by rejection candles. The indicator automatically highlights possible long and short trading opportunities based on swing high and swing low liquidity concepts while plotting an entry level, stop loss, and a risk-reward based take-profit target.
This tool is intended to assist traders in identifying areas where price briefly moves beyond a recent swing level before returning back inside the range, which may indicate a rejection of that liquidity level.
How It Works
Bullish Setup
- Detects the most recent confirmed swing low.
- Waits for price to move below that swing low (liquidity sweep).
- Confirms the setup when the candle closes back above the swing low.
- Plots a BUY signal.
- Uses the rejection candle low as the Stop Loss.
- Calculates the Take Profit automatically using the selected Risk:Reward ratio.
Bearish Setup
- Detects the most recent confirmed swing high.
- Waits for price to move above that swing high (liquidity sweep).
- Confirms the setup when the candle closes back below the swing high.
- Plots a SELL signal.
- Uses the rejection candle high as the Stop Loss.
- Calculates the Take Profit automatically using the selected Risk:Reward ratio.
Features
• Automatic liquidity sweep detection
• Bullish and bearish rejection confirmation
• Automatic BUY and SELL signals
• Entry, Stop Loss, and Take Profit plotting
• Adjustable swing detection settings
• Configurable Risk:Reward ratio
• TradingView alert support
• Overlay display directly on the price chart
Inputs
Pivot Left / Right
Adjusts how swing highs and swing lows are identified. Larger values produce stronger but less frequent signals, while smaller values react more quickly to price changes.
Risk:Reward
Defines the automatic take-profit distance relative to the calculated stop-loss distance.
Best Practices
This indicator works best on liquid markets where swing highs and swing lows are clearly formed. Many traders use it together with higher-timeframe market structure, trend analysis, support and resistance, or volume confirmation to help filter potential trade setups.
Alerts
TradingView alert conditions are included for both BUY and SELL signals, allowing users to create notifications whenever a new setup is detected.
Disclaimer
This indicator is an analytical tool and should not be considered financial or investment advice. Market conditions vary, and no indicator can guarantee profitable trades. Always perform your own analysis, apply sound risk management, and test any trading strategy before using it in live markets. Индикатор

Индикатор

For-Loop Vote Trailing Stop | MiesOnChartsFor-Loop Vote Trailing Stop
Overview
For-Loop Vote Trailing Stop is a trend-following tool that combines two ideas: a multi-horizon momentum vote to decide the direction of the market, and an ATR-based ratcheting trailing stop to ride and eventually exit the move. Rather than judging momentum from a single lookback, it polls dozens of horizons at once and lets them vote; the winning side then sets a stop line that trails price and only flips when the opposite side wins the election.
The script plots as a single stop line that sits below price in an uptrend and above price in a downtrend, changing colour and side when the regime turns.
The script is designed and tuned for the 1D (daily) timeframe, though its inputs are fully adjustable for other timeframes.
The idea behind it
Momentum measured over one lookback is fragile: a 10-bar reading and a 60-bar reading frequently disagree, and whichever you pick can be caught out by the other's timescale. This indicator treats direction as an election across horizons instead of a single measurement.
For every horizon from the minimum to the maximum, it asks a simple yes/no question is price higher now than it was that many bars ago? Each horizon casts a vote of +1 (higher) or −1 (lower). Summing and normalising these votes produces a single momentum score between −1 and +1 that reflects how broadly the move is supported across timescales. A score near +1 means price is up over nearly every horizon (a broad, persistent advance); near −1 means the opposite; near 0 means the horizons are split and there is no coherent trend.
That breadth-of-momentum score is more robust than any one lookback because agreement across many horizons is harder to fake than a single reading, and disagreement is surfaced honestly as a neutral score rather than hidden inside one arbitrary length.
How it works
1. The vote
A for loop runs from Min Horizon to Max Horizon, comparing the source against its value "i" bars ago and adding +1 or −1 for each horizon. The total is divided by the number of horizons, giving a normalised score in the range .
2. The regime.
The score is compared against two thresholds:
-- If it reaches the Long Threshold, the regime turns long.
-- If it falls to the Short Threshold, the regime turns short.
-- Between the thresholds the current regime is held, the tool does not flip on marginal readings.
3. The trailing stop
An offset equal to ATR Multiplier × ATR is placed on the correct side of price:
-- On a fresh long signal the stop is set below price; while the long regime persists it only ever ratchets upward, locking in progress and never loosening.
-- On a fresh short signal the stop is set above price; while short it only ratchets downward.
-- The regime flips, and the stop jumps to the other side when the opposite threshold is met.
Because the stop can only tighten in the direction of the trend, it behaves like a one-way ratchet that follows favourable moves and holds its ground against pullbacks until the vote itself reverses.
Signal logic and markers
-- The stop line is green while the regime is long (plotted beneath price) and red while short (plotted above price).
-- A green up-triangle marks each flip to long; a red down-triangle marks each flip to short.
-- Two alert conditions, Vote Stop Long and Vote Stop Short, fire on those flips so the regime changes can be wired to TradingView alerts.
Inputs
-- Source : the price series the vote is measured on (default: hl2, the bar midpoint, which is slightly steadier than close).
-- Min Horizon / Max Horizon : the shortest and longest lookbacks in the vote. A wider span blends more timescales into the score.
-- Long Threshold : how strong the bullish vote must be to turn the regime long. Higher values demand broader agreement before committing.
-- Short Threshold : how weak (negative) the vote must be to turn the regime short.
-- ATR Length : the lookback for the Average True Range used to size the stop offset.
-- ATR Multiplier : how far the stop sits from price, in ATR units. Larger values give the trend more room to breathe (fewer, later exits); smaller values keep the stop tighter (quicker exits, more flips).
Note that the two thresholds are independent, so the tool can be set asymmetrically for example, requiring a stronger vote to enter long than to flip short, or vice versa to reflect a directional bias or differing conviction on each side.
How to use it
-- Trend direction and stop management : the line's side and colour give the current regime at a glance, while its level offers a systematic, volatility-scaled trailing reference that adapts as ATR expands and contracts.
-- Entries and exits : the flip markers indicate when broad momentum has changed sides; the trailing line indicates where that thesis would be invalidated.
-- Volatility awareness : because the offset is ATR-based, the stop automatically widens in turbulent conditions and tightens in calm ones, rather than using a fixed distance.
Notes and limitations
-- This is a reactive, trend-following tool. It follows momentum that is already underway and will change sides after a reversal has begun, not before it. It does not predict future prices.
-- In ranging or choppy markets the vote can oscillate around the thresholds, producing repeated flips ("whipsaw"). Wider horizon spans, more separated thresholds, and a larger ATR multiplier reduce this at the cost of responsiveness.
-- The stop is a calculated reference level, not a guaranteed exit price; actual fills depend on your broker, slippage, and market conditions.
-- There is no universally correct setting; the horizon range, thresholds, and ATR multiplier should be adjusted to the instrument and timeframe you trade.
Originality
This is not a standard ATR trailing stop or SuperTrend clone. The direction that governs the stop is not derived from a single moving average or band, but from a cross-sectional vote computed in a loop across many momentum horizons. The ensemble vote and the ratcheting ATR stop are combined into one tool: the breadth of momentum decides the regime, and the volatility-scaled stop expresses that regime as an adaptive, one-way trailing level.
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial, investment, or trading advice, nor a recommendation to buy or sell any asset. It is a decision-support tool, not a trading system, and the trailing stop it draws is a reference level, not an order or a guaranteed exit. Trading and investing carry substantial risk, including the possible loss of all capital. Past behaviour of any indicator or market is not indicative of future results, and no representation is made that its signals will be profitable. You are solely responsible for your own trading decisions and should conduct your own research and consult a licensed financial professional where appropriate. The author accepts no liability for any loss or damage arising from the use of this script. Индикатор

Ha Smooth Scalperha smooth scalper
ha smooth scalper is a trend-following and scalping tool built around smoothed heikin-ashi logic, real structure trend locking, multi-timeframe confirmation, higher-timeframe filtering, protected structure levels, clean candle coloring, and a compact professional dashboard.
the goal of this indicator is to help traders stay with the real trend instead of reacting to every small candle color change.
in a strong bullish slope, the tool can keep the chart bullish until a real protected swing low is broken.
in a strong bearish slope, the tool can keep the chart bearish until a real protected swing high is broken.
this makes the trend view cleaner and helps reduce false flips during strong directional moves.
main concept
most candle-based systems change color too quickly.
a single weak red candle inside a strong bullish trend should not always mean the trend is bearish.
a single weak green candle inside a strong bearish trend should not always mean the trend is bullish.
ha smooth scalper solves this by combining:
smoothed heikin-ashi calculation
real structure lock
protected swing highs and swing lows
multi-timeframe agreement
extra higher-timeframe confirmation
trend cloud
optional smooth candle mode
professional dashboard
how the trend works
the indicator first builds smoothed heikin-ashi candles from the chart data.
then it uses a structure lock system to decide if the market is really bullish or bearish.
bullish trend
the market stays bullish while price respects the protected swing low.
small bearish candles inside the bullish slope do not automatically flip the trend.
the trend changes to bearish only when the protected support structure is broken.
bearish trend
the market stays bearish while price respects the protected swing high.
small bullish candles inside the bearish slope do not automatically flip the trend.
the trend changes to bullish only when the protected resistance structure is broken.
protected structure level
the protected structure line shows the key level that must break before the trend can truly change.
in a bullish trend, this level is usually below price.
in a bearish trend, this level is usually above price.
for beginners, this is one of the most important parts of the tool.
if the market is bullish and price stays above the protected structure, the bullish trend remains valid.
if the market is bearish and price stays below the protected structure, the bearish trend remains valid.
smooth lock candle mode
smooth lock candle mode is designed to keep chart colors aligned with the real structure trend.
when enabled:
bullish structure keeps candles bullish
bearish structure keeps candles bearish
minor counter-trend candles are ignored
color changes only happen after real structure breaks
this mode is useful for traders who want a cleaner trend view and fewer emotional exits.
multi-timeframe confirmation
the indicator includes six selectable timeframes.
each timeframe can be enabled or disabled.
the panel shows whether each selected timeframe is bullish or bearish.
the minimum timeframe agreement setting controls how many selected timeframes must agree before a signal is accepted.
example:
if six timeframes are enabled and the minimum agreement is set to three, at least three selected timeframes must agree with the signal direction.
higher values create fewer but cleaner signals.
lower values create more signals but with more risk of noise.
extra htf confirmator
the extra higher-timeframe confirmator is an additional filter designed to reduce weak buy and sell signals.
it can confirm direction using:
ema slope plus price
or heikin-ashi direction
when enabled, long signals require bullish higher-timeframe confirmation.
short signals require bearish higher-timeframe confirmation.
this is useful because many losing trades happen when lower-timeframe signals go against the larger trend.
signal logic
long signal
a long signal can appear when:
the structure flips bullish
enough selected timeframes agree
the extra htf confirmator agrees
the trend mode allows long entries
the impulse filter confirms body expansion
short signal
a short signal can appear when:
the structure flips bearish
enough selected timeframes agree
the extra htf confirmator agrees
the trend mode allows short entries
the impulse filter confirms body expansion
full confluence star
a star appears when all selected timeframes agree with the signal direction.
this is a stronger confluence condition, but it should still be used with proper risk management.
dashboard
the dashboard is designed to give a fast view of the market.
it shows:
chart trend
six timeframe directions
multi-timeframe agreement
extra htf confirmation
structure lock status
protected structure price
smooth lock candle state
last signal
the panel uses a clean grey professional style and can be moved around the chart.
how to use the indicator
step 1: check the chart trend
start with the first dashboard row.
if the chart trend is bullish, focus mainly on long setups.
if the chart trend is bearish, focus mainly on short setups.
beginners should avoid trading directly against the displayed structure trend.
step 2: check the protected level
look at the protected structure level.
in a bullish trend, this is the important level below price.
if price stays above it, the bullish structure remains valid.
in a bearish trend, this is the important level above price.
if price stays below it, the bearish structure remains valid.
step 3: check timeframe agreement
look at the six timeframe rows.
cleaner long conditions usually appear when most selected timeframes are bullish.
cleaner short conditions usually appear when most selected timeframes are bearish.
step 4: check the htf confirmator
if the extra htf confirmator is enabled, wait for it to agree with the trade direction.
bullish htf confirmation supports long setups.
bearish htf confirmation supports short setups.
step 5: wait for a signal
a long signal marks a bullish structure transition with confirmation.
a short signal marks a bearish structure transition with confirmation.
do not trade every signal blindly.
always check trend context, support and resistance, volatility, session timing, and risk placement.
beginner long example
1. chart trend is bullish
2. smooth lock candle mode shows bullish structure
3. most selected timeframes are bullish
4. extra htf confirmator is bullish
5. price holds above the protected structure level
6. a long signal appears
7. stop loss can be planned below the protected level or below a recent swing low
8. target can be based on resistance, previous high, or a fixed risk/reward plan
beginner short example
1. chart trend is bearish
2. smooth lock candle mode shows bearish structure
3. most selected timeframes are bearish
4. extra htf confirmator is bearish
5. price holds below the protected structure level
6. a short signal appears
7. stop loss can be planned above the protected level or above a recent swing high
8. target can be based on support, previous low, or a fixed risk/reward plan
important settings
pre-smooth length
controls the first smoothing applied to price before the heikin-ashi calculation.
lower values react faster.
higher values are smoother.
post-smooth length
controls smoothing after the heikin-ashi calculation.
higher values reduce noise and false movement.
lower values make the tool more reactive.
slow baseline length
controls the slow baseline used for trend context and pullback logic.
structure pivot strength
controls how strong a swing high or swing low must be before it can become a protected structure level.
lower values react faster.
higher values create stronger but slower structure levels.
structure break confirmation
close mode requires candle close beyond the protected level.
wick mode reacts faster but can be noisier.
structure break buffer
adds an atr buffer beyond the protected level before the structure is considered broken.
higher buffer creates fewer trend flips.
lower buffer creates faster flips.
minimum timeframes agreeing
controls how many enabled timeframes must agree before a signal is allowed.
higher values are stricter.
lower values are more aggressive.
extra htf confirmator
adds a higher-timeframe direction filter to help avoid weak lower-timeframe signals.
smooth lock candle mode
keeps the visible candle color aligned with the structure trend until a real structure break happens.
best beginner settings
for cleaner trend reading:
enable real structure trend lock: on
structure source: raw price
structure break confirmation: close
smooth lock candle mode: on
extra htf confirmator: on
use confirmed mtf candles: on
minimum timeframes agreeing: 3 or higher
glow baseline: off
confluence background tint: off
for faster scalping:
structure pivot strength: 6 to 8
minimum timeframes agreeing: 2 to 3
extra htf confirmator: on
smooth lock candle mode: on
for safer trend following:
structure pivot strength: 10 to 14
minimum timeframes agreeing: 4 to 6
extra htf confirmator: on
structure break buffer: higher value
alerts
the indicator includes alerts for:
long scalp
short scalp
full bull
full bear
structure bull break
structure bear break
for cleaner alerts, use once per bar close.
risk management
this tool helps identify trend direction and filtered signals, but risk management is still required.
before entering a trade, define:
entry
stop loss
target
position size
invalidated condition
a good signal without risk management can still become a bad trade.
final note
ha smooth scalper is designed to make trend direction cleaner, reduce false color flips, and help traders focus on higher-quality conditions using structure, smoothing, multi-timeframe alignment, and higher-timeframe confirmation.
Индикатор
