Indicator for Think or Swim based on Rob Smith's The STRAT

I think I'm looking for the STRAT (1,2,3) sequence numbers that are displayed under the candle sticks as a chart view indicator you have. Is there another script for that? When I download the current script I get a different output in display
The script you posted is just for the labels. You need what's posted by Pelonsax on page one of this thread titled "STRAT BAR NUMBERS 2.0".
 

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

I'm sorry, but what does "bottom of the thread" mean? There are no post / updates from 04/25/22. Is the latest version that at the top of page 1? The code for the original TFC study posted there has flaw in it and won't populate.
 
Last edited:
those are failed 2s because 2d or 2u only specifies highs and lows not open and close
I found a watchlist script
https://docs.google.com/document/d/1F0lzd19QenSOAaS-InpozgZhOjD4rupT-K-gv6k8MJk/edit#
that works for what I'm looking for. https://tos.mx/R6DTFwL
Ruby:
#------------------------------------
# SCENARIOS
#------------------------------------
def H = high;
def L = low;
def C = close;
def O = open;

def insidebar =  (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]);
def outsidebar =  H  > H[1] and L <  L[1];

def insidebarup  = insidebar and O < C;
def twoup  = H > H[1] and L >= L[1];
def outsidebarup  = outsidebar and O < C;
def insidebardown  = insidebar and O > C;
def twodown  = H <= H[1] and L < L[1];
def outsidebardown  = outsidebar and O > C;

#Hammer Calculations
def UpperWick = high - Max(open, close);
def LowerWick = Min(open, close) - low;
def CandleBody = AbsValue(open - close);
# Hammers

#def Star = twoup and (UpperWick / CandleBody >= 1.5);
#def Hammer = twodown and (LowerWick / CandleBody >= 1.5);

# Hammers
def Star = twoup and (UpperWick / CandleBody >= 1.5) and (LowerWick / CandleBody <= 1);
def Hammer = twodown and (LowerWick / CandleBody >= 1.5) and (UpperWick / CandleBody <= 1);
#------------------------------------
# REVERSALS
#------------------------------------
# Double Inside
def doubleInsidebull = L < H[1] and insidebar[1] and insidebar[2] and twoup;
# Bullish
def ThreeOneTwoBull = L < H[1] and twoup and insidebar[1] and outsidebar[2] and C > O;
def ThreeTwoTwoBull = L < H[1] and twoup and twodown[1] and outsidebar[2] and C > O;
def RevStratBull = L < H[1] and twoup and twodown[1] and insidebar[2] and C > O;
def TwoTwoRevBull = L < H[1] and twodown[1] and twoup and C > O;
def two_down_three = twodown and close > hl2[1];
def TwoOneTwoBull = L < H[1] and twoup and insidebar[1] and twodown[2] and C > O;


# Bearish
def doubleInsidebear = H > L[1] and insidebar[1] and insidebar[2] and twodown;
def TwoOneTwoBear = H > L[1] and twodown and insidebar[1] and twoup[2] and C < O;
def ThreeOneTwoBear = H > L[1] and twodown and insidebar[1] and outsidebar[2] and C < O;
def ThreeTwoTwoBear = H > L[1] and twodown and twoup[1] and outsidebar[2] and C < O;
def RevStratBear = H > L[1] and twodown and twoup[1] and insidebar[2] and C < O;
def TwoTwoRevBear = H > L[1] and twoup[1] and twodown and C < O;
def two_up_three = twoup and close < hl2[1];

# -------------------------
# Labels
# -------------------------

AddLabel(yes, if
insidebar then "INSIDE" else if
doubleinsidebull or doubleinsidebear then " 2x inside" else if
TwoTwoRevBull and !ThreeTwoTwoBull and !RevStratBull and !Hammer[1] then "2-2 Rev" else if
TwoTwoRevBull and !ThreeTwoTwoBull and !RevStratBull and Hammer[1] then "  2-2 Hammer Rev" else if
TwoOneTwoBull and !ThreeOneTwoBull then " 2-1-2" else if
ThreeOneTwoBull then "  3-1-2" else if
ThreeTwoTwoBull then "  3-2-2" else if
RevStratBull then " 1-2-2" else if
two_up_three then " 50% " else if
TwoTwoRevBear and !ThreeTwoTwoBear and !RevStratBear and !Star[1] then "2-2 Rev" else if
TwoTwoRevBear and !ThreeTwoTwoBear and !RevStratBear and Star[1] then "  2-2 SHOOTER Rev" else if
TwoOneTwoBear and !ThreeOneTwoBear then " 2-1-2" else if
ThreeOneTwoBear then "  3-1-2" else if
ThreeTwoTwoBear then "  3-2-2" else if
two_down_three then "  50% " else if
outsidebar then "3" else if
twodown then "2d" else if
twoup then "2u" else if
RevStratBear then " 1-2-2" else "-", Color.BLACK);



