Supertrend Indicator by Mobius for ThinkorSwim

C

chIza=iChis1A?H

Member
VIP
@chIza=iChis1A?H Regarding the moving average input, you would have to play around with the settings and see which one works best.
Ok Perfect. I just asked becuase want to know if any one has been using it and getting a good results so I can try that one and start working using the same. NP Thax
 
K

kshires4

Member
@mc01439 Is there anyway of getting a scanner for a triple supertrend with these settings 12,3 11,2 10,1
 
mc01439

mc01439

Well-known member
2019 Donor
VIP
@mc01439 Is there anyway of getting a scanner for a triple supertrend with these settings 12,3 11,2 10,1
Use this code in the scanner with the study code below.

mbhSuperTrend_Scan_Only("atr mult" = 3.0, "atr length" = 12)."BUY" is true and mbhSuperTrend_Scan_Only("atr mult" = 2.0, "atr length" = 11)."BUY" is true and mbhSuperTrend_Scan_Only("atr mult" = 1.0, "atr length" = 10)."BUY" is true

http://tos.mx/Y7KSocH
 
HOVA

HOVA

New member
@BenTen

Do you have a replacement code for the below if I want Arrow Up (green) and Arrow Down (red) instead of the price bubble for the desktop version? Thanks in advance!

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);
 
BenTen

BenTen

Administrative
Staff
VIP
@HOVA This will plot up and down arrows for the signals.

Code:
plot bullish = if close crosses above ST then low[1] else double.nan;
plot bearish = if close crosses below ST then low[1] else double.nan;
bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
bullish.SetDefaultColor(Color.CYAN);
bullish.SetLineWeight(1);
bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
bearish.SetDefaultColor(Color.CYAN);
bearish.SetLineWeight(1);
 
M

mckaycaston

New member
VIP
Is there any way to code the supertrend to keep the colored candles but instead of the choppy line, give the standard trendline that shows resistance/support for placing stop loss? I'm looking for a combo of the colored candles but with the other kind of supertrend lines.
 
K

kshires4

Member
Use this code in the scanner with the study code below.

mbhSuperTrend_Scan_Only("atr mult" = 3.0, "atr length" = 12)."BUY" is true and mbhSuperTrend_Scan_Only("atr mult" = 2.0, "atr length" = 11)."BUY" is true and mbhSuperTrend_Scan_Only("atr mult" = 1.0, "atr length" = 10)."BUY" is true

http://tos.mx/Y7KSocH
Getting error message when using the link
 
MerryDay

MerryDay

Active member
VIP
@kshires4
copy and paste the below code, if you can't get the link to work for you.
make sure to save the study w/ the name: mbhSuperTrend_Scan_Only

Code:
declare lower;

def AggregationPeriod = GetAggregationPeriod();
#hint: thinkScript adaptation of SuperTrend. The speed of the trend changes are controlled by adjusting the ATR input parameters.
#hint atrMult: Multiple to scale the Average True Range (ATR) value. (Smaller numbers will produce faster trend changes.)
input atrMult = 2.5;
#hint atrLength: ATR moving average period length.
input atrLength = 14;
#hint atrType: ATR moving average type
input atrType = AverageType.WILDERS;
#hint pivot/price: Bar pivot used for trend points. (Default is hl2)
input pivot = hl2;
def atr = MovingAverage(atrType, TrueRange(high, close, low), atrLength) * atrMult;
def prUp = pivot + atr;
def prDn = pivot - atr;
# rTrend stores the current trend value and direction. (The direction is currently up if rTrend[1] is positive and down if rTrend[1] is negative, therefore AbsValue is used to compare rTrend values when the trend is down.)
def rTrend = compoundValue(1,
  # Trending Up
    if rTrend[1] > 0 then
      # If close is below trend then switch to downtrend (negative)
        if close < Max(prDn[1], rTrend[1]) then -prUp
      # ...else adjust new uptrend value. 
        else Max(prDn, rTrend[1])
  # Trending Down
    else if rTrend[1] < 0 then
      # If close is above trend then switch to uptrend (positive)
        if close > Min(prUp[1], AbsValue(rTrend[1])) then prDn
      # ...else adjust new downtrend value.
        else -Min(prUp, AbsValue(rTrend[1]))
    else rTrend[1]
, pivot);
# The Trend plot skips a bar whenever the trend direction changes.
def Trend = if Sign(rTrend) == Sign(rTrend[1]) then absValue(rTrend) else Double.NaN;


###############################
##### Orders Conditions   #####
###############################
def Bull = rTrend > 0  and rTrend[1] < 0;
def Bear = rTrend < 0 and rTrend[1] > 0;

plot BUY = Bull;
plot SELL = Bear;
 
Last edited:

Similar threads

Top