OPEN-SOURCE SCRIPT
Atualizado

Z-Score Probability Pro KAMA

2 012
snapshot

Z-Score Probability Pro KAMA, v1.0 by Erika Barker

Hey guys, this is the successor to my original Z-Score Probability HMA Indicator, which you can still use if you prefer that one.

This is version 1.0 of the new rebuild, and it is a pretty big upgrade. The goal was to keep the statistical foundation that made the original useful, but make it more adaptive, cleaner, and better at understanding different market conditions.

What is new

1. Timeframe auto-adaptation

No more constantly re-tuning the indicator when you switch charts.

The lookback now automatically adjusts based on the chart timeframe, using a calendar-style window, defaulting to about 5 trading days. The dashboard also shows the effective lookback being used, so you always know what the script is calculating from.

It works from 1 minute charts all the way up to weekly charts.

2. Better smoothing logic

The original HMA was doing a lot of work at once. In this version, the baseline and the Z-score smoothing are separated so each one can do its own job better.

By default:

* Baseline: KAMA, great for adapting to noisy markets
* Z-score smoothing: ALMA, smoother and cleaner on the oscillator

HMA is still available if you prefer the original feel.

3. Modified Z-Score option

There is now an optional Modified Z-Score mode using MAD, median absolute deviation.

This is useful for markets with big outliers, fat tails, sudden spikes, crypto moves, small caps, and anything that tends to behave a little wild.

When this mode is turned on, the threshold bands automatically adjust.

4. Regime filter using Hurst logic (been needing out on this a lot lately on personal stuff)

This version attempts to classify the market as:

* Trending
* Mean-reverting
* Random

That matters because an extreme Z-score does not always mean the same thing.

In a mean-reverting market, an extreme Z-score can suggest exhaustion.

In a trending market, that same extreme can sometimes mean continuation or breakout strength.

This was one of the biggest things I wanted to improve from the original.

5. Divergence engine

The indicator now includes both regular and hidden divergence.

It can detect:

* Regular bullish divergence
* Regular bearish divergence
* Hidden bullish divergence
* Hidden bearish divergence

Divergences are confirmed using pivots, so they are non-repainting, but they will appear a few bars after the actual pivot. That is the tradeoff for confirmation.

6. Higher-timeframe confirmation

The script can pull Z-score confirmation from a higher timeframe.

You can use the automatic HTF mode or set it manually. HTF values only update after the higher-timeframe candle closes, so this is designed to avoid repainting.

7. Strong Buy and Strong Sell signals

Signals are based on a confluence score instead of just one condition.

The score looks at things like:

* Z-score reversal
* Divergence
* Baseline slope
* Market regime
* Higher-timeframe agreement
* Volume confirmation, when volume is available

You can choose the conviction level:

* Low
* Medium
* High

Medium is the default and should give fewer, cleaner signals.

8. Live dashboard

The dashboard shows:

* Detected timeframe
* Effective lookback
* Current Z-score
* Market regime
* Hurst value
* Higher-timeframe status
* Bull and bear scores
* Conviction threshold
* Last signal

You can move it to any corner of the chart.

9. More stable defaults

The defaults were chosen to be centered in stable performance zones, not over-optimized for one market.

Basically, I did not want this to be something that only looks good on one ticker, one timeframe, during one perfect backtest window.

10. Built in Pine v6

This version uses Pine v6 features, including dynamic higher-timeframe requests and confirmed-bar alert logic.

Repaint disclosure

This indicator is designed to avoid repainting, but there are a few things to know:

* Divergence and Strong Buy/Sell labels appear after pivot confirmation, default is 3 bars later
* Higher-timeframe confirmation only updates after the higher-timeframe candle closes
* Alerts fire on confirmed bars, not intrabar ticks

So, signals are delayed slightly by design, but that is what makes them confirmed.

How to use it

Beginner

Leave everything on default.

Watch the dashboard and look for:

* Strong Buy
* Strong Sell

Medium conviction is probably the best starting point.

Intermediate

Try the Modified Z-Score mode on crypto, small caps, or anything with sharp moves and big outliers.

Turn on Hidden Divergence if you like trading trend continuation setups.

Advanced

You can tune the component weights to match your own strategy.

The indicator is flexible, so you can make it more reversal-focused, more trend-following, or more confirmation-heavy depending on your trading style.
Notas de Lançamento
v3.1 Update:

Simple changes to this minor update. I better tuned the Z-Wave on all Time Frames, and Buy and Sell Signals.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.