AssignBackgroundColor(if
TwoOneTwoBull or
ThreeOneTwoBull or
RevStratBull or
two_down_three or
TwoTwoRevBull then CreateColor(133,202,91) else if
two_up_three or
TwoOneTwoBear or
ThreeOneTwoBear or
ThreeTwoTwoBear or
RevStratBear or
TwoTwoRevBear then CreateColor(252,125,127) else if
C > O then  CreateColor(133,202,91) else if
C < O then  CreateColor(252,125,127) else if
ThreeTwoTwoBull or ThreeTwoTwoBear or doubleInsidebull or doubleinsidebear then Color.LIME
else Color.BLACK);
 
Last edited by a moderator:
I found a watchlist script
https://docs.google.com/document/d/1F0lzd19QenSOAaS-InpozgZhOjD4rupT-K-gv6k8MJk/edit#
that works for what I'm looking for. https://tos.mx/R6DTFwL
Ruby:
#------------------------------------
# SCENARIOS
#------------------------------------
def H = high;
def L = low;
def C = close;
def O = open;

def insidebar =  (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]);
def outsidebar =  H  > H[1] and L <  L[1];

def insidebarup  = insidebar and O < C;
def twoup  = H > H[1] and L >= L[1];
def outsidebarup  = outsidebar and O < C;
def insidebardown  = insidebar and O > C;
def twodown  = H <= H[1] and L < L[1];
def outsidebardown  = outsidebar and O > C;

#Hammer Calculations
def UpperWick = high - Max(open, close);
def LowerWick = Min(open, close) - low;
def CandleBody = AbsValue(open - close);
# Hammers

#def Star = twoup and (UpperWick / CandleBody >= 1.5);
#def Hammer = twodown and (LowerWick / CandleBody >= 1.5);

# Hammers
def Star = twoup and (UpperWick / CandleBody >= 1.5) and (LowerWick / CandleBody <= 1);
def Hammer = twodown and (LowerWick / CandleBody >= 1.5) and (UpperWick / CandleBody <= 1);
#------------------------------------
# REVERSALS
#------------------------------------
# Double Inside
def doubleInsidebull = L < H[1] and insidebar[1] and insidebar[2] and twoup;
# Bullish
def ThreeOneTwoBull = L < H[1] and twoup and insidebar[1] and outsidebar[2] and C > O;
def ThreeTwoTwoBull = L < H[1] and twoup and twodown[1] and outsidebar[2] and C > O;
def RevStratBull = L < H[1] and twoup and twodown[1] and insidebar[2] and C > O;
def TwoTwoRevBull = L < H[1] and twodown[1] and twoup and C > O;
def two_down_three = twodown and close > hl2[1];
def TwoOneTwoBull = L < H[1] and twoup and insidebar[1] and twodown[2] and C > O;


# Bearish
def doubleInsidebear = H > L[1] and insidebar[1] and insidebar[2] and twodown;
def TwoOneTwoBear = H > L[1] and twodown and insidebar[1] and twoup[2] and C < O;
def ThreeOneTwoBear = H > L[1] and twodown and insidebar[1] and outsidebar[2] and C < O;
def ThreeTwoTwoBear = H > L[1] and twodown and twoup[1] and outsidebar[2] and C < O;
def RevStratBear = H > L[1] and twodown and twoup[1] and insidebar[2] and C < O;
def TwoTwoRevBear = H > L[1] and twoup[1] and twodown and C < O;
def two_up_three = twoup and close < hl2[1];

# -------------------------
# Labels
# -------------------------

