OPEN-SOURCE SCRIPT
Zaktualizowano

Quad Rotation - 4 Stochastics Overlay with ABCD Detection

1759
"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.
Informacje o Wersji
Added super signal logic, where all 4 stochs are above or below 80 / 20
Informacje o Wersji
added alerts
Informacje o Wersji
bug fixes etc
Informacje o Wersji
some improvements
Informacje o Wersji
Added divergence detection and some cleanup
Informacje o Wersji
I added some code that allows for divergence colors that can match the line colors for easier visual differentiation.
Informacje o Wersji
Minor bug fix
Informacje o Wersji
one more bug fix
Informacje o Wersji
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.

Informacje o Wersji
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.





Informacje o Wersji
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.
Informacje o Wersji
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).
Informacje o Wersji
reverting the code - still t'shooting divergence alerts
Informacje o Wersji
OK I think I might have fixed the stochastic divergence alert bug...
Informacje o Wersji
reverted changes
Informacje o Wersji
I think I finally fixed the stochastic divergence alerts - this was harder than doing the entire indicator.
Informacje o Wersji
reverted again! :(

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.