Book Value & Tangible Book ValueBook Value & Tangible Book Value plots two reported quarterly figures side by side: total book value per share, and tangible book value per share, which is book value with goodwill and other intangibles removed.
Both series are drawn as stepped lines with a marker at each reported quarter, so you can see exactly when a value changed rather than an interpolated curve.
How to read it. The gap between the two lines is the share of equity that comes from intangibles. A wide and widening gap usually points to acquisitions, and it is the part of book value that a writedown can erase overnight. Compare the lines with price to see what multiple of book you are paying; price below tangible book value has historically drawn value investors, though it is often a sign of distress rather than a bargain. A falling tangible line while the total line holds up is a warning worth investigating.
Notes and limits. Values change only on new quarterly reports, so the lines are flat between filings. Book value is an accounting measure of historical cost, not market value, and it understates asset-light businesses while overstating companies carrying old assets or acquisition goodwill. It needs reported quarterly financials, so nothing plots on indices, forex, crypto, and most funds. It is most meaningful for banks, insurers and asset-heavy industrials, and least meaningful for software and services. Indicador

Cash Runway & SolvencyCash Runway & Solvency estimates how long a company can keep operating at its current cash burn, using reported quarterly figures rather than estimates.
The script reads two quarterly items: cash and equivalents, and cash flow from operating activities. Both are carried forward between reports so the line is continuous between filings.
If operating cash flow is positive, the company is funding itself and the line sits at the top of the scale. If it is negative, the burn is the absolute value of that figure, and the runway is cash divided by burn, expressed in quarters and capped at 20 so the scale stays readable.
Three reference lines mark the zones: 20 quarters is the self-funding cap, 4 quarters is roughly one year of cash, and 2 quarters is where financing pressure usually starts. The line changes color as it crosses them: teal when self-funding, blue above four quarters, orange between two and four, red below two.
How to read it. A falling line means burn is rising faster than cash, or cash is being consumed without replacement. A jump upward usually means a capital raise, so check for dilution. A flip from red or orange to teal is the quarter the company turned operating cash flow positive.
Notes and limits. Values update only when a new quarterly report is released, so the line steps rather than moves daily. The runway assumes the last reported burn continues unchanged, which it rarely does; it is a snapshot, not a forecast. Financing and investing cash flows are excluded, so a company that keeps raising money can run at low readings for years. It needs reported quarterly financials, so nothing plots on indices, forex, crypto, most funds, and some non-US listings. Banks and insurers do not fit the burn model at all. Indicador

Candle Club - Session LevelsYesterday's high, the overnight range and today's open, drawn where they formed and kept on the chart so you can see what price did there.
WHAT IT DRAWS
Prior day high, low and close; overnight high and low; the cash-session open; an optional prior-day midline and round-number reference lines; and shelf zones, shaded pockets where recent session highs and lows cluster. Each day's lines start when that level becomes known and stop when the next one replaces it, so history stays readable.
THE IDEA
A session extreme is a place the market reached and turned away from; the overnight range is the path it took while the cash session was shut. Many traders watch these places, and this tool's only job is to put them on your chart where you can see them. It makes no claim about what price does when it returns there; what you do at a level is your call.
WHAT IS ORIGINAL
Shelf zones. The script banks each completed session's high and low, sorts the last few days of them, and groups any within your chosen width of each other. Two or more in one pocket become a box starting where its oldest member formed. One extreme is a number; a cluster is a shelf the market has revisited.
HOW TO USE
Set the cash session and timezone for your market (default: US index futures and stocks) and how many days to keep. Read it top down: the table lists every level and how far it sits from the last price, so you can see at a glance what is above and below you. Shaded boxes are shelf zones - the more session extremes stacked in one, the more times the market has stopped in that pocket. Set one alert per level, or the "any level" alert, to be told when price crosses one instead of watching. Best on 1-minute to 15-minute charts; it draws nothing on daily and above.
SETTINGS
One group per family: prior day, overnight, open, shelf zones, round lines, each with an on/off switch and colour on one row, then width and style. Neutral lines follow your chart theme. Prior day can use the exchange's daily bar or the previous cash session only.
LIMITATIONS
Intraday charts only. On stocks the overnight means the pre- and post-market bars on your chart, so extended hours must be on. The cash-session option needs one completed session first. Overnight here means everything outside the cash session you set, so if you also run a tool that starts its overnight at a fixed hour the two will not always draw the same line. The round-number lines are an evenly spaced grid, off by default. They are drawn for reference only and nothing here claims price behaves differently at them.
A standalone drawing tool with no buy or sell signals. Indicador

