Supertrend Indicator by Mobius for ThinkorSwim

switchfire

switchfire

Member
VIP
I've never used your scan but it could be the case, does the scan give an alert to close or just when supertrend crosses price?
I'm still wrapping my head around thinkscript, but from what i can tell it's if the calculation crosses above/ below the close. It's the same script on the front page.
 
BenTen

BenTen

Administrative
Staff
VIP
@switchfire You're getting the alert probably because the candle was still developing but no confirmation yet until it's closed.
 
switchfire

switchfire

Member
VIP
@switchfire You're getting the alert probably because the candle was still developing but no confirmation yet until it's closed.
That would make sense if the scan allows that. Some limitations here but can live with them.
 
T

tomsk

Well-known member
VIP
@BenTen @tomsk I'm getting scan alerts seemingly randomly. I used the scan code from the initial post (#commenting out either bull or bear for each filter). Added both of them to "Any of the following". Scanning only in /ES. And alerting only when "a symbol is added to scan results". I ensured the 'atr mult' & 'natr' settings are the same in my chart and both scan & charts are set to hourly. I am getting alerts even when no buy or sell signals are created. I know i'm missing something lol. Thanks for any insight! :)

@switchfire Post your complete scan code, I'll take a look at that and see if anything obvious comes up modulo the other comments made here
 
switchfire

switchfire

Member
VIP
@tomsk The same code on the first page, just 1.5 AtrMult:
Code:
# SuperTrend Scan
# Mobius
# V01.10.2015
# Comment out (#) the direction NOT to use for a scan

input AtrMult = 1.5;
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
 
T

tomsk

Well-known member
VIP
@switchfire So long as you understand the effects of changing the AtrMult to 1.5, I don't see any apparant issues with that. As a matter of fact running the scan on a daily aggregation on the S&P 500, I obtained 12 results, including BA. Loading the SuperTrend study on a chart, it does look in line with the scan.
 
switchfire

switchfire

Member
VIP
@switchfire So long as you understand the effects of changing the AtrMult to 1.5, I don't see any apparant issues with that. As a matter of fact running the scan on a daily aggregation on the S&P 500, I obtained 12 results, including BA. Loading the SuperTrend study on a chart, it does look in line with the scan.
It would be nice if i could set up the alerts to only notify if the supertrend has signaled with the closing bar for whichever time frame.
 
Last edited:
J

JohnsonM

New member
VIP
Hi All. Hoping you can help me here please. How do I create a supertrend watchlist with the code supplied in above comment? Not sure where to copy the code to. Appreciate any help please. Thanks in advance.
 
BenTen

BenTen

Administrative
Staff
VIP
@JohnsonM Under your watchlist, there is a dropdown called Custom Quotes. Select one of the option in there and paste the code in. Also, be sure to adjust the timeframe.
 
J

JohnsonM

New member
VIP
HI Ben. Thanks so much for your quick reply. Apologies for my ignorance but I cannot see Custom Quotes. Could you please send me a screenshot? I only see Customize but am limited to the studies in there without ability to paste code in ... unless I am looking in the wrong place.
 
J

JohnsonM

New member
VIP
OK. So ... I hav figured it out BUT how do I create watchlists for different time frames please?
 
BenTen

BenTen

Administrative
Staff
VIP
@JohnsonM Where you paste your code, there is an option to adjust the timeframe. By default, your watchlist will be assigned to the Daily timeframe. You can switch to another timeframe based on your liking.
 
D

DB01

New member
Ive been playing with a combo of the Supertrend and Ehler's MAMA. Any ideas from anyone on filtering out some go the chop? I tried the Chop Indy that's been posted on one of these threads, tried an ADX/DMI combo, tried various CCI's, all worked to one degree or another, none really knocked my socks off. There seems to be some real experience on this site. Any knowledge I can steal from anyone?
 
T

Trading51

Active member
2019 Donor
I couldn’t find the exact code I see post for ECI Gaussian, but which one are you referring to with the dots ?
 
T

tutianlong

New member
VIP
this is a great indicator but i can't get it to work on the app because the candles in the TOS app (android) cant change colour. however, i got an idea, instead of showing bubble, is it possible to let it indicate an Up or Down arrow instead ? This way, it should work just fine on the app version. can anyone help me with that ?
 
Top