Skip to content
Script type
Indicator
Source code
Open-source
Purpose
Trade signals

AF_StochZ_Overlay

Shows Stochastic extremes and divergences as labels right on your price chart.

Difficulty Intermediate

No.VOW-000104

With only six label types, reading the chart itself is easy. What takes more effort is understanding why the labels print: three processing stages (an Efficiency Ratio-based adaptive lookback, a Fisher Transform, and a Z-Score) combined with confirmed swing highs and lows. Some details are easy to misread if you don't know them, such as labels appearing two bars late on a past bar and divergences having no Z-Score threshold. There are also 20 settings, so we rated it intermediate.

Repainting
Backpaints
  1. Live barChanges
  2. On closeFixed
  3. HistoryBackpaints
Signals are evaluated on confirmed bars only and do not repaint, but each label is drawn back on the swing bar Price Pivot Right Bars (default 2) bars earlier.
Best timeframes
  • Lower TFs≤15m
  • Mid TFs30m–4H
  • Higher TFs1D+
Tested on BTCUSDT (1m, 5m, 15m, 30m, 1H, 4H, 1D, 1W)
Alerts
6 conditions
Buy/sell signals
Yes
Market conditions
Ranging
Display
Overlay
Chart elements
LabelsLines
Trading style
Swing TradingDay Trading
DivergenceReversal

“AF_StochZ_Overlay” Puts Stochastic Divergence Directly on Your Price Chart

Diagram gallery 8

Article Summary
What does this indicator do?
Bottom line

AF_StochZ_Overlay prints oscillator extremes and divergences as labels directly on the price chart, and it works best for spotting reversals at the edges of a range. Because labels confirm two bars after the swing and attach to a past bar, check trend strength with something like ADX before acting on them in strong trends.

Tell me more
Key points
  • It calculates a Stochastic internally and shows only the result as BUY/SELL and divergence labels on the price chart.
  • The lookback flexes between 8 and 34 bars via the Efficiency Ratio, shortening in trends and lengthening in chop.
  • A Fisher Transform and Z-Score let it use the same -1 and +1 thresholds across different assets and timeframes.
  • BUY prints only when the Z-Score troughs below -1 and a price swing low confirms within the next 5 bars.
  • R-Bull/R-Bear mark regular divergence and H-Bull/H-Bear mark hidden divergence, with no Z-Score threshold.
  • Labels are checked on confirmed bars and never vanish, but they confirm two bars after the swing and attach to a past bar.
  • Strong trends keep producing counter-trend labels, so pairing it with the trend filter or ADX works well.
  • Each of the six label types has its own alert, and Once Per Bar Close keeps alerts in sync with the labels.

AF_StochZ_Overlay turns an oscillator into labels printed right on your candles

If you trade with Stochastic or RSI, you know the drill: your eyes keep bouncing between the price chart and the oscillator pane underneath. “Is it oversold yet?” “Is that a divergence?” Constantly glancing up and down gets tiring fast.

AF_StochZ_Overlay is built to cut out that back-and-forth. Under the hood it calculates a Stochastic-based oscillator, but it never plots a single line. Instead, it detects oscillator extremes and divergences and prints only the result as labels like “BUY” or “R-Bull” directly on the price chart.

AF_StochZ_Overlay has three label families, read by color and text

No oscillator line is plotted. Only the result of each check is printed as a label on the candles.

AF_StochZ_Overlay has three label families, read by color and textA schematic chart with BUY/SELL, R-Bull/R-Bear, and H-Bull/H-Bear labels printed above and below the candles.H-BullR-BearBUYH-BullR-BullH-BearR-BullR-BearSELLR-BearH-BullR-BearBUYR-BullR-BullSELLH-BearSELLH-BearBUY / SELLLead signals (entry cues)R-Bull / R-BearRegular divergenceH-Bull / H-BearHidden divergenceOverlaps on the same barmerge into one two-line label

Vowars DE ver.3.12.36

Labels attach to the swing-high and swing-low bars. When a BUY and a divergence land on the same low, they merge into one two-line label that takes the divergence color. Drawn with the default colors.

There are three families of labels. Figure 1 shows BUY/SELL, the lead signals meant as entry cues. Figure 2 shows R-Bull/R-Bear for regular divergence, and Figure 3 shows H-Bull/H-Bear for hidden divergence. It looks simple on the surface, but three processing stages are stacked behind it: an adaptive lookback, a Fisher Transform, and a Z-Score. That stack is what gives AF_StochZ_Overlay its own character.