AddLabel(yes, if
insidebar then "INSIDE" else if
doubleinsidebull or doubleinsidebear then " 2x inside" else if
TwoTwoRevBull and !ThreeTwoTwoBull and !RevStratBull and !Hammer[1] then "2-2 Rev" else if
TwoTwoRevBull and !ThreeTwoTwoBull and !RevStratBull and Hammer[1] then "  2-2 Hammer Rev" else if
TwoOneTwoBull and !ThreeOneTwoBull then " 2-1-2" else if
ThreeOneTwoBull then "  3-1-2" else if
ThreeTwoTwoBull then "  3-2-2" else if
RevStratBull then " 1-2-2" else if
two_up_three then " 50% " else if
TwoTwoRevBear and !ThreeTwoTwoBear and !RevStratBear and !Star[1] then "2-2 Rev" else if
TwoTwoRevBear and !ThreeTwoTwoBear and !RevStratBear and Star[1] then "  2-2 SHOOTER Rev" else if
TwoOneTwoBear and !ThreeOneTwoBear then " 2-1-2" else if
ThreeOneTwoBear then "  3-1-2" else if
ThreeTwoTwoBear then "  3-2-2" else if
two_down_three then "  50% " else if
outsidebar then "3" else if
twodown then "2d" else if
twoup then "2u" else if
RevStratBear then " 1-2-2" else "-", Color.BLACK);



AssignBackgroundColor(if
TwoOneTwoBull or
ThreeOneTwoBull or
RevStratBull or
two_down_three or
TwoTwoRevBull then CreateColor(133,202,91) else if
two_up_three or
TwoOneTwoBear or
ThreeOneTwoBear or
ThreeTwoTwoBear or
RevStratBear or
TwoTwoRevBear then CreateColor(252,125,127) else if
C > O then  CreateColor(133,202,91) else if
C < O then  CreateColor(252,125,127) else if
ThreeTwoTwoBull or ThreeTwoTwoBear or doubleInsidebull or doubleinsidebear then Color.LIME
else Color.BLACK);
is the above hammer/shooter code actually picking up failed 2's? Im looking for a scan that just detects failed 2's if anyone can help that would be awesome!
 
@Pelonsax, Hey Ramon, I have a strat script i quite like but i would like to ask a few questions on it.
I will post the script below for reference.
It shows the previous two day candle formations and then the expected candle the following day, like this,
2D-2D[2U]. However, I notice that the candles do not change until the premarket of the following day. Is there a way to get these to print the current candles after market close? Thank you.

#
# M T F S T R A T
# W A T C H L I S T
# a Study by Ramon DV. aka Pelonsax
#
#------------------------------------
#------------------------------------
# S T R A T R E V E R S A L S
#
# A study by Ramon DV. aka Pelonsax
#
# Version 1.0 8/01/20
#
# Version 2.0 8/4/20 Corrected errors in logic for scenarios
# Version 2.1 8/15/20 Added Reversals
# 9/15/20 added two previous bars and reversals for WL columns
#
#------------------------------------
def H = high;
def L = low;
def O = open;
def C = close;
#------------------------------------
# DEFINE SCENARIOS
#------------------------------------
def insidebar = (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]);
def outsidebar = H > H[1] and L < L[1];

def insidebarup = insidebar and O < C;
def twoup = H > H[1] and L >= L[1];
def outsidebarup = outsidebar and O < C;
def insidebardown = insidebar and O > C;
def twodown = H <= H[1] and L < L[1];
def outsidebardown = outsidebar and O > C;


def insidebar1 = (H[1] < H[2] and L[1] > L[2]) or (H[1] == H[2] and L[1] > L[2]) or (H[1] < H[2] and L[1] == L[2]) or (H[1] == H[2] and L[1] == L[2]);
def outsidebar1 = H[1] > H[2] and L[1] < L[2];

def insidebarup1 = insidebar1 and O[1] < C[1];
def twoup1 = H[1] > H[2] and L[1] >= L[2];
def outsidebarup1 = outsidebar1 and O[1] < C[1];
def insidebardown1 = insidebar1 and O[1] > C[1];
def twodown1 = H[1] <= H[2] and L[1] < L[2];
def outsidebardown1 = outsidebar1 and O[1] > C[1];


def insidebar2 = (H[2] < H[3] and L[2] > L[3]) or (H[2] == H[3] and L[2] > L[3]) or (H[2] < H[3] and L[2] == L[3]) or (H[2] == H[3] and L[2] == L[3]);
def outsidebar2 = H[2] > H[3] and L[2] < L[3];

