Archived: Supertrend Indicator by Mobius for ThinkorSwim

Status
Not open for further replies.
@BenTen Here is the scanner:

SbEqJiP.png


Here is the code:

OSTmc3h.png
 
@TOSTrader I just pasted that code into the thinkScript editor within my scanner on the Daily chart. I didn't modify anything else.
 
But conditional orders don't like some code.

Conditional orders don't like some code is an understatement. Conditional orders don't like anything but the simplest conditions. Hence the statement TOS does not support auto trading.

While this is endlessly frustrating; my current workaround is to
  • maintain an "owned stocks" watchlist
  • create a scan of watchlist
  • when my exit strategy filters are met, play a custom alert

PS: a fun fact: you can load any length mp3 into custom sounds to play for a scan alert. I might not hear a single ding or bell alert especially if I am not in front of my computer but Alexa playing 3 minutes of "We're In the Money" throughout the house" garners my attention.
 
@aabbaabb111

def UP = HL2 + (atrMult * ATR);
def DN = HL2 + (-atrMult * ATR);


def ST = if close < ST[1] then UP else DN;
plot SuperTrend = ST;

So what is the value of ST when close < ST[1] ?
So what is the value of ST when close> ST[1] ?
 
You cannot use any code in conditional orders that utilizes recursion and I'm fairly certain that the error you are receiving is due to that limitation... Conditional orders can only process simple code, unfortunately...
 
Hello !
I'm new here, I was wondering how to implement the SuperTrend scanner for TOS, I was able to get the indicator to work but not the scanner. I can't find anywhere to enter code for scanners.
Any help would be greatly appreciated !
 
@BenTen - I have a question for you. Since the TOS issues of the past couple days I was trying to set a backup on my NinjaTrader for this indicator. Is that possible? And if so, how?
 
@kyatham777 There is no "final" script. You may find some modified versions here and there. If you don't want to go through all 16 pages then just use the indicator posted on the first page.
 
@kyatham777 There is no "final" script. You may find some modified versions here and there. If you don't want to go through all 16 pages then just use the indicator posted on the first page.

@BenTen I have applied first page script but that will be giving grey bubbles which doesn't give buy or sell indicator. Can you give me a good version of the script.
 
@kyatham777 Take a look at the info given on the first page:

Added Bubbles to mark entry and exit prices.

Bubbles on green candles = bullish and on red candles = bearish.

If you want to find the right one that works for you, then go through the pages.
 
@MerryDay and @BenTen, I am not sure what I am doing wrong still. Here is my scan criteria and the scan code. I run it during market hours.

DGzO6VX.png


Code:
# SuperTrend Scan
# Mobius
# V01.10.2015
# Comment out (#) the direction NOT to use for a scan

input AtrMult = 1.0;
input nATR = 3;
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
 
Status
Not open for further replies.

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
352 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top