I ran it on BTCUSDT across eight timeframes, from the 1-minute to the weekly. Using those charts, this review walks through how to read the labels, when they print, how to tune the settings, and where the indicator struggles.

AF_StochZ_Overlay on a TradingView 1-hour chart, with BUY/SELL and divergence labels printed above highs and below lows
AF_StochZ_Overlay on a TradingView 1-hour chart, with BUY/SELL and divergence labels printed above highs and below lows

Label types and colors

For the most part, these labels are the only thing AF_StochZ_Overlay draws. You can turn on divergence lines in the settings, but they are off by default. Labels on the low side appear below the bar as upward-pointing callouts, and labels on the high side appear above the bar as downward-pointing callouts.

Label textDefault colorMeaningPlacement
BUYGreenLead signal (long)Below the swing-low bar
SELLRedLead signal (short)Above the swing-high bar
R-BullGreenRegular bullish divergenceBelow the swing-low bar
R-BearRedRegular bearish divergenceAbove the swing-high bar
H-BullDark greenHidden bullish divergenceBelow the swing-low bar
H-BearOrangeHidden bearish divergenceAbove the swing-high bar

When a BUY and a divergence both trigger on the same swing low, they merge into one two-line label, such as “BUY” over “R-Bull”. The label then takes the divergence color. A “BUY” plus “H-Bull” combo, for example, shows up in dark green rather than the plain BUY green. Regular and hidden never share a label. The script checks prior lows starting from the nearest one, and only the first condition that matches gets printed.

By default, BUY and R-Bull are both green, so telling them apart by color alone can be a little confusing. In practice I found it easier to just read the text instead of relying on color. If that bugs you, changing only Buy Signal Color to a different color makes them much easier to tell apart.

The three processing stages behind the labels

Only labels show up on screen, but knowing what is being measured internally helps a lot in understanding why they print where they do. In order, it works like this.

1 Set the lookback between 8 and 34 bars using the Efficiency Ratio

First, Kaufman’s Efficiency Ratio (ER) sets the Stochastic lookback on every bar. ER divides how far price actually moved over the last 10 bars by the total distance it traveled up and down in that span. It approaches 1 when price moves cleanly in one direction and approaches 0 when price chops back and forth.

In AF_StochZ_Overlay, a higher ER shortens the lookback and a lower ER lengthens it. The upper limit is 34 bars, set by Max Length, and the lower limit is 8 bars, set by Min Length. The idea is to react quickly with a short lookback when a trend is running, and to smooth out the noise with a longer one when the market is choppy.

The lookback flexes between 8 and 34 bars depending on how price is moving

The higher the Efficiency Ratio (ER), meaning the more cleanly price moves in one direction, the shorter the lookback. The choppier price gets, the longer it becomes.

The lookback flexes between 8 and 34 bars depending on how price is movingA schematic chart with candles and BUY/SELL labels on top, and the Stochastic lookback used internally by AF_StochZ_Overlay drawn as a step line below.Internal lookback (not shown on TradingView)SELLSELLBUYBUYBUYBUYSELLSELLSELLSELLBUYBUYBUY834Short lookback while the rally runsLengthens in the chopShortens again oncethe selloff turns one-way

Vowars DE ver.3.12.36

The lower line is not shown on TradingView. The upper and lower limits come from Max Length (default 34) and Min Length (default 8), and the ER window from ER Length (default 10). Divergence labels are turned off in the upper pane.

During the sustained rally in Figure 1, the lookback shrinks to around 10 bars, and in the chop in Figure 2 it stretches to nearly 30. Once the selloff turns one-directional in Figure 3, it shortens again.

2 Run the Stochastic through a Fisher Transform

%K is calculated over that lookback and smoothed with a simple moving average of %K Smoothing bars (default 3). The 0-100 value is then rescaled to the -1 to +1 range and passed through a Fisher Transform.

The Fisher Transform stretches values more and more the closer they get to the extremes. Stochastic tends to flatten out around 80 or 90, but after the transform, the gap between “pinned at the extreme” and “just near the extreme” widens, so tops and bottoms stand out more clearly.

3 Convert it into a Z-Score against the last 20 bars

Finally, the script takes the difference between the transformed value and its average over the last Z-Score Length bars (default 20), then divides it by the standard deviation over the same period to get a Z-Score. A Z-Score tells you how many standard deviations the value sits away from its usual level.

Thanks to this last stage, overbought and oversold are no longer fixed numbers like 20 and 80. They become a measure of how stretched the reading is compared with recent swings on that specific asset and timeframe. That is why the same -1 and +1 thresholds work on a volatile asset like Bitcoin and on a calmer pair like USD/JPY.

