OPEN-SOURCE SCRIPT
PGS - Pareto-Gaussian Skew [Zofesu]

PGS - Pareto-Gaussian Skew [Zofesu] is a trend gravity indicator built on two mathematical principles: the Gaussian distribution for detecting statistically significant price moves, and the Pareto principle for isolating the minority of moves that drive the majority of directional displacement.
The result is a single adaptive line that acts as a gravitational center — pulling toward institutional price displacement while filtering out the noise that makes standard moving averages lag or whipsaw.
─────────────────────────────────────
01 — What is PGS?
─────────────────────────────────────
PGS plots a gravity line that tracks where price is being pulled by significant institutional moves. Unlike a standard moving average, it does not react to all price movement equally. It reacts only when price moves beyond one standard deviation from its mean — the threshold where statistically normal noise ends and directional displacement begins.
Below that threshold, the line stays anchored to the mean. Above it, the Pareto Skew Factor shifts the gravity line toward the extreme, capturing the 20% of moves that drive 80% of the trend.
─────────────────────────────────────
02 — How it works
─────────────────────────────────────
The engine runs in three steps:
Step 1 — Mean and standard deviation
SMA and standard deviation are calculated over the lookback window (default 100 bars). This defines the Gaussian baseline — the statistical center of recent price behavior.
Step 2 — Extreme detection
The distance between current close and the mean is measured. If that distance exceeds 1x standard deviation, the move is classified as extreme. Moves within 1 standard deviation are treated as noise and ignored.
Step 3 — Pareto displacement
Extreme moves are multiplied by the Pareto Skew Factor (default 0.8). This skewed value is then smoothed with an EMA over a quarter of the lookback period and added back to the mean — producing the final gravity line.
Formula:
gravity = SMA(close, n) + EMA(d × extreme × skew, n/4)
where d = close − SMA(close, n), extreme = 1 if |d| > StDev else 0
─────────────────────────────────────
03 — Visuals
─────────────────────────────────────
Blue line — Pareto-Gaussian gravity line
Tension Cloud — fill between price and the gravity line.
Green fill = price above gravity line (bullish tension).
Pink fill = price below gravity line (bearish tension).
Note: Price Reference and PGS Reference appear in the indicator's plot list but are invisible on the chart. They are internal anchors required by Pine Script's fill() function and serve no visual or analytical purpose for the user.
─────────────────────────────────────
04 — Settings
─────────────────────────────────────
Smith's Memory (Lookback) — default 100
Number of candles used for the Gaussian baseline. Higher = slower, more stable line. Lower = faster, more reactive.
Pareto Skew Factor — default 0.8
Weight applied to extreme moves. Higher = gravity line shifts more aggressively toward institutional displacement. Lower = more conservative, stays closer to the mean.
─────────────────────────────────────
05 — How To Use
─────────────────────────────────────
Step 1 — Read the Tension Cloud
Green fill = price is above the gravity line. Bullish context — look for longs or hold existing positions.
Pink fill = price is below the gravity line. Bearish context — look for shorts or avoid longs.
Step 2 — Watch for gravity line crossings
Price crossing the gravity line from below = potential bullish shift.
Price crossing from above = potential bearish shift.
Step 3 — Use as dynamic support and resistance
In trending markets the gravity line acts as a dynamic S/R level. Price pulling back to the line in a green cloud = potential long entry zone.
Step 4 — Combine with higher timeframe context
PGS works best as a trend context filter alongside entry tools. It defines the direction — your entry indicator defines the moment.
Works on all asset classes: Indices, Forex, Gold, Oil, Crypto.
Best timeframes: H1, H4, D1.
The result is a single adaptive line that acts as a gravitational center — pulling toward institutional price displacement while filtering out the noise that makes standard moving averages lag or whipsaw.
─────────────────────────────────────
01 — What is PGS?
─────────────────────────────────────
PGS plots a gravity line that tracks where price is being pulled by significant institutional moves. Unlike a standard moving average, it does not react to all price movement equally. It reacts only when price moves beyond one standard deviation from its mean — the threshold where statistically normal noise ends and directional displacement begins.
Below that threshold, the line stays anchored to the mean. Above it, the Pareto Skew Factor shifts the gravity line toward the extreme, capturing the 20% of moves that drive 80% of the trend.
─────────────────────────────────────
02 — How it works
─────────────────────────────────────
The engine runs in three steps:
Step 1 — Mean and standard deviation
SMA and standard deviation are calculated over the lookback window (default 100 bars). This defines the Gaussian baseline — the statistical center of recent price behavior.
Step 2 — Extreme detection
The distance between current close and the mean is measured. If that distance exceeds 1x standard deviation, the move is classified as extreme. Moves within 1 standard deviation are treated as noise and ignored.
Step 3 — Pareto displacement
Extreme moves are multiplied by the Pareto Skew Factor (default 0.8). This skewed value is then smoothed with an EMA over a quarter of the lookback period and added back to the mean — producing the final gravity line.
Formula:
gravity = SMA(close, n) + EMA(d × extreme × skew, n/4)
where d = close − SMA(close, n), extreme = 1 if |d| > StDev else 0
─────────────────────────────────────
03 — Visuals
─────────────────────────────────────
Blue line — Pareto-Gaussian gravity line
Tension Cloud — fill between price and the gravity line.
Green fill = price above gravity line (bullish tension).
Pink fill = price below gravity line (bearish tension).
Note: Price Reference and PGS Reference appear in the indicator's plot list but are invisible on the chart. They are internal anchors required by Pine Script's fill() function and serve no visual or analytical purpose for the user.
─────────────────────────────────────
04 — Settings
─────────────────────────────────────
Smith's Memory (Lookback) — default 100
Number of candles used for the Gaussian baseline. Higher = slower, more stable line. Lower = faster, more reactive.
Pareto Skew Factor — default 0.8
Weight applied to extreme moves. Higher = gravity line shifts more aggressively toward institutional displacement. Lower = more conservative, stays closer to the mean.
─────────────────────────────────────
05 — How To Use
─────────────────────────────────────
Step 1 — Read the Tension Cloud
Green fill = price is above the gravity line. Bullish context — look for longs or hold existing positions.
Pink fill = price is below the gravity line. Bearish context — look for shorts or avoid longs.
Step 2 — Watch for gravity line crossings
Price crossing the gravity line from below = potential bullish shift.
Price crossing from above = potential bearish shift.
Step 3 — Use as dynamic support and resistance
In trending markets the gravity line acts as a dynamic S/R level. Price pulling back to the line in a green cloud = potential long entry zone.
Step 4 — Combine with higher timeframe context
PGS works best as a trend context filter alongside entry tools. It defines the direction — your entry indicator defines the moment.
Works on all asset classes: Indices, Forex, Gold, Oil, Crypto.
Best timeframes: H1, H4, D1.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Think Act Believe. Use SL. Use BreakEven. Respect the market. Your ego and arrogance can destroy your trading account. Never leave the table unless you have a closed trade or SL/BE. Indicator does not guarantee profit.
discord.gg/FcSJpSvNnv
discord.gg/FcSJpSvNnv
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Think Act Believe. Use SL. Use BreakEven. Respect the market. Your ego and arrogance can destroy your trading account. Never leave the table unless you have a closed trade or SL/BE. Indicator does not guarantee profit.
discord.gg/FcSJpSvNnv
discord.gg/FcSJpSvNnv
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.