Smooths Heat Seeker Liquidity MapOverview
This indicator maps resting liquidity by detecting confirmed swing highs and lows at three independent lookback lengths, then rendering each one as a zone that visibly fades the longer it goes untouched. Instead of a static box that holds one shade until it's swept, each zone is built from small time-segments, and each segment locks in whatever color the zone's fade formula produces at the moment it's drawn — so a single zone shows a genuine gradient across its own lifetime, brightest where it formed and dimmer toward the present if nothing has happened to it since.
Concepts used
Tiered pivot detection: ta.pivothigh()/ta.pivotlow() run at three separate lookback lengths (Fast/Mid/Slow). A pivot only confirms after "Confirmation Bars" bars have passed with no higher high / lower low, which is what prevents repainting the level's location after the fact.
Age-based color decay: each level stores the bar index it was formed on. Every time a new segment is drawn, the indicator computes how many bars old the level is, runs that through a decay curve (fadeStrength input controls the curve's steepness), and converts the result into a transparency value for that segment only. Because past segments are never redrawn, the visual history of the fade is preserved rather than the whole zone jumping to one shade at once.
Mitigation vs. retest: a level is deleted the instant price crosses it (wick or close, user's choice) — that's treated as the liquidity being consumed. If price merely touches the level without crossing it, and "Refresh Fade On Retest" is on, the level's age resets to zero, so a level that keeps getting defended stays bright while one that's simply being ignored keeps fading toward removal.
Tier-priority merging: if a new pivot lands at the same price as an existing level, the indicator keeps the higher tier rather than creating a duplicate zone, so a level significant on the Slow lookback doesn't get visually diluted by a Fast-tier duplicate sitting on top of it.
How to use it
Add it to any chart/timeframe with default settings. Brighter zones are recent or actively-retested liquidity; dimmer zones are levels the market has drifted away from without touching. Use Fast/Mid/Slow tier colors to separate minor intraday levels from more structurally significant ones, and adjust Fade/Lifetime, Fade Strength, and Cell Width to control how far back the map looks and how coarse or smooth the fade appears.
Originality
This is not a combination of other publications — there's a single detection-and-rendering pipeline here (pivot detection → age tracking → per-segment decay → mitigation/retest handling), and every part of it was written for this script. No code, calculations, or visual techniques are reused from another publication.
Inputs
Fast / Mid / Slow — pivot lookback lengths for the three liquidity tiers
Confirmation Bars — bars required after a swing point before it's confirmed
Mitigate On — wick or close removes a level
Fade/Lifetime, Fade Strength, Cell Width — control how long a zone lives and how its decay curve is shaped
Refresh Fade On Retest — restarts a zone's age on an unmitigated touch
Box Height Multiplier — sets zone thickness as a multiple of ATR
Weak / Mid / Strong colors — one color per tier
This indicator has no signals, alerts, or trade markers — it's a pure visualization of where liquidity currently sits on the chart, and how fresh or stale each level is. Indicador

MSnR Double Breakout LevelMSnR Double Breakout Level
A staircase of turning points, and the level that matters once price finally runs out the top or
the bottom of it.
Support and resistance tools usually mark a level the moment it forms, which is why a chart ends up carrying dozens of lines that never meant anything. This one marks nothing when a level appears. It holds two of them, waits to see whether price runs past the pair, and only then draws the one that was left behind.
The result is that a level is never drawn on hope. By the time it is on the chart, price has
already proved it was willing to go through everything above or below it.
THE TWO BUILDING BLOCKS
A candle is green when close is above open, red when close is below. A doji, where they are
equal, is neither and takes no part.
A Level a green candle followed immediately by a red one.
The GREEN candle's CLOSE is the level.
Buyers pushed, sellers took it straight back.
V Level a red candle followed immediately by a green one.
The RED candle's CLOSE is the level.
Sellers pushed, buyers took it straight back.
These are not the output. They are the raw material.
DOUBLE BREAKOUT
Two same-side levels are held as a rolling pair. On the A side that is a descending pair - A1
above, A2 below:
A1 a close above this confirms it
A2 this is the level that gets marked
When a candle CLOSES above A1, the staircase has been run out, and A2 - the innermost step, the last place sellers stepped in before price left - is marked as the level.
The V side is the exact mirror. An ascending pair, V1 below and V2 above, a candle closing below V1, and V2 is marked.
It is always a DOUBLE. However long the staircase runs, only the latest two steps are ever held.
When a new same-side level appears while the pair is still waiting, one question decides what
happens to it:
the new level did NOT break the inner step -> the pair SLIDES one along
(old inner becomes the new outer)
the new level DID break the inner step -> the pair RESTARTS from that level
That single question is the whole bookkeeping, and it is the part most easily got wrong. Throwing the pair away every time another step appears loses the long staircases, which are exactly the ones worth waiting for. Never throwing it away means the pair drifts away from price and stops describing anything. Sliding keeps it anchored to the two most recent steps for as long as the move keeps going the same way, and restarts it the moment the move stops.
The breakout is always checked before any new level is. Reaching the outer step IS the breakout, so a level beyond it can only ever belong to the next search, never interrupt the current one.
DOUBLE BREAKOUT TO DOUBLE BREAKOUT
A completed Double Breakout can itself be taken out - by a completed Double Breakout running the other way.
a Double A Breakout confirms, marking A2
a Double V Breakout then confirms, marking V2
a candle CLOSES below that old A2
-> V2 becomes a DBO to DBO V level
The bullish case is the mirror: a Double V, then a Double A, then a close above the old V2, and
A2 becomes a DBO to DBO A level.
The cross break may land on the very same candle that confirmed the second Double Breakout, or on any candle after it. What it says is that the level which had just been established as the place price wanted to leave from has now been given up in the other direction, by a move built the same strict way.
The level is UPGRADED, not duplicated. A DBO to DBO A sits at exactly the price its Double A
Breakout already marked - it is the same level with more behind it - so the line already on the
chart changes its name and thickens rather than a second line being drawn on top of the first.
WHAT MAKES THIS DIFFERENT
1. Nothing is marked when it forms.
An A Level or a V Level on its own is never drawn. Two of them together are never drawn either.
Only the breakout puts something on the chart, which is why a whole session can pass with nothing new on it.
2. The pair rolls instead of resetting.
This is the piece that separates it from a plain two-level check. A staircase that keeps stepping
the same way keeps its pair alive, sliding one step at a time. A staircase that turns back on
itself starts again. Both cases are handled by the same rule.
3. The inner step is the level, not the outer one.
The outer step is what price had to close through to prove anything, so it has already been
consumed by the time the pattern completes. The inner step is the last one price never came back to, and that is what is drawn.
4. Breakout has priority over everything else.
Because reaching the outer step is itself the breakout, the order in which the two checks run
changes the result. Checking for new levels first would let a level that is really the start of
the next search interrupt the current one. Here the breakout is always resolved first.
5. The chain is a real state, not a coincidence.
A DBO to DBO level requires a full Double Breakout, then a full opposite Double Breakout, then
the first one's level being closed through. All three are tracked as one sequence, and any part
of it ageing out of the window cancels it.
6. The search itself can be watched.
The pair currently waiting for its breakout can be drawn, so the staircase can be seen sliding
before anything confirms. It is the working state, not a signal, and it is off by default.
READING THE CHART
Green line, "DBO A" Double A Breakout, label below
Red line, "DBO V" Double V Breakout, label above
Thick green, "DBO to DBO A" the bullish chain completed
Thick red, "DBO to DBO V" the bearish chain completed
Every line starts at the candle the level was read from and runs to the right, so the distance
from its origin to price shows how long it has been standing.
Labels are parked clear of that origin candle rather than on the level itself - under its low on a
bullish level, over its high on a bearish one. The level price is a candle CLOSE, so it sits
inside the candle, and a label placed there would be buried in the price action.
A chain level is always drawn one step thicker than a plain one. That is the only styling
difference, because it is the same kind of level, reached by a longer road.
With the working pair switched on, dotted lines labelled A1, A2, V1 and V2 show what is currently being tracked. A1 and A2 are the descending pair waiting for a close above A1; V1 and V2 are the ascending pair waiting for a close below V1. Watch A2 slide down as the staircase extends. If only A1 or only V1 is drawn, the search has one step and is waiting for its second.
Only the most recent few levels are drawn, so the chart stays readable. Older ones are still
counted in the corner table, which reports Double Breakout and DBO to DBO levels split into bull and bear. If the table reads higher than what you can see, the display limit is doing its job.
SETTINGS
Double Breakout
- Scan Length: how far back the search reaches. A pair that has been waiting longer than this is
abandoned, and a confirmed level is dropped once the candle it came from is older than this. It
also bounds how long a chain can stay open.
- Max Levels Shown: how many of the most recent levels are drawn. Switching a type off frees its slots for the others.
Level Types
- A switch for each of the four: Double A Breakout, Double V Breakout, DBO to DBO A, DBO to DBO V.
- Show Working Pair: draws the pair currently waiting for its breakout.
Level Style
- Bullish, bearish and working pair colours, line width, and whether levels extend to the right
edge. With extending off, a level stops at the candle that confirmed it.
Labels
- Show Labels, Label Size, and Label Distance from Candle as a percentage of ATR(14), so the gap scales with whatever instrument and timeframe you are on. The distance is measured from the origin candle's high or low, not from the level.
Summary Table
- Show, position and size of the corner table.
ALERTS
Four alert conditions:
Double A Breakout a descending pair was run out to the upside
Double V Breakout an ascending pair was run out to the downside
DBO to DBO A a bullish chain completed
DBO to DBO V a bearish chain completed
Each message carries the event, the symbol, the timeframe and the closing price. The same
messages are also sent through the alert function, so the "Any alert() function call" alert type
can deliver all four through a single alert.
Every alert is evaluated only after a candle has fully closed.
REPAINTING
This script does not repaint.
- The whole engine runs once per closed candle. Price moving inside an open candle cannot create, change or remove a level, and cannot make a signal appear and then disappear.
- Both building blocks need a candle AFTER them to exist at all. An A Level is only an A Level
once the red candle behind it has closed, so nothing is ever read from a candle still forming.
- Levels are built forward, one candle at a time, in the same order they would have been built live. A line that has been drawn never moves. The only thing that can change about it is its
name and thickness, when a later chain upgrades it, and that is a record of what price did
afterwards rather than a revision of what it did before.
- Nothing is read from a higher timeframe, so there is no higher timeframe lookahead to get
wrong.
When you create an alert, TradingView may show a caution banner saying the indicator can repaint. That banner appears automatically for any script that uses the built in bar state variables, no matter how they are used, because the platform cannot check the intent behind them. This script uses one of them for the opposite purpose: it is what restricts the entire engine to bar close.Choosing "Once Per Bar Close" when creating the alert is still recommended.
NOTES AND LIMITATIONS
- Levels are deliberately infrequent. Two same-side reversals have to line up and then be run
through by a close, and a DBO to DBO level needs that to happen twice in opposite directions.
Long stretches with nothing new are normal.
- Scan Length is not only cosmetic here. It decides when a waiting pair is abandoned and when a chain expires, so changing it changes what is found, not just what is drawn. Max Levels Shown
is the cosmetic one.
- A doji takes no part. An A Level or V Level needs one candle of each colour, so a pair
containing a doji is not one.
- DBO to DBO upgrades the existing level in place. The count of plain Double Breakouts therefore goes down by one each time a chain completes, because that level has become
something else.
- An internal cap of 120 stored levels keeps the drawing count inside TradingView's limits. On a
very long history the oldest are dropped.
- Detection is purely structural. It reports where these sequences occurred and nothing more. It
does not rank levels by quality, measure what happened next, or produce entries, targets or
stops.
HOW TO USE IT
A Double Breakout level marks the last place the other side stepped in before price left the
area. Traders commonly watch these for:
- A reaction on the first return, since price has not been back to that step since the breakout
- Direction from the side, where a bullish level below price and a bearish level above it frame
the range price is currently working in
- Confirmation against a higher timeframe read, where a level that agrees with the larger picture carries more weight than one that fights it
A DBO to DBO level is the same level after the market has argued about it twice. The road to it
was longer, and it sits where a completed move in one direction was undone by a completed move in the other.
The working pair is worth turning on while learning the tool. Watching A2 slide down step by step makes it obvious what the breakout is waiting for, and where it would have to close for anything to be drawn.
These are reference areas, not entry signals on their own. Use them alongside your own support
and resistance mapping, your own entry method and proper risk management.
DISCLAIMER
This indicator is a pattern detection tool. It is not financial advice and it makes no claim
about profitability. Trading involves risk. Always apply your own analysis and risk management. Indicador

Golden Trident | Swing-Anchored VWAP Trend SystemGolden Trident is a long-only, daily-timeframe trend-following strategy built specifically for XAUUSD (spot gold). Rather than relying on a lagging moving-average crossover or a single volatility band, it reads market structure directly — tracking swing highs and lows to determine trend direction — and pairs that with a volume-weighted anchor price that resets at every structural trend change. This gives the strategy a "fair value" reference line that adapts to each new trend leg rather than dragging a fixed-length average behind it.
The strategy is deliberately long-only. Gold has spent most of its liquid trading history in a secular uptrend, and countertrend short entries were found to meaningfully drag down both total return and risk-adjusted performance without adding diversification benefit — so the system simply steps to the sidelines when structure turns bearish, rather than fighting the dominant trend.
Position sizing is intentionally simple: a fixed percentage of equity per trade, compounding as equity grows. Risk management is handled by a single wide "catastrophe" stop rather than a tight trailing stop — the strategy is designed to exit on genuine trend reversal, not to be shaken out by normal daily noise.
How It Works
Swing Structure (Trigger): The strategy tracks rolling swing highs and lows over a configurable lookback. When the most recent extreme is a new high, structure is bullish; when it's a new low, structure is bearish.
Anchored VWAP (Trend Reference): Each time structure flips, the volume-weighted average price calculation resets and begins accumulating fresh from that point — producing a trend-relative fair-value line rather than a static average.
EMA200 Filter (Structure Confirmation): Long entries additionally require price to be trading above the 200-period EMA, keeping trades aligned with the macro trend.
Chop Filter (Volatility Gate): Entries are blocked when recent price range is too narrow relative to ATR — this avoids entering on structural "flips" that occur during sideways consolidation, where they're most likely to reverse immediately.
Exit: Positions close purely on structural trend reversal. No trailing stop is used, since research during development found trailing exits tended to cap winning trades prematurely without meaningfully reducing losses.
Backstop Stop: A wide ATR-based stop exists purely as disaster protection for extreme, unexpected moves — it is not intended to be part of normal trade management.
Features
Swing-structure trend detection (not a lagging indicator crossover)
Self-resetting anchored VWAP trend reference
Optional EMA200 macro trend filter
Optional ATR-based chop/consolidation filter
Configurable backtest date range
Trade outcome visualization (colored boxes showing each closed trade's entry-to-exit range)
Live dashboard showing current structure, volatility state, position size, and open P/L
Gold-themed visual design with gradient trend fill and directional bar coloring
Tips for Use
Timeframe: Designed and tested on the daily chart. Shorter timeframes will likely need proportionally shorter swing/EMA/ATR lengths.
Data quality matters: Backtest only over periods with clean, liquid, consistently-quoted price and volume data. Very long historical ranges on XAUUSD may include gold-standard-era pricing or unreliable volume that will distort results — the built-in date range inputs default to 2010 onward for this reason.
Position sizing: The default equity percentage is aggressive. Test at a lower size first and scale up only after reviewing max drawdown and worst losing-streak length for your specific test window — position sizing should reflect your own risk tolerance, not just backtest profit factor.
Shorting: Short entries exist as a toggle for experimentation, but are off by default based on backtest performance on gold's historical trend bias. Re-enabling changes the strategy's risk profile meaningfully.
Not financial advice: This is a backtesting and educational tool. Past performance on historical data does not guarantee future results.
Estratégia

GM Fusion OscillatorCombo Oscillator – MACD + Stochastic + RSI + EMA
The Combo Oscillator combines four widely used technical indicators into one simple momentum oscillator:
MACD + Stochastic + RSI + EMA
Instead of switching between several indicators, the Combo Oscillator combines their information into one normalized and smoothed line.
🟢 GREEN / BULLISH SIGNAL
Generated when the combined oscillator crosses above the zero line, indicating a potential shift toward bullish momentum.
🔴 RED / BEARISH SIGNAL
Generated when the combined oscillator crosses below the zero line, indicating a potential shift toward bearish momentum.
The oscillator also uses ATR normalization, allowing indicators with different scales to work together in one combined calculation.
DEFAULT SETTINGS:
EMA: 21 / 55
MACD: 12 / 26 / 9
RSI: 14
Stochastic: 14 / 3 / 3
ATR: 14
Smoothing: 3
The major parameters are adjustable, allowing traders to experiment with different settings for different markets and timeframes.
The Combo Oscillator is designed as a momentum and confirmation tool, not as a standalone trading system.
For best use, combine it with your own analysis, market structure, support and resistance, liquidity and risk management.
One oscillator.
Four indicators.
One clear view of momentum. Indicador

Combo Oscillator - MACD + Stoch + RSI + EMACombo Oscillator – MACD + Stochastic + RSI + EMA
The Combo Oscillator combines four widely used technical indicators into one simple momentum oscillator:
MACD + Stochastic + RSI + EMA
Instead of switching between several indicators, the Combo Oscillator combines their information into one normalized and smoothed line.
🟢 GREEN / BULLISH SIGNAL
Generated when the combined oscillator crosses above the zero line, indicating a potential shift toward bullish momentum.
🔴 RED / BEARISH SIGNAL
Generated when the combined oscillator crosses below the zero line, indicating a potential shift toward bearish momentum.
The oscillator also uses ATR normalization, allowing indicators with different scales to work together in one combined calculation.
DEFAULT SETTINGS:
EMA: 21 / 55
MACD: 12 / 26 / 9
RSI: 14
Stochastic: 14 / 3 / 3
ATR: 14
Smoothing: 3
The major parameters are adjustable, allowing traders to experiment with different settings for different markets and timeframes.
The Combo Oscillator is designed as a momentum and confirmation tool, not as a standalone trading system.
For best use, combine it with your own analysis, market structure, support and resistance, liquidity and risk management.
One oscillator.
Four indicators.
One clear view of momentum. Indicador

Indicador

TRMSF (Trend / Range Market-State Filter) v1.0The Trend / Range Market-State Filter is a TradingView Pine Script indicator designed to label XAUUSD and BTCUSD market conditions as BULLISH, BEARISH, or SIDEWAY. It gives your webhook system a market-state rule that decides whether BUY and SELL signals should be delivered to the Telegram group or paused.
The script combines two technical tools. First, it uses the Directional Movement Index (DMI). DMI provides the Average Directional Index (ADX), which measures trend strength, plus the positive and negative Directional Indicators (+DI and -DI), which indicate directional pressure. A BULLISH condition requires ADX to be above the trend threshold and +DI to be above -DI. A BEARISH condition requires ADX above the trend threshold and -DI above +DI. The default trend-strength threshold is ADX above 25.
Second, the script optionally uses the Choppiness Index (CHOP). CHOP does not determine bullish or bearish direction. Instead, it checks whether price action is relatively directional or ranging. Low CHOP readings support a trend, while high readings support a sideways market. With the default settings, CHOP below 38.2 confirms a directional trend and CHOP above 61.8 supports a SIDEWAY classification.
The script labels a market SIDEWAY when ADX is below 20 or CHOP is high. It intentionally keeps the last market state when readings fall in the middle zone, such as ADX between 20 and 25. This prevents frequent switching between states when the indicators hover near their thresholds.
A state change is confirmed only at the close of a candle. When the state changes, TradingView can send one of six exact webhook messages: BULLISH, BEARISH, or SIDEWAY for either XAUUSD or BTCUSD. BULLISH and BEARISH pause BUY/SELL messages for it; SIDEWAY re-enables them. XAUUSD and BTCUSD remain independent, so a BTCUSD pause does not affect XAUUSD signals. Indicador

Confirmed Swing Ledger [BSL]Confirmed Swing Ledger is a confirmation-aware market-structure ledger
for studying how swings become known in real time.
WHAT IT DOES
- Detects pivot highs and lows only after the configured right-side
confirmation window has closed.
- Separates the pivot's historical origin bar from the later confirmation bar.
Confirmation markers are the default; optional hollow origin dots are
retrospective and clearly labelled.
- Maintains an alternating ledger of accepted highs and lows, classifying them
as HH/LH and HL/LL.
- Applies an optional ATR-distance filter to reduce near-duplicate swings.
Same-side candidates may replace an existing extreme without inventing a new
alternating swing.
- Tracks the latest confirmed upper and lower levels.
- Distinguishes strict close breaks from wick rejections. A break requires the
close to cross a known confirmed level; a wick through the level that closes
back inside is counted separately.
- Freezes state on non-standard chart types instead of presenting synthetic
bars as ordinary OHLC evidence.
- Exposes hidden numeric streams for confirmed swings, level updates, breaks,
rejections, dual rejections and bias. These are selectable sources in Signal
Audit Lab .
- Includes alert conditions for accepted swings, confirmed-level close breaks
and confirmed-level wick rejections.
TIMING MODEL
With the default 3/3 left/right settings, a candidate that originates at bar
`t` can only become a usable event at `t + 3`. The script never relocates a
tradeable event back to the origin bar. Optional origin dots are visual
context, not realtime signals.
DEFAULTS
- Pivot left/right: 3 / 3
- ATR length: 14
- Minimum alternating swing distance: 0.5 ATR
- Panel: Compact
DESIGNED FOR AUDITABILITY
The panel reports current confirmed levels, classification, structural bias,
accepted/replaced/filter/ambiguity counts, break/rejection totals, chart-type
guard status and open-bar hold state. Historical state changes occur only on
confirmed bars.
This tool describes confirmed structure; it does not predict future price,
guarantee performance or provide trading advice. Validate behavior on your own
symbols, timeframes and execution assumptions before making decisions.
Open-source Pine Script® v6. Educational use only.
Indicador

Execution-Aware Trend [BSL]Execution-Aware Trend is a deliberately ordinary trend-and-breakout strategy
whose main product is visible testing discipline. It answers “what did this
exact ruleset simulate after declared costs, next-tick execution and a fixed
sample split?” It does not predict the next move and does not claim an edge.
This is an original BarState Labs implementation created from an independent
written specification. It does not reproduce another publication’s source,
defaults, interface, chart grammar or report.
HOW IT WORKS
Trend qualification uses a fast and slow EMA. A long setup requires the fast
EMA above the slow EMA and the slow EMA above its value at the configured slope
lookback. The short rule is symmetric. Equality qualifies neither side.
Entry and exit channels always exclude the current bar:
`entryHigh = highest(high , entry length)`
`entryLow = lowest(low , entry length)`
`exitHigh = highest(high , exit length)`
`exitLow = lowest(low , exit length)`
A confirmed close beyond the prior entry channel creates a market-entry
intent only when the matching trend filter qualifies. There is no pyramiding
and no same-calculation reversal.
The close-risk line uses ATR and confirmed closes. For a long position, the
highest observed close is tracked and the line is the greater of its previous
value and `peak close - ATR multiple × ATR`. It therefore never loosens. The
short rule is symmetric and never rises. A channel breach or a confirmed close
through the risk line creates a market-close intent.
EXECUTION MODEL AND COSTS
Orders are not processed on the signal bar’s close. The strategy keeps
TradingView’s normal next-tick behavior, which on historical bars normally
means a fill at the following bar’s open. The declaration includes:
- 0.10% commission per filled order;
- 2 ticks of slippage per market fill;
- 10% of equity order size;
- no pyramiding and no simulated leverage;
- no calculation on every tick or on order fills.
These are generic examples, not estimates for a particular broker or market.
Users must replace them in Properties. The panel cannot detect a manual
Properties override, so it labels them declaration defaults. Simulated fills
do not model liquidity, spread variation, queue position, rejected orders or
market impact.
SAMPLE WINDOWS
The same signal parameters can be viewed as Full history, In-sample or
Out-of-sample. The default split is 2024-01-01 UTC. In-sample ends immediately
before the split; out-of-sample begins at the split. No entry is allowed
outside the selected window, and an open position is closed by a normal delayed
market intent when the window ends.
One visible split does not prove that a user avoided tuning after seeing the
result. The script exposes the boundary; it cannot enforce research behavior.
A visible 100-closed-trade gate is a sample-size warning, not statistical
proof.
CONFIRMED AND STANDARD-CHART BOUNDARIES
New orders require a confirmed bar and `chart.is_standard`. On Heikin Ashi,
Renko, Kagi, Line Break, Range, Point & Figure and other non-standard charts,
the script displays `NON-STANDARD — NO ORDERS` and creates no trades.
The script uses only the current chart symbol and timeframe. It makes no
external requests, uses no lookahead and does not force same-bar-close fills.
Exchange or broker feed corrections can still rebuild historical standard
OHLC after reload.
OUTPUTS
The chart shows fast and slow EMAs, optional prior-bar entry and exit channels,
the active close-risk line, optional sample background and confirmed intent
markers. Compact and Full panels expose state, sample, split, fill model,
declaration costs, closed trades, the 100-trade gate, net result, average closed
trade and maximum drawdown.
Hidden machine-readable plots expose:
- Confirmed entry intent: +1, -1 or 0;
- Confirmed exit intent: +1, -1 or 0;
- Selected sample: 1 or 0;
- OOS flag: 1 or 0.
Order calls contain explicit alert messages, so TradingView order-fill alerts
can identify the simulated action, size, ticker and resulting strategy
position. They are diagnostics, not recommendations.
LIMITATIONS
- Positive net profit is not a design requirement or evidence of robustness.
- Results depend on symbol, feed, timeframe, loaded history, Properties and
inputs.
- Close-confirmed risk exits can gap on the next simulated fill.
- Commission and slippage defaults are not a complete transaction-cost model.
- One in-sample/out-of-sample split is not walk-forward validation.
- The 100-trade gate does not establish significance or future performance.
- Backtests are simulations and are not trading advice or expected returns.
VALIDATION
The candidate passed 16 deterministic Python fixtures and a 16/16 live Pine
harness. Manual TradingView checks covered BTCUSDT and AAPL on daily and
intraday charts, 187 BTCUSDT 30-minute and 103 AAPL hourly trades, unchanged
parameters across IS/OOS, higher costs, reload parity, realtime confirmation,
daily Bar Replay, zero orders on Heikin Ashi, the order-fill alert dialog,
390 × 844 rendering and Pine Profiler. The profiler observed 32,614 executions
on DJI daily history with 0.6 seconds total runtime.
The validation intentionally retains unfavorable evidence: BTCUSDT 30-minute
Full history returned about -3.70%, AAPL hourly Full history about -2.63%, and
AAPL daily OOS about -1.83%. No parameter was retuned after these observations.
ORIGINALITY AND SOURCE
Category demand was selected from dated popularity metadata. No protected,
invite-only or closed source was accessed, and no compared script’s source was
imported. EMA, ATR, prior-bar channels and sample splitting are standard,
transparent building blocks. The implementation is released under MPL 2.0.
CHANGELOG
v1.0.0
- Initial open-source release candidate.
- Symmetric confirmed-close trend and prior-channel entries.
- Non-loosening ATR close-risk line with delayed market exits.
- Explicit commission, slippage, sample split and standard-chart guard.
- Compact/Full evidence panels, signed intent exports and order-fill messages.
Estratégia

Kamote v1.0Kamote v1.0 gives traders a clear, color-coded decision system that tells them the current market regime and the single highest-probability strategy to use—or when to stay out—across Intraday, Day, and Swing horizons.
It does this by combining five independent, hysteresis-protected filters into one coherent recommendation engine, displayed in a clean status matrix with fully configurable alerts. The result is fewer forced trades in dead or chaotic conditions and higher-confidence entries when the conditions actually align.
### Core Value: One Dashboard That Replaces Guesswork ###
Most indicators show isolated signals. Kamote synthesizes volatility regime, higher-timeframe trend direction, trend efficiency, volume behavior, and horizon-specific strategy scoring into a single, actionable output. Traders see at a glance:
Whether volatility is Dead, Healthy, or Extreme
Whether the higher-timeframe linear-regression slope is Bullish, Bearish, or Flat
Whether multi-timeframe Kaufman Efficiency Ratio confirms real trend strength
Whether volume is Expanding, Contracting, or Flat
The optimal strategy (Trend Long/Short, Pullback Long/Short, Momentum Long/Short, Breakout, Mean Reversion) or “Stay Out / None”
Color coding makes the matrix instantly readable. Green supports action, red signals caution or exit, yellow flags transitional states.
### How the Engine Works ###
Kamote runs a single higher-timeframe data request (automatically set by the chosen trading mode) and blends it with chart-timeframe calculations. All regime classifications use percentile ranks plus hysteresis bands so the status does not flicker on every minor bar.
Volatility Regime (ATR Percentile + Hysteresis)
ATR is ranked over a lookback window. Dead (< low percentile), Extreme (> high percentile), or Healthy. Hysteresis prevents rapid oscillation between states. Extreme + contracting volume + weak efficiency is treated as structural noise and forces a “Stay Out” recommendation.
Higher-Timeframe Trend Filter (ATR-Scaled Linear Regression Slope)
Slope is calculated on the higher timeframe, normalized by ATR, and classified Bullish / Bearish / Flat. The threshold itself scales with volatility so the filter stays relevant in both quiet and explosive markets.
Multi-Timeframe Efficiency Ratio
Kaufman’s Efficiency Ratio is computed on both chart and higher timeframes, then blended with user-adjustable weights. A minimum threshold gates whether the move is efficient enough to support trend or momentum strategies.
Volume Regime (Percentile + Hysteresis)
Volume is ranked and classified Expanding / Contracting / Flat. Expanding volume supports breakouts and trend continuation; contracting volume favors mean-reversion or short-side setups depending on direction.
Horizon-Aware Strategy Scoring
The script first checks for hard invalid states (extreme volatility + contracting volume + weak efficiency, flat slope + weak efficiency + flat volume, or swing-mode + flat slope + extreme ATR). If any invalid condition is true, the recommendation is “Stay Out.”
Otherwise it scores eight strategy candidates using eligibility gates and horizon-specific weights:
Trend and Pullback strategies are favored on Day and especially Swing horizons.
Momentum strategies are favored on Intraday.
Breakout receives a boost on Intraday and a discount on Swing.
Mean Reversion is favored on Swing and discounted on Intraday.
The highest-scoring eligible strategy is displayed. Confidence modifiers (healthy ATR, volume alignment, weak prior efficiency, etc.) further refine the score so the recommendation is not binary.
### Designed for Real Trading Workflows ###
Three preset modes (Intra / Day / Swing) automatically adjust higher-timeframe, efficiency length, volume lookback, slope threshold, ATR window, and hysteresis. Users can still fine-tune every parameter. Layout can be horizontal or vertical and placed in any corner. Alerts fire only on confirmed state changes for ATR regime, slope direction, efficiency cross, volume regime, and strategy recommendation—keeping notification noise low.
### Why Traders Adopt It ###
Kamote does not claim to predict the future. It enforces discipline by making regime and edge explicit. When the matrix is green and a strategy is named, the conditions that historically support that style of trade are present. When it says “Stay Out,” the market is offering no edge. That single piece of information—knowing when not to trade—is often more valuable than any entry signal.
The script is pure Pine Script v6, overlay=false, and designed to sit alongside price action or other tools without cluttering the chart. It is built for discretionary traders who want a systematic regime filter and for systematic traders who need a clean, multi-factor permission layer.
Install Kamote v1.0, select your trading horizon, and let the status matrix tell you what the market is actually offering right now. Indicador

STOC - EMA + RSI Pullback TraderThe STOC – EMA RSI Pullback Trader is a long-only trend-following indicator designed to identify potential entries during bullish trends and controlled pullbacks.
Instead of chasing price after a large upward move, the indicator looks for opportunities when price returns toward the faster trend average while the broader trend remains positive.
How it works
The indicator combines:
* 20 EMA for identifying short-term momentum and pullback areas.
* 50 EMA for determining the broader trend.
* RSI for confirming that momentum remains bullish.
An initial Buy signal can appear when the 20 EMA crosses above the 50 EMA and RSI confirms positive momentum.
After the bullish trend is established, a Pullback Buy signal can appear when price revisits the 20 EMA and subsequently confirms strength above it while RSI remains above the selected bullish threshold.
Exit methods
The indicator provides three selectable exit methods:
* 20 EMA crossing below the 50 EMA.
* Price closing below the 50 EMA.
* Either condition, whichever occurs first.
The “Either Condition” setting offers more defensive trade management, while the EMA crossover exit generally gives the trend more room to develop.
Key features
* Initial EMA crossover entries.
* Trend-continuation pullback entries.
* RSI momentum confirmation.
* Adjustable EMA and RSI settings.
* Optional requirement for rising RSI.
* Multiple pullback-confirmation methods.
* Selectable exit logic.
* Buy, Pullback Buy and Exit labels.
* Active-trade background highlighting.
* Trend and trade-status dashboard.
* TradingView alert conditions.
* Dynamic JSON messages for webhook integration.
* Works across equities, indices, futures, forex and cryptocurrencies.
How to use
The indicator is best used on instruments displaying a clear directional trend.
A valid bullish environment generally exists when:
* The 20 EMA is above the 50 EMA.
* Price is trading above the 50 EMA.
* RSI is above 50.
The initial Buy signal identifies a possible new bullish trend. Pullback Buy signals identify potential re-entry opportunities after price returns toward the 20 EMA without invalidating the broader trend.
Avoid treating every signal as an automatic trade. Consider confirming the setup using:
* Higher-timeframe trend direction.
* Support and resistance.
* Breakout structure.
* Volume expansion.
* Relative strength.
* Overall market and sector conditions.
Suggested timeframes
* Daily and weekly charts: positional and swing trading.
* 1-hour and 4-hour charts: shorter-term swing trading.
* 5-minute and 15-minute charts: intraday trading with additional market and volume confirmation.
Alerts
Create a TradingView alert using “Any alert() function call” to receive the indicator’s dynamic Buy and Exit messages. Standard Buy and Exit alert conditions are also available.
Disclaimer
This indicator is provided solely for educational and informational purposes. It does not constitute investment advice, financial advice, trading advice or a recommendation to buy or sell any security or financial instrument.
Trading and investing involve substantial risk, including the possible loss of capital. Historical signals and past performance do not guarantee future results. Always perform your own analysis, apply appropriate position sizing and risk management, and consult a qualified financial professional when necessary. Indicador

Variance-Weighted Regression Trend [BackQuant]Variance-Weighted Regression Trend
Overview
Variance-Weighted Regression Trend is a rolling linear-regression trend indicator that adjusts the influence of observations according to the estimated variance of their regression residuals.
The script first calculates a standard ordinary least-squares regression across the selected window. It then measures the squared residuals around that fit and uses those residuals to estimate how variable the regression error has been through the sample.
Those variance estimates are converted into relative weights. Lower estimated residual variance can receive more influence, while higher estimated residual variance can receive less. A second weighted regression is then calculated using those weights.
The indicator also includes:
EMA, RMA or rolling-average residual variance.
Configurable inverse-variance weighting strength.
Weight regularization and upper/lower weight limits.
Weighted R² and slope-quality diagnostics.
Two regression-channel methods.
Optional trend-flip quality confirmation.
OLS comparison.
Linear regression projection.
Trend colouring and alerts.
Calculation
The basic process is:
Fit an ordinary least-squares regression over the Regression Length.
Calculate the squared residual of every observation around that fit.
Smooth those squared residuals to estimate local residual variance.
Add a regularization floor to reduce unstable extreme weights.
Convert variance into relative observation weights.
Clamp weights between the selected minimum and maximum.
Calculate a second weighted regression.
The weighted line is therefore influenced more by observations receiving larger relative weights and less by those receiving smaller ones.
Variance Weighting
The weighting is based on regression residual variance , not ATR, trading volume or raw price volatility.
For each point:
Residual = Source - OLS fitted value
Squared Residual = Residual²
The squared residuals are then processed using the selected Variance Model.
EMA
Uses exponential smoothing and responds more quickly to recent residual changes.
RMA
Uses a slower recursive smoothing process.
Rolling Mean
Uses a finite moving average of squared residuals.
Weight Power
Weight Power controls how strongly estimated variance affects the regression.
The raw weighting relationship is:
Weight ∝ 1 / Variance^Weight Power
0 gives equal weighting, making the final fit behave like the OLS regression.
1 applies standard inverse-variance-style weighting.
Values above 1 increase the difference between low- and high-variance observations.
Higher settings can make the regression more selective, but can also concentrate too much influence in a small part of the sample.
Variance Regularization
Very small variance estimates can otherwise create extremely large inverse weights.
The script therefore adds a fraction of the window's mean squared residual to each local variance estimate.
Higher regularization makes the weights more uniform.
Lower regularization allows stronger differences between observations.
Minimum and Maximum Relative Weight
Raw weights are normalized relative to their average before being clamped.
A relative weight above 1 means the observation has greater-than-average influence.
A value below 1 means it has less.
The Minimum Relative Weight prevents high-variance observations from effectively disappearing from the regression.
The Maximum Relative Weight prevents very low-variance observations from dominating the entire fit.
Weighted Regression
Once the final weights are calculated, the script solves a weighted linear regression:
Y = Intercept + Slope × X
The displayed line is the current endpoint of that rolling weighted regression.
Each new bar shifts the regression window and recalculates:
OLS.
Residuals.
Variance estimates.
Weights.
Weighted slope and intercept.
OLS Comparison
The optional OLS line shows the endpoint of the initial equal-weight regression.
This makes it easy to see how much the variance weighting is actually changing the result.
If Weight Power is set to 0, the weighted regression and OLS should be effectively aligned.
As the weighting becomes more aggressive, the lines may separate depending on the residual structure inside the window.
Trend State
Trend direction comes from the sign of the weighted regression slope.
Positive slope = bullish.
Negative slope = bearish.
A bullish flip occurs when the stored trend changes from bearish to bullish.
A bearish flip occurs when it changes from bullish to bearish.
Quality Confirmation
Quality Confirmation can be enabled to prevent weak slope changes from immediately flipping the trend state.
When enabled, an opposite slope must also satisfy:
Minimum Weighted R².
Minimum Slope / Standard Error.
If those conditions are not met, the existing trend state remains active even if the current slope temporarily changes sign.
Weighted R²
Weighted R² measures how well the weighted straight-line regression describes the current sample.
Higher values indicate that the weighted observations are more closely aligned with a linear fit.
Lower values indicate a less orderly linear relationship.
R² does not determine trend direction and should not be interpreted as a forecast of future performance.
Slope / Standard Error
The script calculates the absolute weighted slope relative to its estimated standard error:
|Slope| / Slope Standard Error
This is used as a practical slope-quality measure.
Higher values indicate that the fitted slope is larger relative to the estimated regression error.
It is used by the optional Quality Confirmation setting and is not presented as a formal significance test.
Regression Channels
Two channel-width methods are available.
Weighted Residual RMS
Uses the weighted root-mean-square distance of observations from the fitted regression.
This reflects the general amount of scatter around the line.
Regression Standard Error
Uses the calculated standard error of the fitted current regression value.
This normally represents a different and often narrower measure than residual RMS.
The Channel Multiplier scales whichever method is selected.
Expand During Poor Fit
When enabled, the channel becomes wider as Weighted R² decreases.
This is intended to visually reflect greater uncertainty when the current window is poorly described by a straight line.
The expansion affects only the channel width.
It does not alter the regression or trend calculation.
Projection
The Projection extends the current regression slope forward by the selected number of bars.
It is simply:
Current fitted line extended using the current slope.
It is not a separate forecasting model.
As the regression changes on new bars, the projection also changes.
Current Relative Weight
The Data Window shows the final relative weight assigned to the newest observation.
A value:
Above 1 = greater-than-average influence.
Below 1 = less-than-average influence.
This can help show how the current observation is being treated by the variance-weighting model.
Effective Sample Size
The indicator also reports:
Effective N = (Sum of Weights)² / Sum of Squared Weights
This provides a simple measure of weight concentration.
If weights are similar, Effective N remains close to the full Regression Length.
If a smaller group of observations receives most of the weight, Effective N falls.
This is useful when experimenting with aggressive Weight Power or wide weight limits.
Trend Strength
Trend Strength is used only for the regression glow.
It combines:
60% Weighted R².
40% normalized Slope / Standard Error.
It does not affect the regression or signals.
ATR(14) is used only to scale the visual width of the glow and flip bloom to the instrument.
Input Guide
Regression Length
Controls the size of the rolling regression sample.
Projection Bars
Controls how far the current fitted slope is extended visually.
Variance Length
Controls how quickly the residual-variance estimate changes.
Variance Model
Selects EMA, RMA or Rolling Mean smoothing of squared residuals.
Weight Power
Controls the strength of inverse-variance weighting.
Variance Regularization
Reduces extreme differences between weights.
Minimum / Maximum Relative Weight
Limits how little or how much influence any one observation can receive.
Channel Width
Selects Weighted Residual RMS or Regression Standard Error.
Channel Multiplier
Scales the regression channel.
Poor Fit Expansion
Optionally widens the channel as R² deteriorates.
Quality Confirmation
Requires minimum regression fit and slope quality before allowing trend flips.
How to use it
The indicator can be used as:
A regression-based trend filter.
A comparison between ordinary and variance-weighted regression.
A way to study how residual-based weighting changes a rolling trend estimate.
A trend-quality filter using R² and slope strength.
A regression channel for visualizing fit dispersion.
The OLS Comparison and Data Window values are particularly useful when testing the weighting settings, because they show whether the extra weighting is materially changing the regression or simply producing a result close to ordinary least squares.
Limitations
The variance estimates are derived from OLS residuals inside the same rolling window.
The model is a custom two-stage weighted regression rather than a full generalized least-squares procedure.
Higher Weight Power can concentrate the fit in a relatively small part of the sample.
Linear regression cannot represent every type of market structure.
High R² does not imply future trend continuation.
The forward projection is only a linear extrapolation of the current fit.
Quality Confirmation can reduce weak flips but can also delay genuine changes in direction.
Data Window
The script exposes:
Weighted Slope.
Weighted R².
Slope / Standard Error.
Weighted Residual RMS.
Regression Standard Error.
Current Relative Weight.
Effective Sample Size.
Trend Strength.
Alerts
The indicator includes:
Variance-Weighted Regression Bullish: trend changes from bearish to bullish.
Variance-Weighted Regression Bearish: trend changes from bullish to bearish.
Variance-Weighted Regression Flip: either transition occurs.
Summary
Variance-Weighted Regression Trend starts with a normal rolling OLS regression, measures the residual variance around that fit, and uses those estimates to assign relative weights to the observations in a second regression.
The weighting strength, variance smoothing, regularization and weight limits are all configurable, making it possible to move from essentially equal-weight OLS to a much more selective fit.
The final weighted slope controls the trend state, while Weighted R² and the Slope / Standard Error score can optionally be used to filter weak reversals.
Regression channels, OLS comparison, forward projection and the visual strength system provide additional context around the core weighted regression without changing the underlying trend logic.
Indicador

Mann-Kendall Trend Significance [RC Tools]RC Tools — Mann-Kendall Trend Significance
────────────────────────────────────────────────────────────────────
█ OVERVIEW
Most trend tools answer "which way is price going." This one answers a different question: "how statistically unlikely is it that this trend is just noise." It applies the Mann-Kendall test — a nonparametric hypothesis test from statistics, most commonly used in hydrology and climate-science time-series analysis — to price, turning "trend" into a proper standardised test statistic rather than a slope or a moving-average read.
█ WHAT IT DOES
Computes a standardised Z-statistic for monotonic trend over a rolling window and classifies each confirmed bar as a Significant Uptrend or Significant Downtrend once that statistic crosses a configurable significance threshold. Colours the chart background accordingly, plots both the smoothed and raw Z line in a dedicated pane against static threshold lines, and shows a table with the current state, how long price has been in it, and historical base rates (average forward return and win rate) for each state.
█ THE THEORY BEHIND IT
The Mann-Kendall test was developed to detect a monotonic trend in a time series without assuming any particular distribution or that the trend is linear — it only asks whether values tend to rise (or fall) more often than chance would predict. It does this by comparing every pair of points in a window and tallying how often the later point is higher versus lower than the earlier one. Under the null hypothesis of no trend, that tally has a known variance, which lets the raw count be converted into a Z-score — the same logic behind any standard statistical significance test. A Z-score of 1.645, for example, corresponds to the classic 90% one-tailed critical value: at that level, the observed pattern would be expected by pure chance less than 10% of the time.
This is a meaningfully different question from "has price been going up." A choppy market can have more up-days than down-days without ever producing a statistically significant Z-score; a genuinely persistent trend will.
█ HOW IT IS CALCULATED
1. Over a rolling window, compute S — the sum, across every pair of points in the window, of the sign of (later value − earlier value). A persistent uptrend pushes S strongly positive; a persistent downtrend pushes it strongly negative; a directionless window keeps it near zero.
2. Under the null hypothesis of no trend, S has a known variance: Var(S) = n(n−1)(2n+5) / 18, where n is the window length (this assumes no tied values, a reasonable approximation for continuous price data).
3. Standardise S into a Z-score, with the standard continuity correction applied.
4. Optionally smooth the Z-statistic (it is naturally "steppy," since individual pairs enter and exit the window discretely as new bars form).
5. When smoothed Z rises above the long threshold, the state flips to Significant Uptrend. When it falls below the (negative) short threshold, it flips to Significant Downtrend. Otherwise the state holds — this is hysteresis, not noise.
Classification occurs ONLY on confirmed bar close — the plotted Z, the background colour and the table all update together, so nothing here can disagree mid-bar or flip back and forth as the current bar forms.
█ SETTINGS & CONFIGURATION
• Source (default close)
• Window Length (default 20, capped at 50 to keep the pairwise comparison fast)
• Long / Short Significance Thresholds (default 1.645 each, the classic 90% one-tailed critical value) — set independently so long and short conviction can be tuned separately rather than assuming symmetric behaviour
• Smoothing Length and Type (default 3-period EMA) — reduces the raw statistic's step-like behaviour
• Forward Return Window (default 20 bars) — the horizon used for the base-rate table
• Table visibility, position and colours are fully configurable; the main-chart background painting can be toggled off if you only want the statistics pane
█ HOW TO USE IT
Use it as a trend-confirmation filter, not a standalone entry trigger. Because it requires the statistic to clear a significance threshold rather than simply cross zero, it tends to flag fewer, more deliberate trend changes than a typical oscillator — useful for filtering out other tools' false starts in choppy conditions. Check the base-rate table's sample count before treating any single state as meaningfully predictive.
Works on any asset and timeframe with sufficient history for the Window Length.
█ LIMITATIONS
• Mann-Kendall tests for a MONOTONIC trend within the window. It says nothing about the trend's magnitude, and any use of it as a precision entry/exit signal is a misuse.
• The variance formula assumes no tied values, which is reasonable for continuous price data but can be mildly optimistic on assets with heavy price discretisation (e.g. very low-priced or thinly-traded instruments).
• The window length is capped at 50 to keep the pairwise comparison fast — larger structural trends spanning more bars are not captured directly.
• The raw Z statistic is discrete and "steppy" by construction; smoothing trades responsiveness for a cleaner state transition.
• Historical base-rate stats need a meaningful sample count (check N) before being trusted, especially in a low-frequency-flip regime or on a short history.
• This script does NOT repaint. All classification updates on confirmed bar close only.
█ DISCLAIMER
For educational and informational purposes only. Nothing here is financial advice. Past behaviour of any trend-significance state does not indicate future results. Trade at your own risk.
Indicador

Market Path Forecast [BOSWaves]Market Path Forecast - Swing-Calibrated Directional Forecast with Confidence Cone, Structure-Snapped Levels, and Adaptive Horizon
Overview
Market Path Forecast is a swing-calibrated probabilistic directional forecast system that derives its target price, forecast duration, and cone width entirely from the statistical properties of the instrument's own historical swing behavior, where the path cone, level placement, and forecast horizon all adapt continuously to the accumulated record of completed swings rather than applying fixed ATR multiples or arbitrary projection distances.
Instead of projecting fixed percentage moves or static ATR extensions, the system accumulates the percentage size and bar duration of each completed directional swing into weighted sample arrays, computes the weighted average and standard deviation of those samples, and uses these statistics to estimate where the current swing is likely to travel and how long it is likely to take. The resulting forecast is not a generic technical projection but a statistically calibrated estimate derived from the instrument's actual measured movement history.
This creates a forecast framework that is self-calibrating to each instrument and timeframe. Instruments with large consistent swings produce wide confident cones pointing to distant targets. Instruments with small erratic swings produce narrower cones with closer targets. The confidence interval setting scales the cone width relative to the measured historical variance, allowing the trader to choose whether to view the tight central tendency or the broader probable range. Structure snap alignment pulls forecast levels toward nearby historical pivot prices, anchoring statistically derived targets to structurally significant levels. And the adaptive horizon dynamically adjusts the projection duration as the current swing develops, so the cone length reflects how much time is estimated to remain rather than a fixed number of bars.
Price is therefore evaluated against a forecast that reflects the instrument's own statistical swing personality rather than a generic overlay applied identically regardless of how the instrument actually moves.
Conceptual Framework
Market Path Forecast is founded on the principle that the most reliable basis for a directional price forecast is the statistical distribution of the instrument's own completed swing history, and that both the target level and the confidence around that target should derive from measured historical variance rather than from fixed indicator parameters.
Traditional forecast tools apply static extensions, fixed ATR projections, or Fibonacci ratios that carry no relationship to how the specific instrument actually moves. This framework replaces static projection with statistical estimation, accumulating a rolling weighted sample of historical swing sizes and durations and deriving forecast parameters from that sample on every bar. Recent swings receive greater weight than older ones, ensuring the forecast adapts dynamically to evolving market behavior while maintaining the stability that comes from a sufficient sample of historical evidence.
Three core principles guide the design:
Forecast targets, durations, and cone widths should derive from the statistical properties of the instrument's own swing history rather than from fixed parameters, ensuring every element of the projection reflects actual measured behavior rather than generic assumptions.
The confidence cone should scale with historical swing variance through a statistically meaningful confidence interval parameter, so traders understand they are viewing a fraction of the measured probability distribution rather than an arbitrary visual band.
Forecast levels should be snapped toward nearby historical structure prices where they exist within the configurable snap range, anchoring statistically derived targets to the structural price levels that may have influenced prior swing reversals.
This shifts directional forecasting from fixed-parameter projection into instrument-specific statistical estimation where all visual elements adapt to the instrument's own historical behavior.
Theoretical Foundation
The indicator combines swing detection through highest and lowest lookback comparison, recent-weighted average and standard deviation calculation across historical swing percentage moves and bar durations, directional forecast derivation from the appropriate bull or bear sample arrays, momentum-adjusted path curvature using EMA difference normalization, structure-snap level alignment using nearest historical pivot within the configurable ATR search radius, and historical support and resistance zone construction from separate pivot detection with age-based expiry and break detection.
Swing direction is tracked by monitoring whether the current highest or lowest lookback value is being set by the current high or low, with confirmed swing points registered when price rotates away from a prior extreme. Each completed directional leg contributes its percentage move and bar duration to separate bull and bear sample arrays using a weighted push that replaces oldest samples beyond the configured maximum. The weighted average applies linearly increasing weights from oldest to most recent, giving recent swings proportionally greater influence. Standard deviation is computed from the same weighted scheme, producing a variance measure that reflects recent behavior more than distant history. The forecast target is calculated as a percentage move from the swing origin, with the extension factor derived from the deviation ratio to scale the extension level beyond the primary target.
Four internal systems operate in tandem:
Swing History Engine : Detects confirmed swing direction changes, measures the percentage move and bar duration of each completed leg, and accumulates these into directional and combined weighted sample arrays that feed all downstream forecast calculations.
Statistical Forecast Engine : Derives weighted average target percentage and duration from the directional sample arrays, falls back to combined samples when directional sample count is insufficient, calculates the standard deviation for cone width scaling, and applies minimum spacing enforcement to prevent levels from overlapping.
Path and Level Rendering System : Constructs the three-layer confidence cone using eased smooth interpolation with momentum-derived curvature, and renders up to six forecast levels as three-layer box zones with structure-snapped prices, directional coloring, and configurable label display.
Historical Structure System : Independently detects pivot highs and lows at the configured structure pivot length, maintains active zone boxes with age-based fading and break detection, stores pivot prices in a rolling array that feeds the structure snap function for all forecast levels, and enforces maximum zone count and age limits.
This design ensures the forecast derives entirely from measured historical behavior while the structure snap layer connects statistically derived levels to structurally significant prices where they exist in proximity.
How It Works
Market Path Forecast evaluates price through a sequence of swing-calibrated and statistically derived processes:
Swing Direction Tracking : On each bar, the highest high and lowest low over the configured swing length are compared to the current bar. When the current high sets the lookback high, direction tracks bullish. When the current low sets the lookback low, direction tracks bearish. Confirmed swing points are registered when price rotates away from the prior extreme.
Swing Sample Accumulation : On each confirmed swing direction change, the completed leg's percentage move and bar duration are calculated and pushed into the appropriate directional and combined sample arrays with size capping at the configured maximum. Bull legs accumulate into the bull arrays and bear legs into the bear arrays.
Weighted Forecast Derivation : The weighted average of the directional sample array provides the forecast percentage move. The weighted average of the duration array provides the forecast bar count. The weighted standard deviation of the directional array provides the variance measure for cone scaling. When fewer than three directional samples exist, the combined arrays are used as fallback.
Adaptive Horizon Calculation : The estimated remaining bars for the current swing are calculated by subtracting elapsed bars from the estimated total duration and clamping to the configured minimum and maximum. When adaptive horizon is disabled, the fixed bar count is used instead.
Target Calculation : The primary target is derived from the swing origin price adjusted by the forecast percentage in the forecast direction, with a minimum distance floor enforced as an ATR multiple to prevent targets from forming too close to current price.
Level Derivation : Target 1, 2, and 3 are placed at 40, 70, and 100 percent of the base distance. The extension level is placed beyond Target 3 using a factor derived from the deviation-to-mean ratio. The opposite structure reference and invalidation level are placed on the opposing side of price.
Structure Snap Application : Each raw level price is tested against the rolling historical structure price array. If a matching structural high or low exists within the ATR snap range on the correct side of price, the level is blended toward that structural price by the configured snap strength.
Minimum Spacing Enforcement : After snapping, all levels are adjusted to maintain a minimum separation equal to twice the zone ATR width, preventing levels from overlapping regardless of snap results.
Cone Construction : The base band half-width is derived from the greater of the ATR floor and the price-converted standard deviation, clamped to a maximum fraction of the distance to Target 3, then multiplied by the confidence interval setting. Smooth eased interpolation builds the outer, inner, and center polyline paths between current price and the Target 3 level with momentum-derived curvature applied.
Historical Structure Zone Management : Pivot highs and lows detected at the structure pivot length receive dual-layer zone boxes that extend rightward each bar, fade with cubic age scaling, convert to dotted broken style when price closes through them, and expire after the configured maximum age or break age.
Together, these elements form a continuously updating forecast system where every visual element adapts to the instrument's measured swing history and structural price environment.
Interpretation
Market Path Forecast should be interpreted as a statistically calibrated swing forecast with a probabilistic confidence cone and structure-aligned target levels:
Forecast Path Cone : The three-layer cone extending from current price represents the probable range of price paths based on historical swing behavior. The outer layer covers the full confidence interval width. The inner layer covers approximately 55 percent of the cone width. The center line represents the weighted average expected path.
Cone Width : A wide cone indicates high historical swing variance where completed swings varied significantly in size. A narrow cone indicates consistent swing behavior with low variance. The confidence interval setting controls how many standard deviations of historical variance the cone spans.
Cone Curvature : The cone bends in the direction of current EMA momentum, reflecting whether the trend currently has upside or downside momentum bias that may influence the directional path of the developing swing.
Target 1, 2, 3 Levels : Three-layer zone boxes at progressively greater distances represent the expected first, intermediate, and primary swing completion levels derived from the weighted average of historical swings at 40, 70, and 100 percent of the base distance.
Extension Level : Beyond Target 3, the extension level marks where larger-than-average swings have historically reached, scaled by the ratio of standard deviation to mean swing size. A larger extension factor indicates that historical swings have been more variable and have occasionally traveled significantly beyond average.
Support / Resistance Level : The opposing-direction level on the near side of price identifies the closest structural reference in the opposing direction, representing the level where a counter-swing could develop before the forecast target is reached.
Invalidation Level : The furthest opposing level marks the price beyond which the current swing forecast would be statistically invalidated, representing the distance at which counter-directional movement exceeds what is consistent with the current swing remaining intact.
Historical Structure Zones : Green support zones and red resistance zones from historical pivot detection provide the structural price environment that both informs the forecast level snap function and serves as ongoing structural reference for price interaction monitoring.
Broken Structure Zones : Zones that have been closed through convert to dotted style with faded coloring, indicating the former level has been breached and may now function in the opposing structural role.
Cone width, target level placement, snap alignment to structure, and invalidation level distance collectively provide more forecast context than any element in isolation.
Signal Logic & Visual Cues
Market Path Forecast generates two directional signals tied to swing direction changes:
Bullish Forecast : Triggered when swing direction flips from bearish to bullish, resetting the forecast origin to the confirmed swing low and projecting the cone and levels upward toward the statistically estimated bull swing targets.
Bearish Forecast : Triggered when swing direction flips from bullish to bearish, resetting the forecast origin to the confirmed swing high and projecting the cone and levels downward toward the statistically estimated bear swing targets.
Each forecast reset incorporates the newly completed swing into the weighted sample arrays before generating the next projection, ensuring every forecast benefits from the most recent available behavioral evidence.
Alert generation covers bullish and bearish forecast direction changes for systematic swing-based monitoring workflows.
Strategy Integration
Market Path Forecast fits within swing-calibrated directional and statistical target-based trading approaches:
Target-Based Exit Planning : Use the three forecast target levels as a staged exit framework, planning partial position reductions at T1, T2, and T3 rather than targeting a single fixed level, allowing structured progression through the statistically estimated swing completion zone.
Cone Containment Monitoring : Monitor whether price is staying within the inner confidence cone or pressing against the outer boundaries as a real-time swing health indicator. Price persistently hugging the outer cone boundary in the forecast direction suggests above-average momentum. Price compressing toward the center early in the forecast suggests weakening follow-through.
Extension Level Context : Use the extension level as a target for high-momentum setups where the deviation-to-mean ratio is elevated, indicating that historical swings have occasionally extended significantly beyond the average. A larger gap between T3 and the extension level reflects greater historical variability.
Invalidation Level Risk Management : Use the invalidation level as the maximum tolerable counter-directional excursion, beyond which the current swing forecast is no longer statistically consistent with historical behavior and the position rationale is undermined.
Structure Snap Confluence : Prioritize levels that have been snapped to nearby structural pivot prices over purely statistically derived levels, as these represent locations where both the measured swing expectation and historical price structure align simultaneously.
Confidence Interval Calibration : Use a lower confidence interval such as 0.5 for tight conviction analysis where you want to see only the central tendency of the forecast. Use 1.5 or 2.0 to visualize the broader probability range that captures less typical swing outcomes.
Technical Implementation Details
Swing Detection : Highest and lowest lookback comparison with direction tracking and confirmed point registration on price rotation
Sample Arrays : Weighted push accumulation for bull, bear, and combined percentage and duration arrays with configurable maximum size
Forecast Statistics : Linearly increasing weight scheme for weighted average and standard deviation with directional to combined fallback below minimum sample threshold
Cone Construction : Eased smooth interpolation with momentum-normalized EMA curvature across configurable step count for outer, inner, and center polyline paths
Level System : Six forecast levels with percentage-of-base-distance placement, deviation-ratio extension scaling, structure snap blending, minimum spacing enforcement, and three-layer zone box rendering
Structure System : Pivot-based zone detection with dual-layer boxes, rolling structure price array for snap function, cubic age fading, break detection with style conversion, and configurable zone count and age limits
Performance Profile : Last-bar rendering with full polyline and object rebuild each update, configurable level count for object management
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Intraday swing forecasting with shorter swing length and fewer historical swings for fast adaptation to intraday directional changes
15 - 60 min : Session-level swing projection with balanced swing length and moderate sample count for meaningful statistical accumulation across typical session swings
4H - Daily : Swing-level directional forecasting with longer swing detection and larger sample count for statistically robust estimates derived from significant structural moves
Suggested Baseline Configuration:
Swing Length : 16
Historical Swings : 20
Volatility Length : 200
Adaptive Forecast Horizon : Enabled
Confidence Interval (SD) : 1.0
Path Curvature : 0.45
Number of Levels : 6
Structure Snap Strength : 0.65
Show Historical Structure : Enabled
Show Forecast Path : Enabled
Show Forecast Levels : Enabled
These suggested parameters should be used as a baseline; their effectiveness depends on the instrument's swing frequency, historical swing consistency, and preferred forecast horizon, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Forecast targets too close to price : Decrease Minimum Target Distance toward 1.0 to allow targets to form closer to price, or increase Historical Swings to accumulate more samples that may include larger average moves.
Forecast targets too far from price : Increase Minimum Target Distance to enforce greater separation, or decrease Historical Swings to weight more recent and potentially smaller swing samples more heavily.
Cone too wide or too narrow : Adjust Confidence Interval to expand or contract the cone relative to the measured standard deviation of historical swings, using 0.5 for a tight central tendency view or 2.0 for a broad probability range.
Forecast flipping too frequently : Increase Swing Length to require more bars on each side of a confirmed swing extreme, filtering shorter-term oscillations from the swing detection.
Forecast too slow to update : Decrease Swing Length toward 6 for faster swing confirmation, or decrease Historical Swings to allow the weighted average to adapt more quickly to recent behavior changes.
Levels not snapping to structure : Increase Structure Snap Range to widen the ATR distance within which structural pivot prices attract forecast levels, or increase Structure Snap Strength toward 1.0 for stronger magnetic pull toward nearby structure.
Too many historical structure zones : Reduce Maximum Zones to limit visible structural zones, or decrease Maximum Zone Age to expire older zones sooner and keep the chart focused on more recent structural history.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Instruments with consistent swing behavior where historical percentage moves and durations cluster tightly, producing low variance forecasts with narrow confident cones that accurately reflect the instrument's typical directional tendency
Trending markets where completed swings accumulate rapidly and the weighted sample arrays update frequently, keeping the forecast calibrated to current momentum characteristics
Swing-based trading approaches where statistically derived target levels replace arbitrary Fibonacci or ATR projections with instrument-specific measurements of where swings have historically terminated
Structure-rich instruments where the snap function can align statistically derived levels with meaningful historical pivot prices, creating confluence between statistical expectation and structural significance
Reduced Effectiveness:
Instruments with highly erratic swing behavior where percentage moves vary widely between legs, producing large standard deviations and wide uncertain cones that reduce the specificity of target level placement
Range-bound or choppy markets where swing detection fires frequently on minor oscillations, populating the sample arrays with small inconsistent measurements that undermine forecast reliability
Instruments with insufficient completed swings within the sample window where the fallback to combined arrays may produce forecasts that blend bull and bear statistical properties inappropriately
Very short timeframes where completed swings are so numerous and small that the weighted average converges on noise-level movements without statistical significance
Markets undergoing structural regime changes where historical swing statistics are no longer representative of current behavior, making the weighted average a poor estimate of future swing potential until sufficient new samples accumulate
Integration Guidelines
Confluence : Combine with BOSWaves structural tools, volume analysis, or momentum indicators to validate forecast direction and target level interactions with broader analytical context before committing to swing-based trade plans
Sample Count Awareness : Monitor whether the forecast is drawing on directional or combined samples by assessing how many completed swings in the current direction exist within the historical window. Fewer than three directional samples means the forecast is using combined statistics that blend both directions.
Cone Evolution Monitoring : Track cone width changes across successive forecast resets as a volatility regime indicator. Progressively widening cones across multiple swings suggest increasing swing size variability. Narrowing cones suggest the instrument is entering a more consistent swing rhythm.
Structure Snap Validation : When a level snaps significantly from its raw statistical position to a nearby structural pivot, treat the snapped level with elevated confidence as it represents simultaneous statistical expectation and structural significance.
Invalidation Discipline : Respect the invalidation level as a hard position management boundary. A close beyond the invalidation level indicates counter-directional movement that exceeds the statistical parameters of the current forecast, warranting position reassessment regardless of other analytical factors.
Disclaimer
Market Path Forecast is a professional-grade swing-calibrated statistical forecast and structural analysis tool. It uses weighted historical swing statistics with confidence interval scaling and structure snap alignment but does not predict future price movements with certainty. All forecasts represent statistical estimates based on historical behavior and carry inherent uncertainty that increases with forecast horizon. Results depend on market conditions, instrument swing consistency, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates order flow context, structural analysis, and comprehensive risk management. Indicador

HTF FVG Tracker (M1D)HTF FVG Tracker
Keeps a running ledger of the hourly, four-hour and eight-hour fair value gaps on any intraday chart. Each gap is drawn the moment its candle set completes on its own timeframe, and each zone runs its own timeframe's length forward and then stops — so the day reads left to right as a clean staircase of imbalances, hour by hour, instead of a pile of boxes all stretching to the live candle at once.
It is a marking tool, not a signal tool. It draws where higher-timeframe imbalances printed and what has happened to them since, and leaves the read to you.
The zones
A bullish gap (BISI) is a candle whose low sits above the high two candles back; a bearish gap (SIBI) is a candle whose high sits under the low two candles back. Each is measured on the tracked timeframe's own candles — H1, H4 and H8, each with its own switch — and drawn from its displacement candle forward.
Every zone carries its name inside the box at the right edge, centred on the zone's midline: H1+ for a bullish hourly gap, H4- for a bearish four-hour one. A setting adds the displacement candle's New York hour, so a four-hour gap reads H4+ 2PM. The fill colour states direction; the border is a solid line on every zone so the edges stay readable where timeframes overlap.
The window
By default a zone extends exactly its own timeframe past its formation: an hourly gap gets one more hour, a four-hour gap four hours, an eight-hour gap eight — then its right edge is fixed. How many of its own candles it runs is a setting, and a second mode keeps the newest zone per timeframe extending until the next zone on that timeframe prints instead.
Either way, if a new gap prints while an earlier zone on the same timeframe is still open, the earlier zone is cut at the new zone's left edge. Nothing overlaps raggedly, and every box's width tells you how long it was the live imbalance.
Volume imbalance and suspension blocks
A fair value gap measured wick to wick understates a fast leg. Where the candle bodies also gap on either seam of the displacement candle while the wicks still bridge it, that volume imbalance is part of the same region, and the zone absorbs it — the edge extends from the wick to the body it should have reached. Each seam is tested on its own.
A suspension block is three same-direction candles whose bodies gap at both seams with no wick gap anywhere — a span price never traded back through. It is drawn as its own zone, from the first candle's close to the last candle's open, tagged SB.
A body gap across a session or weekend break is a calendar artefact, not an imbalance, so any seam spanning more than one candle's worth of time is excluded from both rules. Absorption and suspension blocks each have their own switch.
Fills
A fill is a candle body closing through the far edge of the zone. A wick into the zone is a touch, and a touch never counts. By default a fill inside the zone's window shortens the box to the fill bar but keeps it on the chart — the ledger is the point, and a filled gap is still part of the day's record. You can instead leave a fill unmarked, or delete the zone outright. Zones older than a set number of days are removed either way.
Consequent encroachment
Each zone can carry its midpoint — the consequent encroachment of that gap — as a dotted line through the box. One switch.
Method & repainting
Each timeframe is read with a single higher-timeframe request using confirmed candles only — offset by one bar with lookahead, the standard non-repainting form. Detection is gated to the chart bar's close, so a zone appears on the first closed chart bar after its higher-timeframe candle completes, and nothing appears mid-bar and then withdraws.
In the default mode a zone's full window is drawn as soon as the zone prints, so its right edge can sit a little ahead of the live candle until the window closes. In the until-the-next-FVG mode the newest zone per timeframe extends rightward as bars print — that is the box tracking the present, not its history changing.
The chart timeframe has to be at or below the timeframe being tracked. On a 4-hour chart you get the H4 and H8 ledgers only, and above H8 the script says so on the chart rather than drawing nothing.
Alerts
Three, one per timeframe, firing on bar close when a new zone prints on that timeframe — gap or suspension block.
What it will not do
It places no entries, exits, stops or targets, draws no bias and grades no gap. It does not decide which imbalance matters — that is a judgement about context this script does not have. A quiet day showing only a handful of zones is the tool working, not failing.
Settings
The three timeframe switches and days of history; the zone extension mode and its candle count; volume imbalance absorption, suspension blocks, and the fill behaviour; bullish, bearish and border colours with the zone fill transparency; the consequent encroachment line, the New York hour tag, and label text size.
Disclaimer
This is a decision-support tool for discretionary ICT trading. It is not financial advice, and no market's past behaviour is indicative of future results. Indicador

EMA Pullback Trend Continuation Strategy with Volume and Momentu
Description:
Most trend-following strategies share the same flaw: they enter on breakouts. A stock breaks above resistance, the moving average crosses over, the indicator fires — and the entry price is at the top of the move that just happened. The trader is buying strength into a market that has already moved. When the move pauses or retraces, as nearly every trending move does, the position immediately goes underwater. The trader who waited for the breakout is now holding a losing position at precisely the moment when the chart looks its worst.
Pullback strategies solve this structurally. Instead of entering on the breakout, they wait for the trend to establish itself, then enter on the first meaningful retracement back toward a key dynamic level. The entry is at a better price, the stop can be placed tighter, and the risk-to-reward ratio is fundamentally more favorable. The trade-off is patience, pullbacks require waiting and watching while the initial breakout move plays out without you. For systematic traders, that patience is enforced by rule rather than willpower.
This strategy builds a pullback entry system around the 50 and 200 EMA combination, arguably the most widely watched moving average pair in retail trading, with volume confirmation and a momentum filter to ensure the pullback is a genuine pause in a healthy trend rather than the beginning of a reversal.
Why the 50 EMA Specifically
The 50 EMA is not arbitrary. It represents approximately 10 weeks of price action on the daily chart, two and a half months. In an uptrending market, the 50 EMA tends to act as the level where the dominant trend reasserts itself after a normal consolidation or retracement.
Institutional traders who missed the initial move use pullbacks to the 50 EMA as value entries in a trend they believe is still intact. That institutional behavior is what creates the bounce, not because the 50 EMA is a magic line, but because enough participants are watching it and acting around it that reactions become self-reinforcing.
The 200 EMA defines the broader regime. When price is above the 200 EMA, the instrument is in a long-term uptrend. Below it, a long-term downtrend. The 50 and 200 EMA together create a two-timeframe framework: the 200 defines which direction to trade, and the 50 defines where to enter in that direction.
The Pullback Condition
An uptrend pullback entry requires three conditions to be met simultaneously. First, the 50 EMA must be above the 200 EMA, the shorter-term trend is aligned with the longer-term trend. Second, price must have retraced to touch or close below the 50 EMA after having been above it, a genuine pullback has occurred, not just a pause near the high. Third, price must close back above the 50 EMA on the entry bar, the pullback is over and the trend is resuming. This third condition is the entry trigger. It requires confirmation that the 50 EMA has acted as support, not just that price reached it.
The mirror condition applies for downtrend entries: 50 EMA below 200 EMA, price rallies to touch the 50 EMA from below, then closes back below it.
Volume Confirmation
Volume is added as a quality filter for one specific reason: genuine trend continuation moves tend to show increased volume on the bar that confirms the resumption. A close back above the 50 EMA on declining volume suggests the bounce has limited conviction, institutional participation is not behind it. A close back above the 50 EMA on above-average volume suggests real buying is supporting the resumption. The volume filter checks whether volume on the confirmation bar exceeds its 20-period average. This eliminates a significant portion of false pullback signals that occur during low-liquidity periods.
Momentum Confirmation with RSI
RSI is added not as an overbought/oversold indicator, using RSI that way in a trend-following strategy is counterproductive, but as a momentum health check. A healthy uptrend pullback should show RSI holding above 40 when the confirmation bar fires. If RSI has dropped below 40 during the pullback, momentum deterioration is significant enough that the trend may be genuinely weakening rather than pausing. Similarly, for downtrend entries, RSI should be below 60. This filter does not reduce win rate significantly in most backtests, but it meaningfully reduces the depth of losing trades by avoiding entries into pullbacks that are actually early-stage reversals.
Exit Structure
The take-profit is set at 2.5x ATR from entry. The stop-loss is placed below the swing low of the pullback for longs, the lowest point price reached during the retracement, with an ATR buffer. This placement is intentional: if price breaks below the swing low that formed during the pullback, the pullback structure is broken and the trade thesis is invalidated regardless of where the EMAs are. Using the structural swing low rather than a fixed ATR stop keeps the stop level meaningful rather than arbitrary.
Timeframes and Instruments
The 50/200 EMA pullback framework works across all major timeframes, but performs most consistently on the daily and 4-hour charts where the EMAs have enough historical context to be genuinely meaningful. On very low timeframes, the 50 EMA responds too quickly to noise and pullback signals become indistinguishable from choppy ranging behavior. Strong trending instruments, equity indices, large-cap tech stocks, major forex pairs, and trending crypto assets, produce the cleanest setups because the 200 EMA slope is clearly defined and the 50 EMA acts with more consistency as a support level.
Common Failure Modes to Watch in Backtesting
The most consistent failure mode for this strategy is trading it in a ranging market where the 50 and 200 EMAs are flat and intertwined. When the EMAs are not clearly separated and sloping, pullbacks to the 50 EMA are not meaningful, they are just random touches of a flat average in a directionless market. Check the slope of both EMAs in your backtest and consider adding a minimum slope threshold. The second failure mode is entering pullbacks that are actually the early stages of a trend reversal, the RSI filter addresses this partially, but no filter eliminates it entirely. Always check maximum adverse excursion in backtesting to understand how far against the position typical losing trades move before closing.
Shared for educational purposes. This is not investment advice. Always backtest on your own instruments and timeframes with realistic commission and slippage before evaluating performance.
Estratégia

Buy Signal Ema Macd CrossBuy Signal Ema Macd Cross — Xcelerate Trade
All-in-one indicator for TradingView: multi-factor BUY confluence on the price chart + classic MACD (12, 26, 9) in a separate pane below.
WHAT YOU GET
• Price chart: MA14 (purple) and MA200 (red) — MA25/50/99 optional
• BUY labels when all confluence rules align (not on a single isolated MACD cross)
• Live Confluence table — MACD, Signal, Histogram, condition checks, active window
• Movable table — 9 screen positions (corners & centers)
• MACD pane: official TradingView-style histogram (4-tone momentum colors), MACD line, Signal line (orange), zero line
BUY SIGNAL LOGIC
A BUY fires only when these align within the Confluence window (default: 8 bars):
1. MACD crosses above Signal (bullish cross)
2. Close above MA14 and MA200
3. Price recently crossed above MA200 (within window)
4. MA14 recently crossed above MA200 (within window)
5. Cooldown: minimum 12 bars between BUY labels (anti-spam)
Optional (default OFF): BUY only when MACD is below zero — cross and signal must occur under the zero line (classic recovery-from-oversold setup).
Analysis limited to the last 500 bars on chart load.
KEY SETTINGS
• Moving averages: show/hide MA14, MA25, MA50, MA99, MA200
• MACD: 12 / 26 / 9, EMA oscillator & signal
• Confluence window & cooldown — tune for your timeframe and volatility
• Display: BUY label color, confluence table on/off, table position
ALERTS
• BUY confluence (all conditions met)
• MACD crosses above / below Signal
• MACD histogram rising→falling / falling→rising
WHO IT'S FOR
Traders who want filtered BUY entries combining trend (MA200), short-term momentum (MA14), and MACD confirmation — intraday and swing on forex, gold, crypto, indices. Always validate on demo and adjust window/cooldown for your market.
DISCLAIMER
Technical analysis tool only — not financial advice. Past signals do not guarantee future results. Trade at your own risk. Indicador

Session Open LineA price overlay for TradingView (Pine Script v6). A horizontal line at the session's reference level - the previous session's close by default, or the session open - drawn from the first to the last bar of that session, with a label carrying the price change during the session (close vs the reference) - as a percent, as a difference in the instrument currency, or both. Alerts fire when the price crosses the line, and the reference level plus the session change are exposed as hidden series for other scripts.
█ 🧠 WHAT IT SHOWS
For every trading session the script anchors a line at the session's reference level and stretches it to the right as the session progresses:
price
│ ╭─╮
│ reference level │ │ ╭╮ ← price above the reference
│ ╭╮ ╭╮ ╰─╯ ││
│ ══╪╪═══════════════════╪╪═══════╪╪══ ─►
│ ╰╯ ╭╮ ╭╮ ╰╯ ╰╯
│ ╰╯ ╰╯ ← price below the reference
│
│ ├──────── one session ────────┤├── next session ──
└────────────────────────────────────────────── time
The line sits at the reference level - the previous session's close (default) or the session open - and never moves vertically.
Its right end follows the current bar until the session ends.
The color of the line depends on the sign of the change : up color when close >= reference level , down color otherwise. It is re-evaluated on every bar, so a session that flips from green to red repaints the whole line.
The whole session is shaded in the same up/down color (on by default, can be turned off).
Reference level
Previous session close (default) - the close of the last bar of the prior session. The change matches the day change quoted against the previous close (the way most quote screens report it), and an opening gap shows up as the distance between the line and the session's first candle.
Session open - the open of the first bar of the session. The change measures only what happened inside the session; there is never a gap between the line and the first candle.
Session detection
A new session is detected with timeframe.change('D') - the trading day boundary as TradingView defines it for the symbol. That is deliberately not "midnight": it follows the instrument's own session definition, so futures sessions that cross midnight are handled correctly (the line starts at the session boundary, not at 00:00).
Why a box, not bgcolor()
The session highlight is drawn as one box per session rather than bgcolor() . bgcolor() paints a single bar and cannot be repainted afterwards, so a session that flips sign would end up striped. A box spans the whole session and keeps a single color that is corrected on every bar. Box extend only works on the time axis, so the vertical coverage comes from the box bounds: the highest high and lowest low of the loaded data, padded by 100x that range above and below. On the last bar every box is brought to the final bounds, so sessions drawn while less data was loaded get the same coverage.
Why not simply 1e17 / -1e17 : TradingView silently skips boxes whose bounds lie extremely far from the price scale (on an instrument near 85, bounds of +-1e8 still draw while +-1e9 do not). Such boxes exist - they show up in the object tree - but never render, so the highlight looks like it is not working at all.
█ 🏷️ THE CHANGE LABEL
The label is colored by the sign of the change and sits on a fully transparent background. Two checkboxes decide what it carries:
Show percent change (default on) - the change as a percent of the reference level, formatted as +0.84% / -1.12% (always signed, two decimals).
Show change in instrument currency (default off) - the change as a price difference ( close - reference level ), formatted with the symbol's tick precision ( format.mintick ) and suffixed with syminfo.currency , e.g. +12.50 USD . For symbols without a quote currency the suffix is omitted.
With both on the label reads +0.84% (+12.50 USD) ; with both off no label is drawn at all - only the line (and the optional highlight) remains. For a reference level at or below zero (possible on futures spreads) the percent is undefined - the label falls back to the price difference, and the up/down color always follows the sign of the difference, which stays meaningful at any price.
Percent position decides where it sits, and the choice applies the same way to completed sessions and to the ongoing one:
Behind the line (default) - anchored on its left edge ( label.style_label_left ), at the reference level, right of the line end, as if continuing the line.
Above the line - anchored at its bottom-right corner ( label.style_label_lower_right ), so the text sits over the end of the line and does not stick out past the session end.
Below the line - anchored at its top-right corner ( label.style_label_upper_right ), so the text hangs under the end of the line, again inside the session.
During the ongoing session the label follows the end of the line and updates on every bar; once the session ends it stays at the last bar with the final value.
█ 🛠️ KEY PARAMETERS
General
Reference level (default Previous session close) - Previous session close / Session open, described above.
Show percent change (default on) - percent of the reference level in the label.
Show change in instrument currency (default off) - price difference in the instrument currency in the label.
Appearance
Up color (default #26A69A ) - line and label color when the session is up.
Down color (default #EF5350 ) - line and label color when the session is down.
Line style (default Solid) - Solid / Dashed / Dotted.
Line width (default 1) - range 1 - 4 .
Text size (default Small) - Auto / Tiny / Small / Normal / Large.
Percent position (default Behind the line) - Above the line / Below the line / Behind the line, described above.
Session highlight
Highlight the whole session (default on) - fills the entire session with a single color, decided by where the price stands against the reference level.
Highlight up color (default #26A69A at 90% transparency) .
Highlight down color (default #EF5350 at 90% transparency) .
█ 📈 HOW TO READ IT
The line is a reference level, not a signal. Trading above it means buyers have controlled the day so far; below it, sellers have.
Reclaims and rejections at the line are the interesting part - price returning to the level and being pushed away often marks who is defending the day.
With the previous-session-close reference (default) the line doubles as the gap-fill level : a session that opens with a gap and later crosses the line has closed that gap.
The label value gives an instant sense of the session's magnitude without measuring anything by hand, and the sign color makes a flip visible at a glance. The percent is comparable across instruments; the currency difference maps directly to points or ticks on the symbol you trade.
With the session highlight on , a screen full of alternating green and red blocks makes runs of consecutive up or down sessions obvious.
█ 🔔 ALERTS
Cross above the reference level - the price crossed the current session's line from below.
Cross below the reference level - the price crossed the current session's line from above.
Those are exactly the reclaim/rejection moments described above (with the default reference: the gap-fill / day-flip moments). The first bar of a session - where the line jumps to the new reference - never fires either alert. Crosses are evaluated on close , so on the live candle a cross can appear and un-cross before the candle closes; set the alert trigger to Once Per Bar Close if you only want confirmed crosses.
█ 📤 HIDDEN SERIES
The script exposes two hidden series, visible in the Data Window and usable as an external source in other indicators and strategies (any input.source field):
Reference level - the level the line sits at: the previous session's close (default) or the session open.
Session change % - the session change as a percent of the reference level.
█ ⛔ LIMITATIONS
Intraday timeframes only. On D and above every bar is its own session, so the script draws nothing and instead shows a hint table in the top-right corner: Session Open Line: the indicator works on intraday timeframes .
Drawing objects are capped at 500 lines, 500 labels, and 500 boxes - older sessions drop off the left side of the chart.
Both values are computed from close against the reference level, so during the ongoing session they move with every tick and only become final at the session close.
The first session in the loaded history starts at the first loaded bar, which is not necessarily the true session start. With the default reference (previous session close) it has no prior close at all, so it draws nothing; with the session-open reference its "open" (and therefore its change) can be off. Every later session is exact.
© Piotr Kowalski "piecioshka". License: Mozilla Public License 2.0. Indicador

VWAP AI - Statistical Bands & Touch Stats [Dots3Red]⚓ VWAP AI - STATISTICAL BANDS & TOUCH STATS
VWAP's standard deviation bands are treated more or less as reliable support and resistance — on faith. This script checks that faith against the actual chart in front of you: every band touch is graded, every break beyond a band is graded, and the results accumulate into a running, honest record.
✨ WHY THIS MATTERS
VWAP tells you the volume-weighted average price — where the "center of gravity" of trading has actually been. The bands around it are meant to show how far price typically wanders from that center before snapping back. But "typically" varies enormously by instrument, session, and market condition, and no plain VWAP tool tells you what's actually been happening on your chart.
This script tracks it directly:
📊 +1σ | 62% rejected (n=41)
That means 41 touches of the +1σ band have been recorded on this chart, and 62% of them resulted in price genuinely rejecting back toward VWAP. Measured history, not an assumption baked into the tool.
⚙️ HOW IT WORKS
⚓ Anchoring — VWAP resets at the start of each new period. Session is the classic intraday default; Week and Month extend the same logic to longer views. Custom Bar anchors once, permanently, to a specific historical point you choose — useful for anchoring to an earnings date, a gap, or any event you want to measure from, rather than the calendar.
📏 Two-tier statistical bands — Band 1 and Band 2 are both standard-deviation multiples of VWAP, computed from a proper running variance (not an ATR approximation). Defaults are ±1σ and ±2σ, both fully adjustable.
🎯 Touch grading — when price wicks into a band without closing beyond it, that's logged as a touch. Within a configurable window, it resolves as:
• Rejection — price moved back toward VWAP by a meaningful distance
• Break — price closed convincingly through the band
• Timeout — neither happened clearly enough to call
🔄 Break-to-reversion tracking — separately, when price actually closes beyond Band 1, the script watches whether that move reverts back toward VWAP or continues away from it. This answers a different question than touch grading: not "did the band hold," but "once it didn't, did price come back anyway?"
🔒 Non-repainting — all grading happens strictly on confirmed bars.
🧭 HOW TO USE
1️⃣ Check the band stats before treating a level as reliable. "+1σ: 71% rejected (n=38)" and "+1σ: 44% rejected (n=12)" look like the same line on the chart but mean very different things about how much to lean on it.
2️⃣ Use break-reversion stats to judge a breakout beyond VWAP's range. If breaks above Band 1 have reverted back 65% of the time on this chart, that's useful context before assuming a fresh breakout will keep running.
3️⃣ Read Price vs VWAP as the simplest possible bias check. Above VWAP means the average buyer today is in profit; below means the average buyer is underwater. It's a blunt but genuinely useful read on crowd positioning.
4️⃣ Let sample sizes build before trusting the percentages. Every stat shows its N= specifically so you can judge reliability yourself — a handful of touches is not yet a pattern.
5️⃣ Match the anchor mode to what you're actually measuring. Session for pure intraday structure, Week or Month for a longer view, Custom Bar when you want to measure from one specific moment forward.
⏱️ WHICH TIMEFRAMES WORK BEST
Session-anchored VWAP is fundamentally an intraday tool — it was built for, and is most meaningful on, timeframes where a full session contains enough bars to form a real distribution: 1-minute through 1-hour is the classic and most effective range, which is exactly where VWAP sees the heaviest institutional and day-trading use.
On daily or weekly charts, a Session anchor resets so frequently relative to the bar size that it stops being meaningful — you'd see very few bars per session. For higher-timeframe or swing-style use, switch the anchor to Week, Month, or Custom Bar instead, so the accumulation window actually spans enough bars to produce a meaningful VWAP and band structure.
The touch and break statistics also need enough occurrences to mean anything — a fast-moving intraday chart will accumulate a useful sample size in days; a slow higher-timeframe anchor will take considerably longer.
🛠️ SETTINGS
⚓ Anchoring — Session / Week / Month / Custom Bar, source price
📏 Bands — Band 1 and Band 2 standard-deviation multipliers, Band 2 visibility toggle
🎯 Touch Statistics — Touch Tolerance, Rejection Distance, Reversion Distance, Outcome Window
🎨 Visualization — independent Band 1 / Band 2 touch marker toggles, Dot or Triangle marker style, marker size, VWAP and band line widths, independent fill transparency per band tier
🎨 Colors — VWAP line, Band 1 lines, Band 2 lines, upper/lower touch markers, Price Above/Below VWAP indicator, and full dashboard color control (background, border, header, row styling)
🖥️ Dashboard — show/hide, position — current VWAP value, price position, all four band stats, and both break-reversion stats in one place
📝 NOTES
Statistics accumulate from when the indicator is added to the chart and reset only when explicitly cleared by reloading. A Custom Bar anchor never resets on its own, it measures continuously from the point you chose. Band 2 statistics take meaningfully longer to build a useful sample than Band 1, simply because price reaches ±2σ far less often than ±1σ.
⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical rejection and reversion rates do not guarantee future performance. Indicador

Fibonacci Gravity Clusters [GBB]Fib Gravity Clusters — Fibonacci confluence as a heatmap
The problem with Fibonacci retracements was never the ratios but the correct swing selection. Two traders, same chart, different anchor points, completely different levels and both will find "confirmation" for theirs. I wanted to take that choice away from myself.
So this script runs six ZigZag lines in parallel (pivot lengths 3, 8, 21, 55, 144, 377 by default, but they're configurable), keeps the last 13 legs of each, projects the usual retracement ratios from every single confirmed leg, and adds it all up into a density field on the price axis. Where lots of independent swings project into the same area, the chart glows. Where they don't, nothing.
THE BOOKKEEPING
Legs smaller than 0.5 ATR get thrown out because they're noise. Every surviving leg projects the enabled ratios (0.236 / 0.382 / 0.5 / 0.618 / 0.786, plus 0.886 if you want it). Each projected level drops heat into fine price bins, a quarter ATR tall, smeared with a small Gaussian kernel so neighboring projections merge into zones instead of producing a picket fence.
Not every projection counts the same:
- bigger swings contribute more (leg size in ATR, raised to a configurable exponent, capped at 8 so one monster leg can't drown everything else)
- old legs fade out with a half-life, default 144 bars. This matters more than it sounds — without decay the chart slowly fills up with structure the market stopped caring about weeks ago
- optional golden pocket mode adds 0.65 and gives the 0.618–0.65 area a 1.618x weight, if that's your thing
The field gets normalized, gamma-corrected and painted. Four palettes (Thermal, Ember, Ice, Mono) are selectable. The top 5 local peaks get a line and a label with the exact price and a hit count, so you can see how many raw projections actually built that zone. A ×14 zone and a ×3 zone are not the same thing even if they look similar in color.
There's also an optional HTF layer: the same field computed on Daily/Weekly/Monthly (auto-mapped from your chart TF, or fixed) and rendered behind the intraday one, dimmed, in its own palette. Built from closed HTF bars only. When an intraday hot band sits inside an HTF hot band, that's the most interesting picture this tool produces.
NON-REPAINTING
Everything is built from confirmed pivots. A level shows up once its pivot confirms which is N bars after the extreme, that's the nature of pivots and after that it doesn't move and doesn't disappear. HTF layer is lookahead_off, closed bars only. Alerts fire on bar close.
One exception: the Live Leg overlay. It projects ratios from the swing that's still forming. Dashed, labeled "forming", off by default, and it repaints by definition because the leg isn't finished. I left it in because it's occasionally useful context on fast timeframes. It is not a signal. If you turn it on and then complain about repainting, that one's on you.
ALERTS
Three of them: close enters a hot band, close enters an HTF hot band, and a new core zone forming in the top 5. Plus an optional visual flash on the touched band.
Indicador