BUY and SELL only print when an oscillator trough and a price low line up

The BUY and SELL lead signals don’t fire just because the Z-Score crosses a threshold. They print only after passing a two-step check, first on the oscillator side and then on the price side.

A BUY is confirmed in two steps: an oscillator trough, then a price low

The lower line is not shown on TradingView. It is added here to show why the label prints.

A BUY is confirmed in two steps: an oscillator trough, then a price lowA schematic chart with candles and BUY/SELL labels on top, and the Z-Score calculated internally by AF_StochZ_Overlay below.Internal Z-Score (not shown on TradingView)SELLSELLBUYSELLBUYSELLZ-Score troughs below -1Price swing low forms 2 bars later(confirmed by 3 left / 2 right bars)Once 2 right-side bars close,BUY attaches to the low barOverbought Level (+1)Oversold Level (-1)

Vowars DE ver.3.12.36

Divergence labels are turned off, leaving only the lead signals. A BUY triggers when a Z-Score trough is confirmed below the Oversold Level (-1) and a price swing low is confirmed within 5 bars of it. SELL runs the same check mirrored on the high side.

Here is how a BUY comes together. A SELL is the same process mirrored on the high side.

  1. As in Figure 1, the Z-Score forms a trough below Oversold Level (Z-Score) (default -1.0), and that trough is confirmed by one bar on each side
  2. On the same bar as that trough, or within Max Lag After Osc Pivot (Bars) bars after it (default 5), a price swing low forms, as in Figure 2
  3. The swing low counts once it is lower than the 3 bars to its left and the 2 bars to its right, and as in Figure 3, the BUY label prints once those 2 right-hand bars have closed

If the price low forms before the oscillator trough, there is no BUY. The logic looks for a specific sequence: momentum bottoms first, then price bottoms. Also, each oscillator trough can produce only one BUY. Even if price makes several lows after the same trough, only the first one gets a BUY.

On the BTCUSDT charts I checked, BUY and SELL labels were far less frequent than divergence labels. Divergences have no Z-Score threshold, which explains the gap in frequency (more on this later).

The bar the label sits on is not the bar it prints on

A BUY label sits on the swing-low bar, but it only appears when the bar two bars later closes. Looking back at the chart, it may look like “BUY right at the bottom,” but in real time the label only shows up two bars after the low. The more a historical chart makes the signals look spot-on, the more you should mentally subtract those two bars.

How the divergence labels are detected

Divergence detection runs separately from BUY/SELL. Every time a price swing low (or high) is confirmed, the script looks back 5 to 60 bars for an earlier swing low (or high) and compares the Z-Score on those two bars.

R-Bull and R-Bear (regular divergence)

R-Bull means price made a lower low, yet the Z-Score is higher than it was at the previous low. It signals fading selling pressure and is used when you suspect a reversal. R-Bear is the opposite: price makes a higher high while the Z-Score comes in lower than last time.

R-Bull: a lower low in price against a higher low in the Z-Score

Price is making a new low, but the momentum reading isn't dropping as far as last time. That mismatch is labeled as a regular divergence.

R-Bull: a lower low in price against a higher low in the Z-ScoreA schematic chart where price makes a lower low in the upper pane while the internal Z-Score bottoms at a higher level in the lower pane, printing an R-Bull label and a solid divergence line.Internal Z-Score (not shown on TradingView)SELLSELLR-BearBUYR-BearBUYR-BullSELLR-BullSELLR-BearR-BullBUYR-BullBUYR-BullSELLLower low than beforeZ-Score turns up from a higher lowPrevious swing-low barSolid line joins the two lowsand R-Bull prints

Vowars DE ver.3.12.36

Show Divergence Lines is on and hidden divergence is turned off. The comparison uses the Z-Score on the two confirmed swing-low bars. The lower line is not shown on TradingView.

In Figure 1, price sets a lower low than before, while in Figure 2 the Z-Score turns up from a higher level than last time. With Show Divergence Lines turned on, the two lows are connected with a solid line, as in Figure 3.

H-Bull and H-Bear (hidden divergence)

H-Bull means price made a higher low, but the Z-Score sank deeper than it did last time. It catches pullbacks in an uptrend where only momentum cooled off for a moment. Hidden divergence is generally treated as a trend-continuation signal.

H-Bull: a pullback in an uptrend where only momentum dips deeper

Price is making higher lows, yet the momentum reading fell deeper than last time. This temporary cooldown in the middle of a rally is picked up as a hidden divergence.

