OPEN-SOURCE SCRIPT

Jurik Angle Flow [Kodexius]

113
Jurik Angle Flow is a Jurik based momentum and trend strength oscillator that converts Jurik Moving Average behavior into an intuitive angle based flow gauge. Instead of showing a simple moving average line, this tool measures the angular slope of a smoothed Jurik curve, normalizes it and presents it as a bounded oscillator between plus ninety and minus ninety degrees.

The script uses two Jurik engines with different responsiveness, then blends their information into a single power score that drives both the oscillator display and the on chart gauge. This makes it suitable for identifying trend direction, trend strength, exhaustion conditions and early shifts in market structure. Built in divergence detection between price and the Jurik angle slope helps highlight potential reversal zones while bar coloring and a configurable no trade zone assist with visual filtering of choppy conditions.

imagen

🔹 Features

🔸 Dual Jurik slope engine

The indicator internally runs two Jurik Moving Average calculations on the selected source price. A slower Jurik stream models the primary trend while a faster Jurik stream reacts more quickly to recent changes. Their slopes are measured as angles in degrees, scaled by Average True Range so that the slope is comparable across different instruments and timeframes.

🔸 Angle based oscillator output

Both Jurik streams are converted into angle values by comparing the current value to a lookback value and normalizing by ATR. The result is passed through the arctangent function and expressed in degrees. This creates a smooth oscillator that directly represents steepness and direction of the Jurik curve instead of raw price distance.

🔸 Normalized power score

The angle values are transformed into a normalized score between zero and one hundred based on their absolute magnitude, then the sign of the angle is reapplied. This yields a symmetric score where extreme positive values represent strong bullish pressure and extreme negative values represent strong bearish pressure. The final power score is a weighted blend of the slow and fast Jurik scores.

🔸 Adaptive color gradients

The main oscillator area and the fast slope line use gradient colors that react to the angle strength and direction. Rising green tones reflect bullish angular momentum while red tones reflect bearish pressure. Neutral or shallow slopes remain visually softer to indicate indecision or consolidation.

🔸 Trend flip markers

Whenever the primary Jurik slope crosses through zero from negative to positive, an up marker is printed at the bottom of the oscillator panel. Whenever it crosses from positive to negative, a down marker is drawn at the top. These flips act as clean visual signals of potential trend initiation or termination.

imagen

🔸 Divergence detection on Jurik slope

The script optionally scans the fast Jurik slope for pivot highs and lows. It then compares those oscillator pivots against corresponding price pivots.

Regular bullish divergence is detected when the oscillator prints a higher low while price prints a lower low.

Regular bearish divergence is detected when the oscillator prints a lower high while price prints a higher high.

imagen

When detected, the tool draws matching divergence lines both on the oscillator and on the chart itself, making divergence zones easy to notice at a glance.

🔸 Bar coloring and no trade filter

Bars can be colored according to the primary Jurik slope gradient so that price bars reflect the same directional information as the oscillator. Additionally a configurable no trade threshold can visually mute bars when the absolute angle is small. This highlights trending sequences and visually suppresses noisy sideways stretches.

🔸 On chart power gauge

A creative on chart gauge displays the composite power score beside the current price action. It shows a vertical range from plus ninety to minus ninety with a filled block that grows proportionally to the normalized score. Color and label updates occur in real time and provide a quick visual summary of current Jurik flow strength without needing to read exact oscillator levels.

imagen

🔹 Calculations

Below are the main calculation blocks that drive the core logic of Jurik Angle Flow.

Jurik core update

Pine Script®
method update(JMA self, float _src) => self.src := _src float phaseRatio = self.phase < -100 ? 0.5 : self.phase > 100 ? 2.5 : self.phase / 100.0 + 1.5 float beta = 0.45 * (self.length - 1) / (0.45 * (self.length - 1) + 2) float alpha = math.pow(beta, self.power) if na(self.e0) self.e0 := _src self.e1 := 0.0 self.e2 := 0.0 self.jma := 0.0 self.e0 := (1 - alpha) * _src + alpha * self.e0 self.e1 := (_src - self.e0) * (1 - beta) + beta * self.e1 float prevJma = self.jma self.e2 := (self.e0 + phaseRatio * self.e1 - prevJma) * math.pow(1 - alpha, 2) + math.pow(alpha, 2) * self.e2 self.jma := self.e2 + prevJma self.jma


This method implements the Jurik Moving Average engine with internal state and phase control, producing a smooth adaptive value stored in self.jma.

Angle calculation in degrees

Pine Script®
method getAngle(float src, int lookback=1) => float rad2degree = 180 / math.pi float slope = (src - src[lookback]) / ta.atr(14) float ang = rad2degree * math.atan(slope) ang


The slope between the current value and a lookback value is divided by ATR, then converted from radians to degrees through the arctangent. This creates a volatility normalized angle oscillator.

Normalized score from angle

Pine Script®
method normScore(float ang) => float s = math.abs(ang) float p = s / 60.0 * 100.0 if p > 100 p := 100 p


The absolute angle is scaled so that sixty degrees corresponds to a score of one hundred. Values above that are capped, which keeps the final score within a fixed range. The sign is later reapplied to restore direction.

Slow and fast Jurik streams and power score

Pine Script®
var JMA jmaSlow = JMA.new(jmaLen, jmaPhase, jmaPower, na, na, na, na, na) var JMA jmaFast = JMA.new(jmaLen, jmaPhase, 2.0, na, na, na, na, na) float jmaValue = jmaSlow.update(src) float jmaFastValue = jmaFast.update(src) float jmaSlope = jmaValue.getAngle() float jmaFastSlope = jmaFastValue.getAngle() float scoreJma = normScore(jmaSlope) * math.sign(jmaSlope) float scoreJmaFast = normScore(jmaFastSlope) * math.sign(jmaFastSlope) float totalScore = (scoreJma * 0.6 + scoreJmaFast * 0.4)


A slower Jurik and a faster Jurik are updated on each bar, each converted to an angle and then to a signed normalized score. The final composite power score is a weighted blend of the slow and fast scores, where the slow score has slightly more influence. This composite drives the on chart gauge and summarizes the overall Jurik flow.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.