OPEN-SOURCE SCRIPT
Super-Elliptic Bands

The core of the "Super-Elliptic Bands" indicator lies in its use of a super-ellipse mathematical model to create dynamic price bands around a central Simple Moving Average (SMA). Here's a concise breakdown of its essential components:
Central Moving Average (MA):
A Simple Moving Average (ta.sma(close, maLen)) serves as the baseline, anchoring the bands to the average price over a user-defined period (default: 50 bars).
Super-Ellipse Formula:
The bands are generated using the super-ellipse equation: |y/b| = (1 - |x/a|^p)^(1/p), where:
x is a normalized bar index based on a user-defined cycle period (periodBase, default: 64), scaled to range from -1 to +1.
a = 1 (fixed semi-major axis).
b is the volatility-based semi-minor axis, calculated as volRaw * mult, where volRaw comes from ta.stdev, ta.atr, or ta.tr (user-selectable).
p (shapeP, default: 2.0) controls the band shape:
p = 2: Elliptical bands.
p < 2: Pointier, diamond-like shapes.
p > 2: Flatter, rectangular-like shapes.
This formula creates bands that dynamically adjust their width and shape based on price volatility and a cyclical component.
enjoy....
Central Moving Average (MA):
A Simple Moving Average (ta.sma(close, maLen)) serves as the baseline, anchoring the bands to the average price over a user-defined period (default: 50 bars).
Super-Ellipse Formula:
The bands are generated using the super-ellipse equation: |y/b| = (1 - |x/a|^p)^(1/p), where:
x is a normalized bar index based on a user-defined cycle period (periodBase, default: 64), scaled to range from -1 to +1.
a = 1 (fixed semi-major axis).
b is the volatility-based semi-minor axis, calculated as volRaw * mult, where volRaw comes from ta.stdev, ta.atr, or ta.tr (user-selectable).
p (shapeP, default: 2.0) controls the band shape:
p = 2: Elliptical bands.
p < 2: Pointier, diamond-like shapes.
p > 2: Flatter, rectangular-like shapes.
This formula creates bands that dynamically adjust their width and shape based on price volatility and a cyclical component.
enjoy....
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.