H-Bull: a pullback in an uptrend where only momentum dips deeperA schematic chart where price makes a higher low within an uptrend while the internal Z-Score sinks below its previous reading, printing an H-Bull label and a dashed divergence line.Internal Z-Score (not shown on TradingView)SELLH-BullSELLSELLBUYBUYH-BearH-BearSELLBUYH-BullSELLBUYH-BullPullback low above the previous oneZ-Score below its previous readingPrevious swing-low barDashed line and an H-Bull label

Vowars DE ver.3.12.36

Show Divergence Lines is on and regular divergence is turned off. Hidden divergence lines are drawn dashed. The lower line is not shown on TradingView.

The pullback low in Figure 1 is above the previous one, while the Z-Score in Figure 2 is below its previous reading. When lines are enabled, hidden divergences are drawn as dashed lines, as in Figure 3, so you can tell them apart from regular ones.

Where it differs from the divergence you’re used to

Three things caught my attention while using it. If you are used to spotting divergence by eyeballing an oscillator in a separate pane, the way these labels print may feel a bit off at first.

  • It compares the Z-Score on the price swing-low bars. It does not compare the oscillator’s own troughs. Even if the oscillator bottomed a few bars before the price low, the value that gets compared is the one on the swing-low bar.
  • The comparison point isn’t always the previous low. The script scans back starting 5 bars ago and locks in the first swing low that meets the condition. If the most recent low doesn’t qualify, it keeps looking further back, so a line can stretch more than 30 bars.
  • There is no Z-Score threshold. Unlike BUY/SELL, divergences have no -1 or +1 condition. Even with the Z-Score hovering around 0, a label prints as long as the comparison matches.

Because of that third point, divergence labels are plentiful. On BTCUSDT’s 1-minute and 5-minute charts, there were stretches where it looked like nearly every high and low had some kind of label. If you want fewer labels, the settings covered later will help.

AF_StochZ_Overlay on a 1-minute chart. Divergence labels appear at almost every high and low, so the chart gets crowded.
AF_StochZ_Overlay on a 1-minute chart. Divergence labels appear at almost every high and low, so the chart gets crowded.

Labels never disappear, but they land two bars back

On repainting: signals are evaluated only on confirmed bars, so once a label appears, it never moves or disappears later. Labels also won’t flicker on and off while the current bar is still forming.

That said, a label is placed not on the bar where the check happens, but on the swing-low or swing-high bar Price Pivot Right Bars bars earlier (default 2). In other words, once a signal is confirmed, the label gets drawn back onto a past bar. Divergence lines work the same way, connecting two past bars at the moment they appear.

Don’t let the historical chart fool you

On a historical chart, labels sit right on the highs and lows, which makes them look more accurate than they really are. The earliest point you can actually act on is the close of the bar two bars after the labeled bar. If you estimate P&L from past labels, always build that offset into your numbers.

If you want to see this delay for yourself, TradingView’s Bar Replay does the job. Step forward one bar at a time from a past point, and you can watch the label appear on the swing-low bar two bars after the low formed. You do have to advance the bars manually, and how far back you can replay depends on your plan and the timeframe.

One more thing: only up to 500 labels stay on the chart. Once that limit is reached, the oldest ones are removed first, so if you scroll far back on a 1-minute chart, older labels will be gone. That comes from the display limit, not from any change in the signals. Divergence lines don’t have their display limit raised either, so only roughly the 50 most recent remain.

Switching timeframes changes how the labels behave

I compared BTCUSDT on the 1-minute, 5-minute, 15-minute, 30-minute, 1-hour, 4-hour, daily, and weekly charts, all with default settings. These are tendencies I saw on the charts as of October 2026, but the way the labels printed clearly changed with the timeframe.

  • On the 1-minute and 5-minute, labels are everywhere, with something attached to almost every high and low. It was almost quicker to look for the stretches without labels.
  • From the 15-minute to the 1-hour, labels get more spaced out, and labels including BUY/SELL more often cluster at the top and bottom edges of a range.
  • From the 4-hour to the weekly, the number of labels settles down, and combos like BUY+R-Bull or SELL+R-Bear showed up near major turning points. That said, the same combos also appeared in the middle of strong trends.
AF_StochZ_Overlay on a weekly chart. Bearish labels stack up near the highs, and the decline continues even after a BUY+R-Bull.
AF_StochZ_Overlay on a weekly chart. Bearish labels stack up near the highs, and the decline continues even after a BUY+R-Bull.

On the weekly example, three bearish labels in a row near the highs were followed by a big drop. That is a case where the bearish labels could be read as an early warning of a top. On the other hand, price kept falling even after a BUY+R-Bull printed during the decline. Even on higher timeframes, a label is no guarantee of a reversal.

