This is a Supertrend indicator for ThinkorSwim created by Mobius.
The complete set of discussions from prior to 2021 can be found:
https://usethinkscript.com/threads/archived-supertrend-indicator-by-mobius-for-thinkorswim.12346/
For anyone looking for the mobile version of this indicator, here is the link to that.
Supertrend Indicator: shows trend direction and gives buy or sell signals according to that. It is based on a combination of the average price rate in the current period along with a volatility indicator. The ATR indicator is most commonly used as volatility indicator. The values are calculated as follows:
Up = (HIGH + LOW) / 2 + Multiplier * ATR
Down = (HIGH + LOW) / 2 – Multiplier * ATR
When the change of trend occurs, the indicator flips
The complete set of discussions from prior to 2021 can be found:
https://usethinkscript.com/threads/archived-supertrend-indicator-by-mobius-for-thinkorswim.12346/
thinkScript Code for Supertrend
Code:
# Mobius
# SuperTrend
# Chat Room Request
input AtrMult = 1.0;
input nATR = 4;
input AvgType = AverageType.HULL;
input PaintBars = yes;
def ATR = MovingAverage(AvgType, TrueRange(high, close, low), nATR);
def UP = HL2 + (AtrMult * ATR);
def DN = HL2 + (-AtrMult * ATR);
def ST = if close < ST[1] then UP else DN;
plot SuperTrend = ST;
SuperTrend.AssignValueColor(if close < ST then Color.RED else Color.GREEN);
AssignPriceColor(if PaintBars and close < ST
then Color.RED
else if PaintBars and close > ST
then Color.GREEN
else Color.CURRENT);
AddChartBubble(close crosses below ST, low[1], low[1], color.Dark_Gray);
AddChartBubble(close crosses above ST, high[1], high[1], color.Dark_Gray, no);
# End Code SuperTrend
SuperTrend Scanner for ThinkorSwim
Code:
# SuperTrend Scan
# Mobius
# V01.10.2015
# Comment out (#) the direction NOT to use for a scan
input AtrMult = .70;
input nATR = 4;
input AvgType = AverageType.HULL;
def h = high;
def l = low;
def c = close;
def v = volume;
def ATR = MovingAverage(AvgType, TrueRange(h, c, l), nATR);
def UP = HL2 + (AtrMult * ATR);
def DN = HL2 + (-AtrMult * ATR);
def ST = if c < ST[1]
then Round(UP / tickSize(), 0) * tickSize()
else Round(DN / tickSize(), 0) * tickSize();
#plot SuperTrendUP = if ST crosses below close then 1 else 0;
plot SuperTrendDN = if ST crosses above close then 1 else 0;
# End Code SuperTrend
Shareable Link
https://tos.mx/mK9VggFor anyone looking for the mobile version of this indicator, here is the link to that.
Video Tutorial
Last edited by a moderator: