OPEN-SOURCE SCRIPT
تم تحديثه

Quad Rotation - 4 Stochastics Overlay with ABCD Detection

1790
"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.
ملاحظات الأخبار
Added super signal logic, where all 4 stochs are above or below 80 / 20
ملاحظات الأخبار
added alerts
ملاحظات الأخبار
bug fixes etc
ملاحظات الأخبار
some improvements
ملاحظات الأخبار
Added divergence detection and some cleanup
ملاحظات الأخبار
I added some code that allows for divergence colors that can match the line colors for easier visual differentiation.
ملاحظات الأخبار
Minor bug fix
ملاحظات الأخبار
one more bug fix
ملاحظات الأخبار
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.

ملاحظات الأخبار
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.





ملاحظات الأخبار
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.
ملاحظات الأخبار
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).
ملاحظات الأخبار
reverting the code - still t'shooting divergence alerts
ملاحظات الأخبار
OK I think I might have fixed the stochastic divergence alert bug...
ملاحظات الأخبار
reverted changes
ملاحظات الأخبار
I think I finally fixed the stochastic divergence alerts - this was harder than doing the entire indicator.
ملاحظات الأخبار
reverted again! :(

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.