Strong trends keep printing counter-trend labels

Every label from AF_StochZ_Overlay boils down to one of two calls: “momentum is temporarily overextended” or “momentum and price are out of sync.” In a strong trend, those conditions get met again and again at short intervals.

In a strong selloff, BUY+R-Bull combos don't stop the decline

A label prints when momentum is judged to be temporarily overextended. It is no promise that the trend is over.

In a strong selloff, BUY+R-Bull combos don't stop the declineA schematic chart where BUY+R-Bull labels print three times during a downtrend, yet price keeps making lower lows each time.SELLH-BullR-BearBUYH-BullH-BearH-BullR-BearBUYR-BullH-BearH-BearBUYR-BullBUYR-BullH-BearR-BullH-BearBUYR-BullSELLH-BearR-BullBUY+R-Bull mid-selloffSame label at the next lowThree labels, and thelower lows keep coming

Vowars DE ver.3.12.36

Drawn with the default settings. In a persistent selloff, the Z-Score keeps dipping below -1 at short intervals, so counter-trend labels tend to repeat.

Even with back-to-back BUY+R-Bull labels as in Figure 1 and Figure 2, the lower lows keep coming, as Figure 3 shows. As the selloff continues, the Z-Score keeps dipping below -1 at short intervals, and the conditions line up every time. The flip side is that a sustained rally lines up SELL and R-Bear labels. On the daily chart too, SELL and R-Bear labels kept printing near the highs after the sharp rally in August 2026, yet price pushed even higher into late September.

AF_StochZ_Overlay on a daily chart. Bearish labels keep printing near the highs after a sharp rally.
AF_StochZ_Overlay on a daily chart. Bearish labels keep printing near the highs after a sharp rally.

If you take these labels at face value as signals to fade the move, you will end up repeatedly trading against the trend. There are two main fixes: the trend filter covered next, and confirming trend strength with another indicator.

Two filters to thin out the labels

Use Trend Filter (EMA)

With Use Trend Filter (EMA) turned on, only BUY signals print when the close is above the EMA, and only SELL signals print when it is below. The EMA length is set by Trend EMA Length (default 200). The check uses the close of the bar where the signal is confirmed, not the swing-low bar the label sits on.

With Use Trend Filter on, only BUY/SELL against the EMA disappear

The filter only restricts the BUY and SELL lead signals. Divergence labels still print as usual.

With Use Trend Filter on, only BUY/SELL against the EMA disappearA schematic chart of AF_StochZ_Overlay with the trend filter on during an uptrend where price stays above the EMA 200. No SELL prints, while R-Bear labels and BUY remain.R-BullH-BullR-BearR-BearR-BearR-BearR-BearR-BearR-BearH-BullR-BearH-BullH-BullR-BearH-BullBUYH-BullR-BearR-BearH-BullBUYH-BullR-BearH-BullH-BullR-BearBUYR-BullH-BearBUYH-BullH-BullR-BearH-BullBUYH-BullH-BullBUYR-BullH-BearBUYR-BullH-BearBUYR-BullH-BearH-BearH-BearR-BullR-BearR-BullR-BearBUYH-BullR-BearBUYH-BullR-BearR-BullBUYR-BullH-BearR-BullR-BullR-BullH-BearH-BearR-BullR-BullSELLH-BearH-BearR-BullR-BullR-BullSELLH-BearR-BullH-BearR-BullR-BullSELLH-BearR-BullR-BullR-BullH-BearH-BullH-BearSELLH-BearH-BullSELLR-BearH-BullH-BullSELLSELLR-BearH-BullR-BearBUYH-BullR-BearR-BearR-BearR-BearBUYH-BullR-BearBUYH-BullR-BearR-BearNo SELL while the closestays above the EMA 200SELL+R-Bear without the filter,only R-Bear with it onBUY in the trend direction stays

Vowars DE ver.3.12.36

The blue line is TradingView's built-in EMA (length 200), added for reference. AF_StochZ_Overlay itself does not plot an EMA. The filter uses an EMA of Trend EMA Length (default 200) and the close of the bar where the signal is confirmed.

The easy-to-miss part is that this filter only affects BUY and SELL. The label in Figure 2 would read “SELL” over “R-Bear” with the filter off, but with it on, only R-Bear remains. Divergence labels still print as usual, so even with the filter on, you’ll still see R-Bear labels lining up during an uptrend. If you only want to see trend-aligned signals, consider also turning off one or both divergence types.