def insidebarup2 = insidebar2 and O[2] < C[2];
def twoup2 = H[2] > H[3] and L[2] >= L[3];
def outsidebarup2 = outsidebar2 and O[2] < C[2];
def insidebardown2 = insidebar2 and O[2] > C[2];
def twodown2 = H[2] <= H[3] and L[2] < L[3];
def outsidebardown2 = outsidebar2 and O[2] > C[2];

#------------------------------------
# DEFINE REVERSALS (Basic four)
#------------------------------------

# Bullish
def TwoOneTwoBull = twoup and insidebar1 and twodown2;
def TwoTwoBull = twoup and twodown1;
def ThreeBull = outsidebarup and (twodown1 or insidebar1 or outsidebardown1);
def ThreeOneTwoBull = twoup and insidebar1 and outsidebardown2;

# Bearish
def TwoOneTwoBear = twodown and insidebar1 and twoup2;
def TwoTwoBear = twodown and twoup2;
def ThreeBear = outsidebardown and (twoup1 or insidebar1 or outsidebarup1);
def ThreeOneTwoBear = twodown and insidebar1 and outsidebarup2;

#------------------------------------
# LABEL SECTION
#------------------------------------
AddLabel(yes,

(if twoup2 then “2U” else if twodown2 then “2D” else if insidebarup2 then “1U" else if insidebardown2 then “1D” else if outsidebarup2 then “3U” else if outsidebardown2 then “3D” else if insidebar2 and !insidebarup2 and !insidebardown2 then "1" else if outsidebar2 and !outsidebarup2 and !outsidebardown2 then "3" else “”) + “-“ +

(if twoup1 then “2U” else if twodown1 then “2D” else if insidebarup1 then “1U" else if insidebardown1 then “1D” else if outsidebarup1 then “3U” else if outsidebardown1 then “3D” else if insidebar1 and !insidebarup1 and !insidebardown1 then "1" else if outsidebar1 and !outsidebarup1 and !outsidebardown1 then "3" else “”)+ ”-“ +

(if twoup then “[2U]” else if twodown then “[2D]” else if insidebarup then “[1U]” else if insidebardown then “[1D]” else if outsidebarup then “[3U]” else if outsidebardown then “[3D]” else if insidebar and !insidebarup and !insidebardown then “[1]” else if outsidebar and !outsidebarup and !outsidebardown then “[3]” else “”), color.black);

assignbackgroundColor(if TwoOneTwoBull or TwoTwoBull or ThreeBull or ThreeOneTwoBull then color.cyan else if TwoOneTwoBear or TwoTwoBear or ThreeBear or ThreeOneTwoBear then color.magenta else if

!TwoTwoBull and
!ThreeBull and
!ThreeOneTwoBull and
!TwoOneTwoBear and
!TwoTwoBear and
!ThreeBear and
!ThreeOneTwoBear and
twoup then color.green else if

!TwoOneTwoBull and
!TwoTwoBull and
!ThreeBull and
!ThreeOneTwoBull and
!TwoOneTwoBear and
!TwoTwoBear and
!ThreeBear and
!ThreeOneTwoBear and
twodown then color.red else if

!TwoOneTwoBull and
!TwoTwoBull and
!ThreeBull and
!ThreeOneTwoBull and
!TwoOneTwoBear and
!TwoTwoBear and
!ThreeBear and
!ThreeOneTwoBear and
outsidebarup then color.dark_green else if

!TwoOneTwoBull and
!TwoTwoBull and
!ThreeBull and
!ThreeOneTwoBull and
!TwoOneTwoBear and
!TwoTwoBear and
!ThreeBear and
!ThreeOneTwoBear and
insidebarup then color.light_green else if

!TwoOneTwoBull and
!TwoTwoBull and
!ThreeBull and
!ThreeOneTwoBull and
!TwoOneTwoBear and
!TwoTwoBear and
!ThreeBear and
!ThreeOneTwoBear and
outsidebardown then color.dark_red else if

!TwoOneTwoBull and
!TwoTwoBull and
!ThreeBull and
!ThreeOneTwoBull and
!TwoOneTwoBear and
!TwoTwoBear and
!ThreeBear and
!ThreeOneTwoBear and
insidebardown then color.orange else if

!TwoOneTwoBull and
!TwoTwoBull and
!ThreeBull and
!ThreeOneTwoBull and
!TwoOneTwoBear and
!TwoTwoBear and
!ThreeBear and
!ThreeOneTwoBear and
!insidebarup and
!insidebardown and
insidebar then color.white else if

!TwoOneTwoBull and
!TwoTwoBull and
!ThreeBull and
!ThreeOneTwoBull and
!TwoOneTwoBear and
!TwoTwoBear and
!ThreeBear and
!ThreeOneTwoBear and
!outsidebardown and
!outsidebarup and
outsidebar then color.white

else color.current);
 
@Pelonsax
Is there a way to create a watchlist using the code below from the background color change?

Code:
#-------------------------------
#
# S T R A T    O P E N S
#
# a study that indicates the opens
# on mutliple time frames
# for full time frame continuity INTRADAY
# and FULL. All in one.
# Author: Ramon DV aka Pelonsax
#
#--------------------------------
declare upper;
# -----------------------------------
# INPUTS
# -----------------------------------
input Use_Minute = yes;
input Use_Three = yes;
input Use_Five = yes;
input Use_Fifteen = yes;
input Use_Thirty = yes;
input Use_Sixty = yes;
input Use_Day = yes;
input Use_Week = yes;
input Use_Month = yes;
input Use_Year = yes;
input Show_Lines = yes;
input Show_Arrows = yes;
input Show_Label = yes;
# -----------------------------------
# 1 Minute
# -----------------------------------
def "1mAGG" = AggregationPeriod.MIN;
def Vminute = GetAggregationPeriod() <= AggregationPeriod.MIN;
def minute;
if Use_Minute and Vminute {
    minute = open(period = "1mAGG");
} else {
    minute = open;
}
# -----------------------------------
# 3 Minute
# -----------------------------------
def "3mAGG" = AggregationPeriod.THREE_MIN;
def Vthree = GetAggregationPeriod() <= AggregationPeriod.THREE_MIN;
def three;
if Use_Three and Vthree {
    three = open(period = "3mAGG");
} else {
    three = open;
}
# -----------------------------------
# 5 Minute
# -----------------------------------
def "5mAGG" = AggregationPeriod.FIVE_MIN;
def Vfive = GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN;
def five;
if Use_Five and Vfive {
    five = open(period = "5mAGG");
} else {
    five = open;
}
# -----------------------------------
# 15 Minute Line
# -----------------------------------
def "15mAGG" = AggregationPeriod.FIFTEEN_MIN;
def Vfifteen = GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN;
def fifteen;
if Use_Fifteen and  Vfifteen {
    fifteen = open(period = "15mAGG");
} else {
    fifteen = open;
}
# -----------------------------------
# 30 Minute Line
# -----------------------------------
def "30mAGG" = AggregationPeriod.THIRTY_MIN;
def Vthirty = GetAggregationPeriod() <= AggregationPeriod.THIRTY_MIN;
def thirty;
if Use_Thirty and Vthirty {
    thirty = open(period = "30mAGG");
} else {
    thirty = open;
}
# -----------------------------------
# 60 Minute Line
# -----------------------------------
def "60mAGG" = AggregationPeriod.HOUR;
def Vhour = GetAggregationPeriod() <= AggregationPeriod.HOUR;
def hour;
if Use_Sixty and Vhour {
    hour = open(period = "60mAGG");
} else {
    hour = open;
}
# -----------------------------------
# Day
# -----------------------------------
def "1DAGG" = AggregationPeriod.DAY;
def Vday = GetAggregationPeriod() <= AggregationPeriod.DAY;
def day;
if Use_Day and Vday {
    day = open(period = "1DAGG");
} else {
    day = open;
}
# -----------------------------------
# Week
# -----------------------------------
def "1wAGG" = AggregationPeriod.WEEK;
def Vweek = GetAggregationPeriod() <= AggregationPeriod.WEEK;
def week;
if Use_Week and Vweek {
    week = open(period = "1wAGG");
} else {
    week = open;
}
# -----------------------------------
# Month
# -----------------------------------
def "1MOAGG" = AggregationPeriod.MONTH;
def Vmonth = GetAggregationPeriod() <= AggregationPeriod.MONTH;
def month;
if Use_Month and Vmonth {
    month = open(period = "1MOAGG");
} else {
    month = open;
}
# -----------------------------------
# Year
# -----------------------------------
def "1YAGG" = AggregationPeriod.YEAR;
def Vyear = GetAggregationPeriod() <= AggregationPeriod.YEAR;
def year;
if Use_Year and Vyear {
    year = open(period = "1YAGG");
} else {
    year = open;
}

# -----------------------------------
# FTC COMPONENT
# -----------------------------------

# TOP

plot top = if minute >=
three and minute >=
five and minute >=
fifteen and minute >=
thirty and minute >=
hour and minute >=
day and minute >=
week and minute >=
month and minute >=
year then minute else

if three >=
minute and three >=
five and three >=
fifteen and three >=
thirty and three >=
hour and three >=
day and three >=
week and three >=
month and three >=
year then three else

if five >=
minute and five >=
three and five >=
fifteen and five >=
thirty and five >=
hour and five >=
day and five >=
week and five >=
month and five >=
year then five else

if fifteen >=
minute and fifteen >=
three and fifteen >=
five and fifteen >=
thirty and fifteen >=
hour and fifteen >=
day and fifteen >=
week and fifteen >=
month and fifteen >=
year then fifteen else

if thirty >=
minute and thirty >=
three and thirty >=
five and thirty >=
fifteen and thirty >=
hour and thirty >=
day and thirty >=
week and thirty >=
month and thirty >=
year then thirty  else

if hour >=
minute and hour >=
three and hour >=
five and hour >=
fifteen and hour >=
thirty and hour >=
day and hour >=
week and hour >=
month and hour >=
year then hour else

if day >=
minute and day >=
three and day >=
five and day >=
fifteen and day >=
thirty and day >=
hour and day >=
week and day >=
month and day >=
year then day else

if week >=
minute and week >=
three and week >=
five and week >=
fifteen and week >=
thirty and week >=
hour and week >=
day and week >=
month and week >=
year then week else

if month >=
minute and month >=
three and month >=
five and month >=
fifteen and month >=
thirty and month >=
hour and month >=
day and month >=
week and month >=
year then month else

if year >=
minute and year >=
three and year >=
five and year >=
fifteen and year >=
thirty and year >=
hour and year >=
day and year >=
week and year >=
month then year else

Double.NaN;

# BOTTOM

plot bottom = if minute <=
three and minute <=
five and minute <=
fifteen and minute <=
thirty and minute <=
hour and minute <=
day and minute <=
week and minute <=
month and minute <=
year then minute else

if three <=
minute and three <=
five and three <=
fifteen and three <=
thirty and three <=
hour and three <=
day and three <=
week and three <=
month and three <=
year then three else

if five <=
minute and five <=
three and five <=
fifteen and five <=
thirty and five <=
hour and five <=
day and five <=
week and five <=
month and five <=
year then five else

if fifteen <=
minute and fifteen <=
three and fifteen <=
five and fifteen <=
thirty and fifteen <=
hour and fifteen <=
day and fifteen <=
week and fifteen <=
month and fifteen <=
year then fifteen else

if thirty <=
minute and thirty <=
three and thirty <=
five and thirty <=
fifteen and thirty <=
hour and thirty <=
day and thirty <=
week and thirty <=
month and thirty <=
year then thirty  else

if hour <=
minute and hour <=
three and hour <=
five and hour <=
fifteen and hour <=
thirty and hour <=
day and hour <=
week and hour <=
month and hour <=
year then hour else

if day <=
minute and day <=
three and day <=
five and day <=
fifteen and day <=
thirty and day <=
hour and day <=
week and day <=
month and day <=
year then day else

if week <=
minute and week <=
three and week <=
five and week <=
fifteen and week <=
thirty and week <=
hour and week <=
day and week <=
month and week <=
year then week else

if month <=
minute and month <=
three and month <=
five and month <=
fifteen and month <=
thirty and month <=
hour and month <=
day and month <=
week and month <=
year then month else

if year <=
minute and year <=
three and year <=
five and year <=
fifteen and year <=
thirty and year <=
hour and year <=
day and year <=
week and year <=
month then year else
Double.NaN;

top.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
top.SetLineWeight(3);
top.SetDefaultColor(Color.CYAN);
top.SetHiding(!Show_lines);

bottom.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
bottom.SetLineWeight(3);
bottom.SetDefaultColor(Color.MAGENTA);
bottom.SetHiding(!Show_lines);

plot FTCUp = close crosses above top;
FTCUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
FTCUp.SetDefaultColor(Color.gray);
FTCUp.SetLineWeight(1);
FTCUp.SetHiding(!Show_Arrows);

plot FTCDN = close crosses below bottom;
FTCDN.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
FTCDN.SetDefaultColor(Color.gray);
FTCDN.SetLineWeight(1);
FTCDN.SetHiding(!Show_Arrows);

addlabel(Show_Label, "CONTINUITY UP " + asdollars(top) + " DOWN " + asdollars(bottom) + " ", color.light_gray);
addlabel(Show_Label, " USING: ", color.light_gray);
addlabel(Show_Label and Use_Minute, "1min ", color.light_gray);
addlabel(Show_Label and Use_Three, "3min ", color.light_gray);
addlabel(Show_Label and Use_Five, "5min ", color.light_gray);
addlabel(Show_Label and Use_Fifteen, "15min ", color.light_gray);
addlabel(Show_Label and Use_Thirty, "30min ", color.light_gray);
addlabel(Show_Label and Use_Sixty, "60min ", color.light_gray);
addlabel(Show_Label and Use_Day, "Day ", color.light_gray);
addlabel(Show_Label and Use_Week, "Week ", color.light_gray);
addlabel(Show_Label and Use_Month, "Month ", color.light_gray);
addlabel(Show_Label and Use_Year, "Year ", color.light_gray);
# -----------------------------------
# BACKGROUND COLOR
# -----------------------------------

DefineGlobalColor("UP”, CreateColor(000, 065, 000));
DefineGlobalColor("DOWN”, CreateColor(125, 000, 000));

assignBackgroundColor(if FTCUP then GlobalColor("UP") else if FTCDN then GlobalColor("DOWN") else color.black);
input Use_Alerts = yes;
Alert(Use_Alerts and FTCUP, "FTC Upside", Alert.BAR, Sound.Bell);
Alert(Use_Alerts and FTCDN, "FTC Downside", Alert.BAR, Sound.Bell);
 
Last edited by a moderator:
  • Like
Reactions: ASC
I'm sorry, but what does "bottom of the thread" mean? There are no post / updates from 04/25/22. Is the latest version that at the top of page 1? The code for the original TFC study posted there has flaw in it and won't populate.
@MerryDay Just Checking is there a Strat update of 4/25/22 I can't locate it.
 
@MerryDay Just Checking is there a Strat update of 4/25/22 I can't locate it.
The OP was pretty good about putting his updates in the top post in this thread.

@Pelonsax stills frequents the Forum but the last time he answered a question on this thread was February 2021.
In these 23 pages he has said pretty much everything that can be said on this subject.
Here is a hack for searching for answers on huge threads like this one:
https://usethinkscript.com/threads/answers-to-commonly-asked-questions.6006/#post-58238
 
New addition to the overlays. This one is a script I found in a different thread that is much better than the ones I posted because it shows wicks. It was provided by BPerrot but it appears to be based on the original Paul Townsend framework with elements of logic from Robert Payne as well as @halcyonguy (I recognized his handiwork in the code).

https://tos.mx/VX0M8C3

 
Last edited by a moderator:
Hello, hope everyone is well. i was wondering if anyone can add "verticals clouds" to this Script? Highlighting both (inside candles)
Thank you!

def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);
plot PatternPlot =
((Sum(IsUp, 1)[2] >= 0)) and
((Sum(IsUp, 1)[1] >= 0)) and
((Sum(IsUp, 1)[0] >= 0)) and
Lowest(low[1], 1) < Lowest(low[0], 1) and
Lowest(low[2], 1) < Lowest(low[1], 1) and
Highest(high[1], 1) > Highest(high[0], 1) and
Highest(high[2], 1) > Highest(high[1], 1);

PatternPlot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
PatternPlot.SetDefaultColor(GetColor(0));
 
I put @Pelonsax strat watchlist on tos options contract and I was wondering if anyone has done this before because you can peak into contracts before buying them. The indicator has the option for any timeframe and you can see the continuity
 
I put @Pelonsax strat watchlist on tos options contract and I was wondering if anyone has done this before because you can peak into contracts before buying them. The indicator has the option for any timeframe and you can see the continuity
?? please explain more and show a pic if you can
 
I have downloaded the failed2 scans and tried to open up the custom study, but inside there's only one line of function: "failed2D()" . It's giving error code of "no such function: failed2D at 1:1" , yet the scan works fine and doesn't work without that line of code, but i can't find the codes hidden that makes the scan work, could anyone let me know why? it's probably something dumb.... it's driving me nuts, thanks for your time~
Screenshot 2023-05-29 161210.png
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
386 Online
Create Post

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