OPEN-SOURCE SCRIPT
Telah dikemas kini

Quad Rotation - 4 Stochastics Overlay with ABCD Detection

1788
"Quad Rotation - 4 Stochastics Overlay with ABCD Detection" is a momentum indicator combining four separate Stochastics and an ABCD pattern detection system.

Each Stochastic uses different parameter settings to capture potential rotation points in market momentum.

When three or more (this number is user customizable) of these Stochastics simultaneously slope downward above the 80 level (or slope upward below the 20 level), the chart background highlights in red (bearish) or green (bullish), indicating a multi-Stochastic momentum signal.

Additionally, the script tracks Stochastic #4 to detect an ABCD pattern:

Long Pattern (A-B) triggers if Stochastic #4 remains above 90 for a specified number of bars (abBars).
Short Pattern (C-D) triggers if Stochastic #4 remains below 10 for a specified number of bars (cdBars).

Visual markers (green X for long setups, red X for short setups) appear on the chart once these conditions are met. Users can enable alerts to receive real-time notifications whenever momentum signals or ABCD patterns occur.

This combination of multi-Stochastic momentum and ABCD detection helps traders gauge potential trend exhaustion and reversal points with greater confidence.
Nota Keluaran
Added super signal logic, where all 4 stochs are above or below 80 / 20
Nota Keluaran
added alerts
Nota Keluaran
bug fixes etc
Nota Keluaran
some improvements
Nota Keluaran
Added divergence detection and some cleanup
Nota Keluaran
I added some code that allows for divergence colors that can match the line colors for easier visual differentiation.
Nota Keluaran
Minor bug fix
Nota Keluaran
one more bug fix
Nota Keluaran
Bug fix for the Alert Conditions for Divergences section

Resetting Alerts:
At the beginning of each divergence block (for Stochastics 1–4), the script resets the corresponding divergence alert flags to false. This ensures that an alert is only flagged on the bar where the divergence condition is met.

Divergence Logic:
After resetting, the script computes the pivot points and then checks if the price and the oscillator move in opposite directions. If the condition is met, it draws a line and sets the alert flag to true for that divergence.

Alert Conditions:
The final alertcondition calls trigger an alert whenever the corresponding alert flag is true on that bar.

Nota Keluaran
Bug fix:

In this version each divergence block resets its respective alert flags at the start of every bar. This ensures the alert conditions (which remain unchanged at the bottom) only trigger on the bar where a divergence is first detected rather than on every subsequent bar.





Nota Keluaran
I am having a lot of trouble with the divergence alerts firing all the time.

Alert Condition Updates:
Instead of having alert conditions simply check if the divergence flag is true, each alert now includes a condition to check that the flag was false on the previous bar. For example, for Stoch1 Bearish Divergence, the alert condition changed from:

alertcondition(alertDivergenceStoch1Bearish, title="Stoch1 Bearish Divergence", message="Bearish divergence detected on Stochastic 1")
to
alertcondition(alertDivergenceStoch1Bearish and not alertDivergenceStoch1Bearish[1], title="Stoch1 Bearish Divergence", message="Bearish divergence detected on Stochastic 1")

This ensures that the alert fires only at the moment the divergence is newly detected rather than continuously on subsequent bars.
This update should prevent repeated alerts for past divergences.
Nota Keluaran
In the divergence section (step 8), after computing a one‑shot divergence condition (using persistent “last alert bar” variables) we now add the check:

and barstate.isconfirmed

to each alertcondition(). This ensures that the alert only fires once when a bar is closed (i.e. the bar is confirmed), rather than triggering repeatedly during realtime updates (which can happen every minute or more frequently).
Nota Keluaran
reverting the code - still t'shooting divergence alerts
Nota Keluaran
OK I think I might have fixed the stochastic divergence alert bug...
Nota Keluaran
reverted changes
Nota Keluaran
I think I finally fixed the stochastic divergence alerts - this was harder than doing the entire indicator.
Nota Keluaran
reverted again! :(

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.