Note that AF_StochZ_Overlay itself does not plot the EMA. The blue line in Figure 1 is TradingView’s built-in EMA, added just for reference. If you want to see where the filter flips on the chart, adding an EMA with the same length separately makes it easier to judge.

Require %K/%D Confirmation

Turning on Require %K/%D Confirmation adds one more condition: %K above %D for a BUY, and %K below %D for a SELL. %D is %K averaged over %D Signal bars (default 3). Think of it as checking that the Stochastic has already started turning in the signal’s direction on the bar where the signal is confirmed. This one doesn’t affect divergence labels either.

%D Signal is only used when this confirmation is turned on. While it stays off, changing the value won’t change any labels.

What each setting does, and which ones are worth changing

There are quite a few settings, but they are easy to sort out once you group them by role. The Suggested column is a guide for day trading around the 1-hour chart, tuned to cut the labels down a little.

Parameters
SettingDefaultSuggestedEffect
Min Length88 (13 for swing)Lower limit of the lookback. Lower values make it react faster in trends and produce more labels
Max Length3434 (55 for swing)Upper limit of the lookback. Higher values make it less sensitive to small swings in choppy markets
ER Length1010Bars used to measure the Efficiency Ratio. Shorter values make the lookback switch more often, longer values change it more slowly
%K Smoothing33Bars used to smooth %K. Higher values reduce noise at the cost of slower turn detection
%D Signal33%D length. Only used when Require %K/%D Confirmation is on
Require %K/%D ConfirmationOffOn for 5-minute and belowAdds %K above %D for BUY and %K below %D for SELL. Does not affect divergences
Z-Score Length2020 (30 for swing)Bars used as the Z-Score baseline. Longer values make the baseline move more slowly and extreme readings rarer
Oscillator Pivot Bars (L=R)11-2Bars on each side used to confirm Z-Score troughs and peaks (1-5). Higher values mean fewer and later BUY/SELL signals
Oversold Level (Z-Score)-1.0-1.0 to -1.5Z-Score trough level required for BUY. Lower values mean fewer BUYs
Overbought Level (Z-Score)1.01.0 to 1.5Z-Score peak level required for SELL. Higher values mean fewer SELLs
Price Pivot Left Bars33Left-side bars needed to confirm a swing low or high. Higher values mean fewer labels
Price Pivot Right Bars22 (1 if speed matters)Right-side bars needed to confirm a swing low or high. This number is exactly how many bars the labels lag
Max Lag After Osc Pivot (Bars)55Bars allowed between the Z-Score trough (peak) and the price swing low (high) (1-10). Lower values mean fewer BUY/SELL signals
Use Trend Filter (EMA)OffOn for strongly trending assetsAllows only BUY above the EMA and only SELL below it. Does not affect divergences
Trend EMA Length200200 (50 for 5-minute and below)EMA length used by the trend filter
Show Regular DivergenceOnOnShows R-Bull/R-Bear
Show Hidden DivergenceOnOn for trend-following, off for reversals onlyShows H-Bull/H-Bear
Show Divergence LinesOffOn only when checkingLine joining the two compared lows (highs). Hidden divergence is dashed
Divergence Min Lookback (Bars)55Where the search for the earlier swing low or high starts
Divergence Max Lookback (Bars)6030-60How far back to search. Lower values stop comparisons between lows that are far apart

There are six color settings: Buy Signal Color (green), Sell Signal Color (red), Reg. Bullish Div Color (green), Reg. Bearish Div Color (red), Hid. Bullish Div Color (dark green), and Hid. Bearish Div Color (orange). None of them affect the signal logic.

If there are too many labels

To cut down on BUY/SELL, the quickest move is to widen Oversold Level (Z-Score) and Overbought Level (Z-Score) to -1.5 and 1.5. Signals will then only trigger on deeper extremes in the Z-Score. The script’s public page also suggests -1.5 and 1.5 as a starting point for swing trading on the 4-hour to daily charts.

The threshold settings won’t reduce divergence labels. For those, raise Price Pivot Left Bars and Price Pivot Right Bars to make the swing-low and swing-high criteria stricter. Keep in mind that more right-side bars also means a longer delay before the label prints.

If you want less lag

Dropping Price Pivot Right Bars from 2 to 1 makes labels print one bar after the low. The trade-off is that it also picks up shallow lows that get taken out right away, so you’ll see more labels. If you run this setting on the 1-minute to 5-minute charts, turning on both the trend filter and the %K/%D confirmation to thin out BUY/SELL keeps things balanced.

Example setups by timeframe

