OPEN-SOURCE SCRIPT

Quad Stochastic Divergence Toolkit

225
# Quad Stochastic Divergence Toolkit

## Short Description

A four-stochastic divergence toolkit designed to streamline the identification of bullish and bearish stochastic divergences across multiple stochastic speeds.

Inspired by concepts taught in Day Trading Rock Star's Quad Rotation Stochastic Divergence methodology.

---

# Full Description

## Quad Stochastic Divergence Toolkit

The **Quad Stochastic Divergence Toolkit** is a visual trading indicator designed to make it easier to monitor divergence across four stochastic oscillators simultaneously.

The indicator was created to streamline the process of identifying potential bullish and bearish stochastic divergences when using a multi-stochastic approach.

It is inspired by concepts I learned from **Day Trading Rock Star and the Quad Rotation Stochastic Divergence methodology**.

This is an independently developed TradingView tool and is **not an official Day Trading Rock Star indicator, product, or publication**.

### What the Indicator Shows

The indicator displays four independently configured stochastic oscillators in one pane.

Each stochastic can identify two types of regular divergence:

**Bullish / Long Divergence**

Price makes a **lower low** while the corresponding stochastic makes a **higher low**.

This can indicate that downside momentum is weakening even though price has continued lower.

**Bearish / Short Divergence**

Price makes a **higher high** while the corresponding stochastic makes a **lower high**.

This can indicate that upside momentum is weakening even though price has continued higher.

The indicator is intended as a visual analysis tool. A divergence is not, by itself, a trade entry or exit signal.

---

## Four Stochastic Speeds

The toolkit contains four stochastic oscillators with separate settings.

The default configuration uses:

**Stochastic 1**
Length: 9
K Smoothing: 1
D Smoothing: 3

**Stochastic 2**
Length: 14
K Smoothing: 1
D Smoothing: 3

**Stochastic 3**
Length: 40
K Smoothing: 1
D Smoothing: 4

**Stochastic 4**
Length: 60
K Smoothing: 1
D Smoothing: 10

Each oscillator is vertically offset so all four can be viewed clearly within the same indicator pane.

Users can modify the stochastic settings if they prefer a different configuration.

---

## Independent Long and Short Divergence Settings

One of the main purposes of this toolkit is to allow bullish and bearish divergence detection to be tuned independently.

Each stochastic contains two divergence detection groups:

**Div A** — shorter/smaller pivot structure

**Div B** — longer/larger pivot structure

For both Div A and Div B, bullish and bearish divergences have separate pivot settings.

For example:

Long Left A
Long Right A
Short Left A
Short Right A

This allows the user to use different pivot sensitivity for long and short divergences rather than forcing both directions to use identical settings.

The same independent controls are available for all four stochastic oscillators.

---

## Divergence Display

Bullish divergence lines are displayed in green/lime by default.

Bearish divergence lines are displayed in red/maroon by default.

Both the price divergence and the corresponding stochastic divergence are drawn so the relationship between price and momentum can be visually compared.

Div A and Div B can also use different:

* Colors
* Line widths
* Line styles
* Pivot sensitivities

This helps distinguish shorter-term divergence structures from larger ones.

---

## Value Labels

Each stochastic has a current-value label displayed near the right side of the oscillator.

The user can independently control:

* Whether the label is shown
* How many bars to the right of the current bar it appears
* The number/text color of the label

This helps keep the current stochastic readings visible without requiring the labels to sit directly on the most recent candle.

---

## Important: Pivot Confirmation

Divergences in this indicator are based on **confirmed pivot highs and pivot lows**.

A pivot cannot be confirmed until the selected number of **Right** bars has occurred.

For example, if a divergence uses a Right setting of 3, the pivot is not known until three bars after the actual pivot bar.

Once confirmed, the divergence line is drawn back to the originating pivot.

Therefore, a historical divergence line appearing on an earlier candle **does not mean the divergence was known on that candle in real time**.

The actual confirmation occurs only after the required right-side bars have completed.

Increasing the Right setting generally produces more selective pivot structures but also increases the amount of time required before a divergence can be confirmed.

---

## How I Use the Toolkit

The purpose of the indicator is to quickly see whether momentum across multiple stochastic speeds is diverging from price.

Rather than treating every divergence as a trade signal, I use the toolkit as a way of identifying areas that may deserve additional attention.

Possible additional considerations include:

* Market structure
* Support and resistance
* Trend direction
* Higher-timeframe context
* Price action
* Volume
* Session timing
* Risk/reward
* Other confirmation methods used in the trader's own process

Different traders may interpret stochastic divergence differently, so the indicator intentionally provides extensive configuration options rather than prescribing a single trading method.

---

## Customization

Each stochastic can be independently configured, including:

* Enable/disable oscillator
* Stochastic length
* K smoothing
* D smoothing
* Vertical offset
* Stochastic line color
* Value label visibility
* Value label horizontal offset
* Value label number color
* Bullish divergence enable/disable
* Bearish divergence enable/disable
* Independent Long Left/Right pivot settings
* Independent Short Left/Right pivot settings
* Div A settings
* Div B settings
* Divergence line colors
* Divergence line widths
* Divergence line styles

This makes it possible to use the indicator as a starting framework and then adapt it to a trader's own divergence methodology.

---

## Attribution

This indicator was independently developed as a tool to help streamline concepts I learned from **Day Trading Rock Star**, particularly the **Quad Rotation Stochastic Divergence** approach.

Credit for those educational concepts belongs to Day Trading Rock Star.

This TradingView implementation is my own tool for visualizing and organizing stochastic divergence and is not presented as an official Day Trading Rock Star product, indicator, endorsement, or publication.

Users interested in the original trading methodology should refer to Day Trading Rock Star's own educational material for his explanation and application of the strategy.

---

## Disclaimer

This indicator is provided for educational and analytical purposes only.

Divergence does not guarantee a market reversal and should not be interpreted as a prediction of future price movement.

Historical examples are not evidence of future performance.

The indicator does not provide investment advice, financial advice, or individualized trading recommendations.

Trading involves risk. Users are responsible for their own trading decisions, position sizing, risk management, and evaluation of any trading methodology.



# Release Notes — Version 1.0

**Quad Stochastic Divergence Toolkit — Initial Release**

Version 1.0 includes:

* Four independently configurable stochastic oscillators
* Vertically stacked stochastic display
* Bullish regular divergence detection
* Bearish regular divergence detection
* Separate Div A and Div B pivot structures
* Independent Long Left/Right pivot settings
* Independent Short Left/Right pivot settings
* Separate bullish and bearish divergence styling
* Price-chart divergence lines
* Stochastic-pane divergence lines
* Adjustable stochastic value-label positioning
* Selectable hover-label number colors
* Independent controls for all four stochastic oscillators

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.