Use caseMain changesGoal
Scalping on the 1-minute to 5-minuteMin/Max Length 5/21, Price Pivot 2/1, trend filter and %K/%D confirmation on, EMA 50React faster while restricting counter-trend BUY/SELL to the trend direction
Day trading on the 15-minute to 1-hourDefaults, with the trend filter on as neededThe use case the defaults are designed for
Swing trading on the 4-hour to dailyMin/Max Length 13/55, Z-Score Length 30, Level -1.5/1.5, Price Pivot 5/3Catch only big extremes and clear-cut swing highs and lows

This table summarizes the timeframe-specific settings from the usage guide on the script’s public page. Rather than copying the exact numbers, take away the general direction: “shorter timeframes, shorter lookbacks plus filters” and “longer timeframes, wider lookbacks and thresholds.” The practical approach is to adjust gradually while watching how many labels print on your own market and where they land.

Pair it with ADX to see when the labels are worth trusting

The weak spot of AF_StochZ_Overlay is that it keeps printing counter-trend labels in strong trends. That is where ADX, which measures trend strength, pairs well. ADX tracks strength only, not direction, so a rising ADX means momentum is building, whether price is going up or down.

While ADX is rising, treat a BUY as a label printed mid-selloff

AF_StochZ_Overlay is designed to catch reversals from extremes, so keeping ADX, a trend-strength gauge, alongside it makes it easier to tell when a label is worth trusting.

While ADX is rising, treat a BUY as a label printed mid-selloffA schematic chart with AF_StochZ_Overlay on top and TradingView's built-in ADX below. The BUY+R-Bull that prints after ADX turns up gets run over by the continuing decline.ADX (14, 14)SELLR-BearSELLR-BearR-BearBUYH-BullR-BearH-BearBUYH-BullSELLH-BearH-BullR-BearR-BullR-BearBUYR-BullH-BearBUYR-BullR-BullH-BearSELLH-BearR-BullH-BullBUYR-BullBUYR-BullADX bottoms and turns upBUY+R-Bull right afterWhile ADX keeps rising,the selloff continues despite the labels

Vowars DE ver.3.12.36

The lower pane is TradingView's built-in ADX (default settings), added as a pairing example. ADX measures trend strength rather than direction, so a rising ADX means momentum is building whether price is going up or down.

In Figure 1, ADX bottoms and turns up, and right after that the BUY+R-Bull in Figure 2 prints. But as Figure 3 shows, the decline kept going while ADX kept rising, and the selloff didn’t stop after the BUY. This makes it easier to skip counter-trend labels while ADX is rising, treating them as labels printed mid-trend, and give priority to labels that print while ADX is flat or falling.

I also found these indicators easy to combine with it.

  • Keltner Channels let you check whether a BUY or R-Bull printed near the lower band or near the midline, which confirms the extreme from a price-range perspective as well.
  • Chaikin Money Flow (CMF) helps you check, when a divergence label prints, whether volume-weighted buying or selling pressure is also fading.
  • Supertrend shows the trend direction through its line color, so you can use it as a visual guide instead of the trend filter’s EMA.

What you can rely on, and what to take with a grain of salt

What you can rely on

  • Read the oscillator’s signals on the price chart alone, without a separate pane
  • Z-Score normalization lets you use the same -1 and +1 levels on assets with very different volatility
  • Signals are evaluated on confirmed bars only, and labels never vanish once they appear
  • When BUY/SELL and a divergence overlap, they merge into one label, so confluence is obvious at a glance
  • Each of the six label types has its own alert condition

Take with a grain of salt

  • Labels print two bars after the swing high or low, so historical charts make them look more accurate than they are
  • Strong trends keep producing counter-trend labels
  • Divergence labels have no Z-Score threshold, so lower timeframes get flooded with them
  • The oscillator value itself is never shown, so you can’t tell from a label how stretched the move is
  • The EMA used by the trend filter isn’t drawn on the chart

Six alerts, one for each label type

Alert conditions map one-to-one to the labels. An alert fires on the bar where the label is confirmed, which is two bars after the swing low or high.

Alert conditionMatching label
StochZ Lead BUYBUY
StochZ Lead SELLSELL
Regular Bullish DivergenceR-Bull
Regular Bearish DivergenceR-Bear
Hidden Bullish DivergenceH-Bull
Hidden Bearish DivergenceH-Bear

Since the signals themselves are evaluated at bar close, setting the alert trigger to “Once Per Bar Close” keeps the alerts in sync with when the labels appear. When BUY and R-Bull print on the same bar, each alert condition triggers separately. And if the trend filter or %K/%D confirmation is on, the BUY/SELL alerts follow the filtered results.

Who AF_StochZ_Overlay is for, and who it isn’t for

AF_StochZ_Overlay

AF_StochZ_Overlay packages Stochastic extremes and divergences so you can read them directly on the price chart. Since you don’t need a separate pane, it should suit traders who want a cleaner chart or who make decisions mainly from price action.

It shines most when you are hunting for reversals at the upper and lower edges of a range. On the other hand, if you are a trend follower and take every label as a fade signal, you’ll get run over again and again. Keep a second yardstick such as the trend filter or ADX, and treat the labels as markers that flag overextended momentum. In my experience, that is the key to getting long-term value out of this indicator.

Finally, when you add it to your chart, remember one thing above all: labels print two bars late and attach to a past bar. Judge signals by the close of the bar where the label appears, not by how the historical chart looks. Keep that in mind, and AF_StochZ_Overlay can pack a lot of information into a single chart.

Sources: This article is based on hands-on testing and in-depth analysis of the indicator AF_StochZ_Overlay by mehmetbezgincan on the charting platform TradingView.

Disclaimer: This article summarizes our own testing and analysis of how an indicator published on TradingView works and behaves. The symbols, timeframes, and settings used here were chosen to check how the indicator displays—they are not a recommendation to trade those instruments or to use the suggested settings. Indicators can change when their authors update them, so this article reflects the version we tested. All investment decisions are your own.

Never miss a new indicator
Get Vowars in Google search, a browser alert on publish, or updates on X.
YUZURU
AuthorYUZURUFounder & Reviewer, Vowars
View profileClose

An editor for content sites at a web agency, I started trading crypto in 2018. Working my way from spot to futures got me hooked on chart analysis, and I now build my own custom indicators on TradingView. On Vowars, I test TradingView indicators one by one on my own charts and review everything from the math behind them to how to use them and where they fall short, with custom visuals throughout.…

Created by

Vowars Picks

Stochastic Heat Map

“Stochastic Heat Map” Tested: Bottom-to-Top Color Shifts That Show How Real a Move Is

"Stochastic Heat Map" is an oscillator that stacks 28 Stochastics with lengths from 10 to 280 as colors, showing where price sits in its range on every lookback at once. The way color spreads from the bottom rows to the top tells you how strong a move is, but red stays pinned in strong trends, so it works best with direction handled separately by something like an EMA.

DifficultyIntermediate 8 figures

CME Institutional Order Flow & AMT Lens

Auction Market Theory on One Chart: An Indicator That Flags Volume Absorption by Color

“CME Institutional Order Flow & AMT Lens” is a TradingView indicator that combines a volume profile, candle coloring, shelves, and a dashboard in one. It gives no buy or sell signals and instead automatically marks key prices such as the POC and Value Area.

DifficultyAdvanced 7 figures

Fibonacci Trend Continuation Signals [AlgoAlpha]

Measure Pullback Depth Inside a Trend With “Fibonacci Trend Continuation Signals”

"Fibonacci Trend Continuation Signals" is a free TradingView indicator that automatically draws a Fibonacci range in the direction of the trend and prints a continuation signal the moment price starts moving again after a pullback or bounce. It gives you an objective read on pullback depth.

DifficultyIntermediate 5 figures

Smart Trader, Episode 06, Isotropic Trend Lines

Isotropic Trend Lines: Measuring Trend Strength with a Volatility-Adjusted Angle

Isotropic Trend Lines is a channel indicator that puts price on a log scale and divides it by volatility (σ) to produce a trend angle that does not depend on chart scaling. On one screen you get direction, strength, and position in the channel, plus breakout and retest status.

DifficultyIntermediate 10 figures

Strong Burst Fader

Strong Burst Fader: Measure Overextension with Diamond Stacks and Color for Mean-Reversion Fades

“Strong Burst Fader” measures how far the wick pokes outside a hidden moving average plus ATR band and shows that depth as diamond stack height and color, making it a mean-reversion indicator for fading overextended moves. The taller and redder the stack, the deeper the overshoot, and the best setups come when the burst stops at one stack and price closes back inside the band.

DifficultyBeginner 9 figures

Divergence for Many Indicators v4

Divergence for Many Indicators v4 : How to Read Divergence Across 10 Indicators in One Label

"Divergence for Many Indicators v4" is a TradingView indicator that detects divergence across 10 indicators, including RSI and MACD, and shows how many line up in a single label. Signals come early, but only the last one survives within the same swing. It works best once you've defined market direction.

DifficultyIntermediate 6 figures

Browse by goal

1 / 5