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

Pelonsax

Active member
VIP
In order to keep the post clean, updates are now found at the very bottom of the thread
NEWEST: 07/25/23

A SUITE OF PRODUCTS BY PELONSAX AKA RAMON DV FOR USE WITH: ROB SMITH’S THE STRAT

I am writing these to help myself learn The STRAT because I am a visual learner. And I am sharing them because many generous people have shared their time and expertise with me along my journey and we can do more when we work together.

But before we get to all of that, here is a link to a really great video that Rob just recorded for Benzinga where he gives a GREAT introduction to The STRAT. It is NOT recommended that you use any of my indicators for trading with live money until you've had the chance to gain a real understanding of how The STRAT works and given yourself ample opportunity to practice on paper.

Here's the video: https://benzinga.wistia.com/medias/zoi6e794v3?fbclid=IwAR06RBtG0bimZcgyDuryjd12K7BdbDPCdkrE-O0k3hcT7JvMsk889v8qv3c

Keep in mind that I am not the creator of The STRAT. I am a disciple who has been creating these TOS studies along the way in my journey to learn this system and be able to visualize how it works. For more information on the STRAT, and to really learn how to use it to trade effectively with or without any of my studies, please visit Rob on Sepia!!

!!!VERY IMPORTANT!!!! THERE ARE NO BUY AND SELL SIGNALS.!!!
The decision to buy or sell MUST BE predicated upon a deeper understanding of this system and any other tools at your disposal.

Lastly, I would like to point out that this is an active thread that is constantly evolving as I continue to improve and add to these studies. If you have questions or comments about them I just ask, as I noted above, that you first make sure you are referring to the most recent version of a particular study and that you be very specific using screenshots in any such comments.

For those of you from Twitter who are just here for the bare essentials, here are two very basic studies:

STRAT BAR NUMBERS 2.0

https://tos.mx/Kac4tLf
3PfcCmA.jpg


Code:
#------------------------------------
# S T R A T    N U M B E R 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
#
#------------------------------------
#------------------------------------
# DEFINE 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 twoup  = H > H[1] and L >= L[1];
def twodown  = H <= H[1] and L < L[1];

#------------------------------------
# STRAT NUMBERS
#------------------------------------
input Show_Strat_Numbers = yes;
input Show_Twos = yes;
plot barType = if Show_Strat_Numbers and insidebar then 1 else if Show_Strat_Numbers and outsidebar then 3 else Double.NaN;
barType.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
barType.AssignValueColor(color.WHITE);

plot barTypeDN = if Show_Strat_Numbers and !insidebar and !outsidebar and Show_Twos and twodown then 2 else Double.NaN;
barTypeDN.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
barTypeDN.AssignValueColor(color.DOWNTICK);

plot barTypeUP = if Show_Strat_Numbers and !insidebar and !outsidebar and Show_Twos and twoup then 2 else Double.NaN;
barTypeUP.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
barTypeUP.AssignValueColor(color.UPTICK);

STRAT BAR CANDLES PAINT ON ONES AND THREES WITH NUMBERS BELOW

https://tos.mx/jdHvqj4

Add the following line to the code above, down at the very bottom:

assignPriceColor(if insidebar then color.yellow else if outsidebar then color.magenta else color.current);

MAIN STUDIES:

TIME_FRAME_CONTINUITY

https://tos.mx/JZROQzW

Please watch this 10 minute tutorial for how to configure and use this study:
https://youtu.be/wYB-OVTDy6U

STRAT_REMIX_2.0

https://tos.mx/dpLsYg3

STRAT_REMIX_LITE_2.0

https://tos.mx/4osFry3
Same as the REMIX but with candle paint only on Inside Bars, Outside Bars, and Reversals. Allows user to turn toggle each.

STRAT_REMIX_SUPER_LITE

https://tos.mx/l7NLHn2
Same as the REMIX but completely stripped down to the bare essentials for machines with performance issues. This is the study I use.

JUST THE 2-2's PLEASE!!

https://tos.mx/oHUheTI
By popular request! A version of REMIX that only looks for 2-2 reversals. BUT!! You can select a secondary (higher) time frame in the settings. So you could have your chart on the 15ers, for example, and still get alerted to the 2-2 reversals on the 60m. Coming soon: REMIX with Secondary TF.

CONTINUITY FLEX GRID

https://tos.mx/bWIOYRv
Custom Flex Grid I made for a friend. Here's a video for how to load the symbols on it:

Here's what it looks like:
G18g2H1.png


RADAR FLEX GRID

https://tos.mx/ekXrkrB
Custom Flex Grid that was Alex Option's idea. Here's a video for it:

Here's what it looks like:
a0A49ZA.png


VIDEO TUTORIAL FOR MAIN STUDIES:


HAMMERS AND SHOOTERS

This study is ONLY meant to allow the user to find the best settings for the hammer and shooting star component of the Remix study and Actionable Signals studies. All it does is find Hammers and Shooters using the same code in those other studies and paints them green or red while all other candles are painted gray. With this study you can tweak the settings in a way that best serves your purposes and then transfer those settings to the Strat studies.

Hammers_N_Shooters
https://tos.mx/zGPo4F4

Nv6NGSJ.png



NEW FULL COLOR VERSION OF OVERLAYS

These work great on a white chart
Darkest shade of green/red Version 1: https://tos.mx/tjloQ7e (the lowest time frame)
Medium shade of green/red Version 2:https://tos.mx/TCdGJMZ
Medium shade of green/red Version 3: https://tos.mx/tRTlDa1
Lightest shade of green/red Version 4: https://tos.mx/ZRF4K8Z(the highest time frame)

Pre-Loaded intraday chart: https://tos.mx/q7Bfm3J (Now complete with TFC study!)
Pre-Loaded full chart: https://tos.mx/jSJp52F (Now complete with TFC study!)

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 Halcyon Guy (I recognized his handiwork in the code). I find this to be particularly useful if all you want is to overlay one or two higher time frames.

https://tos.mx/VX0M8C3


https://imgur.com/R2RTGY3

xqjCBIb.png


I find these are the best settings to the overall appearance the chart if you're using the green/red overlays:

BROUOrv.png



SIMPLE WATCHLIST COLUMNS

Here's what they look like:

ZeLjZmE.png


Here is a code for STRAT Candle watchlist column:


Code:
#------------------------------------
#
#        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
#
#------------------------------------
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;
#------------------------------------
# LABEL SECTION
#------------------------------------
AddLabel(yes,

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
twoup then color.green else if
twodown then color.red else if
outsidebarup then color.dark_green else if
insidebarup then color.light_green else if
outsidebardown then color.dark_red else if
insidebardown then color.orange else if
!insidebarup and
!insidebardown and
insidebar then color.white else if
!outsidebardown and
!outsidebarup and
outsidebar then color.white else color.current);

Here is a code for FTC Watchlist columns:

Code:
#S T R A T      F T C
#WATCHLIST
#Ramon DV aka Pelonsax
plot O = open;
def C = close;
assignBackgroundColor(if C > O then color.GREEN else if O > C then color.RED else if O == C then color.white else color.current);
addlabel(yes, O, color.black);
# END
·

NEW WATCHLIST COLUMN.

Here's a video tutorial for how to set it up:

https://youtu.be/UM9v9yYs4qc

Code:
#------------------------------------
#
#        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);

Here's what how they appear:
JXfTMz6.png


USER MOD REQUEST: SAME Watchlist as above but the colors are controlled by TFC

Code:
#------------------------------------
#
#        M T F      S T R A T
#         W A T C H L I S T       
# a Study by Ramon DV. aka Pelonsax
#
#------------------------------------
#------------------------------------
#    SCENARIOS PLUS TFC
#
# 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 to the watchlist
#
#------------------------------------
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];

#------------------------------------
# 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 C > O then color.GREEN else if O > C then color.RED else if O == C then color.white else color.current);

USER MOD BY BOB'S A STRATTER (THANK'S BOB!)

gmLABfX.png

Code:
#------------------------------------
#
#        M T F      S T R A T
#         W A T C H L I S T
# a Study by Ramon DV. aka Pelonsax
# Modified by Bob's a Stratter
#
#------------------------------------
#------------------------------------
# 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
#
#------------------------------------
plot O = open;
def H = high;
def L = low;

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;
#------------------------------------
# LABEL SECTION
#------------------------------------

AssignBackgroundColor(
if
twoup then Color.GREEN else if
twodown then Color.RED else if
outsidebarup then Color.DARK_GREEN else if
insidebarup then Color.LIGHT_GREEN else if
outsidebardown then Color.DARK_RED else if
insidebardown then Color.ORANGE else if
!insidebarup and
!insidebardown and
insidebar then Color.WHITE else if
!outsidebardown and
!outsidebarup and
outsidebar then Color.YELLOW else Color.CURRENT);
addlabel(yes, O, color.black);

TIME FRAME CONTINUITY STUDY THAT PAINTS CANDLES

I've gotten rid of the other compete TFC study because it interferes with some of the other studies in this suite (like the overlay charts) and is not the easiest thing in the world to load or understand. In it's place, I am sharing this new version of my TFC studies that paints the candles. It uses exactly the same logic as before, so please go to my YouTube channel and watch Beginner Tutorial Part 2 starting at the 25 minute mark in order to understand the theory and logic behind this study. The Part 3 video and Part 4 video further explain and illustrate the power of TFC. There is a version of the study for each of the major time frames titled: Continuity_X, where X is the TF you'll want to load it on. As with any study in TOS, these will only work on time frames that are the same or lower than the time frame used by the study. So for example, Continuity_5 will not work on a 15 minute chart, but it will work on a 1 minute chart, etc.

The colors indicate the following:
Green = Full Time Frame Continuity Up
Red = Full Time Frame Continuity Down
Gray = Conflict

This is what it should look like:

Screen Shot 2023-07-25 at 9.45.59 AM.png


I really enjoy using this version because it allows you to sort of backtest in the sense that you can visually see TFC as it was in the past (which is something that was not possible with previous versions).

When using these studies, be sure and look at the code so that you know which time frames are being considered by them to calculate continuity. Here are the studies:

5 Minute
15 Minute
30 Minute
60 Minute
4 Hour
Day
Week
Month
Quarter

Here is a sample of the code from the 5 minute study:
Code:
#-------------------------------
#
# C O N T I N U I T Y   5
#
# a study that indicates the highest
# and lowest open on mutliple time frames
# for full time frame continuity INTRADAY
#
# Author: Ramon DV aka Pelonsax
#
#--------------------------------
declare upper;

def "5mAGG" = AggregationPeriod.FIVE_MIN;
def "15mAGG" = AggregationPeriod.FIFTEEN_MIN;
def "30mAGG" = AggregationPeriod.THIRTY_MIN;
def "1hAGG" = AggregationPeriod.HOUR;



def five = open(period = "5mAGG");
def fifteen = open(period = "15mAGG");
def thirty = open(period = "30mAGG");
def hour = open(period = "1hAGG");

def top = if five >=
fifteen and five >=
thirty and five >=
hour
then five else


if fifteen >=
five and fifteen >=
thirty and  fifteen >=
hour
then fifteen else

if thirty >=
five and thirty >=
fifteen and thirty >=
hour
then thirty  else

if hour >=
five and hour >=
fifteen and hour >=
thirty
then hour  else Double.NaN;

def bottom = if five <=
fifteen and five <=
thirty and five <=
hour
then five else


if fifteen <=
five and fifteen <=
thirty and  fifteen <=
hour
then fifteen else

if thirty <=
five and thirty <=
fifteen and thirty <=
hour
then thirty  else

if hour <=
five and hour <=
fifteen and hour <=
thirty
then hour  else Double.NaN;


def Fullup = close >= top;
def Fulldown = close <= bottom;

AssignPriceColor( if Fullup then Color.GREEN else if Fulldown then Color.RED else Color.GRAY);

BROADENING FORMATIONS (1ST DRAFT)

This study will only find 1-3 combos and extend diagonal lines outward. I wasn't going to release it yet because I'm waiting to really make it work with multi bar pivots, but someone asked for exactly this in the comments and since this one is ready now, here you go. Keep in mind that this is not exactly the same as a broadening formation as Rob describes it. (It is and it isn't. This is only one example of a broadening formation). It could come in handy if you want to run it on a higher time frame like the daily or weekly and then draw over the lines so that it shows up on the lower time frames. I have to credit Halcyon Guy (Don L.) who wrote the backbone and has given me permission to publish. I moded his version of a similar study that looks for wedges. This is basically the 2 bar inverse of his study.

7www253.png


3_1_Broadening_Formation
https://tos.mx/U6xvWgx

Code:
## ----------------------------------------
# BROADENING FORMATION
# A STRAT STUDY BY PELONSAX AKA RAMON DV
#
# ADAPTED FROM
# quadinsidebar_01
# 2020-06-27
# halcyonguy
# ----------------------------------------

input extend_lines = 100;

def na = double.nan;
def hi = high;
def lo = low;
def bn = barnumber();


# ----- 2 bar outside pattern ---------------------------------
def insidebar0 = hi < hi[-1] and lo > lo[-1];

def insidebar = insidebar0 or insidebar0[1];
def next = insidebar0[-1];

def pattern = fold i = 0 to extend_lines
                 with p
                 do if i > bn then p + 0 else p + GetValue(insidebar,i);

def extend = if (!next and pattern > 0) then 1 else 0;
def en_slopelines = extend;

# ===================================================================

def bargaps = 1;
def slopehi2 = (hi[-bargaps] - hi[0])/bargaps;
def slopelo2 = (lo[-bargaps] - lo[0])/bargaps;
def slopehi = if insidebar0 then slopehi2 else if en_slopelines then slopehi[1] else na;
def slopelo = if insidebar0 then slopelo2 else if en_slopelines then slopelo[1] else na;
def bar0number = if insidebar0 then barnumber() else if en_slopelines then bar0number[1] else na;
def bar0high = if insidebar0 then hi else if en_slopelines then bar0high[1] else na;
def bar0low = if insidebar0 then lo else if en_slopelines then bar0low[1] else na;

plot diaghi = if en_slopelines then ( bar0high + (slopehi * (barnumber() - bar0number))) else na;
diaghi.AssignValueColor(Color.dark_Green);
diaghi.SetStyle(Curve.MEDIUM_DASH);

plot diaglo = if en_slopelines then ( bar0low + (slopelo * (barnumber() - bar0number))) else na;
diaglo.AssignValueColor(Color.dark_green);
diaglo.SetStyle(Curve.MEDIUM_DASH);

#

# ------------------------------------------------------------------

#

!!ACTIONABLE SIGNAL SCANS!!

Rather than go into another lengthy description, I just decided to make a video and post the links.


1 Bar Rev Strat Daily
https://tos.mx/sml8vKo

2 Bar Rev Strat Daily
https://tos.mx/fUIotqN

Hammer Rev
https://tos.mx/A2w2Jkt

Inside Break Bull
https://tos.mx/JKIrGGZ

Kicking Bull
https://tos.mx/JLI4AXC

FAILED 2 SCAN BY JASON GETGEN:

FAILED 2 DOWN:
https://tos.mx/LFDcKrZ

FAILED 2 UP
https://tos.mx/i9q0UgE

Link to James Fox’s STRAT Scan video:

Check out this really great bottom of the hour scan and video for how to set it up by Tim Greco who has been doing amazing work!

https://twitter.com/tgreco2626/status/1406394354344902657?s=20

UPDATE: 03/23/21 Tried to re-upload complete overlay charts with a new link because I noticed that they were set to use log scale. I noticed it messes with my drawings so I turn it off on all my charts. I think it's the best setting. Ill try to give y'all fresh links later (probably just a problem with TOS right now), but for now, to change it manually, it looks like this:

mAJ243X.png


UPDATE: 07/25/23 Removed all-in-one TFC study and replaced it with new candle paint study which is superior for many reasons as stated in the description

UPDATE: 01/23/23 Added a version of the overlay that I found which appears to be the work of Paul Townsend, Robert Payne and Don Larson (Halcyon Guy). I find it to be superior to mine especially if all you want is to overlay one or two higher time frames.

UPDATE: 04/25/22 Added user contribution by Jason Getgen. Look for his "Failed 2" scan in the scan section.

UPDATE: 08/25/21 By popular request! A version of REMIX that only looks for 2-2 reversals. BUT!! You can select a secondary (higher) time frame in the settings. Coming soon: REMIX with Secondary TF.

UPDATE: 05/21/21 Updated strat numbers so that the 1's and 3's appear as white numbers below, the 2U is a green number above and the 2D is a red number below. Added that component to all REMIX studies. Added REMIX SUPER LITE for machines with performance issues. And lastly, I have added two flex grids, one that is only continuity labels, and another that is a full radar screen based on Alex Option's idea. There are video tutorials for each. I also removed the studies that have been incorporated into the REMIX or TFC master studies as well as older studies that were glitchy and I don't have time or desire to support.

UPDATE: 04/01/21 Updated Kicker Actionable signal to include opposite continuity for kick age and fixed bug with measured move. Streamlined thread removing studies that are now obsolete.

UPDATE: 02/28/21 Added TFC study to Pre-Loaded Color Overlay Charts. This is because the Complete TFC study at the top changes the color of the background which defeats the purpose of the color overlay chart on a white background. This is simply a condensed, simplified version of the TFC study. It will only work if the intraday chart is set to 1 minute and the full chart is set to 1 hour.

UPDATE: 02/28/21 Added additional new version of color script. Re-worked the colors to let each TF stand out.

UPDATE: 02/26/21 Added new color version of the overlay study. There are three separate versions, each a different shade.

UPDATE: 01/02/21 Corrected bug in watchlist columns. Then you very much for catching that @fishstick1229 !!!!!!

UPDATE: 10/19/20 Placed link for the two main studies at the top. Added set up tutorial video for two main (most recent studies). Removed older studies (Basic Four). Added Hammers_and_Shooters study. Added Actionable Signal Scans and video

UPDATE: 10/15/20 Made Background Color script all inclusive and MTF capable. Added specific type of actionable signal onto the alerts written into the Remix version

UPDATE: 10/14/20 Per request, added alerts for reversals to the Reversal Remix and Actionable Signal study. Added alert to Background Color FTC Study. Added 1st draft Broadening Formation study.
 

Attachments

  • vPDRqbR.png
    vPDRqbR.png
    291.2 KB · Views: 2,282
  • LOQAqlt.png
    LOQAqlt.png
    258.8 KB · Views: 2,232
Last edited:

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

Excellent Work. I will play with it and provide feedback. Look for Sara @ssabatino84 in twitter she is very good at this strategy and can provide nice feedback since she also uses TOS
 
Hello, your code is incorrect for the inside bar and for the outside bar. An inside bar is where the subsequent bar is completely within the preceding bar, not equal to. Likewise, the outside bar is where the subsequent bar's high and low both exceed the prior bar. Simple fix is to remove your "=" references in the code.

Also, why would you not code the inside bar subsequent bar breakout of the measuring bar (high or low of the bar preceding the inside bar) since those are some of the best reversals?

I think some of your 2s are incorrect as well. My understanding is to qualify as a 2, the bar has to take out one side of the prior bar's range. Thus if say the prior bar's high is 2022.75 and low is 2000, the subsequent bar to qualify has to "take out", ie, exceed, either the top or bottom range. If the tops are equal and the bottom is equal or inside, then it is not a 2, but your chart shows it is. It is a slight nuance, but nonetheless bothers me when I see it on your chart. If I am incorrect in my understanding of what constitutes a 2, then I apologize in advance.

Last comment for now. Your option to remove the numbers indicating what type of bar is ineffective since you define the numbers in the code to print no matter what. Would be great to change that.
 
Last edited by a moderator:
@Pelonsax - Awesome job man! What you have started here has the potential to turn into a killer script. @akoplan brought up some good points. 2's occur when one side of the range is taken out. Especially, if the script can be coded for the measured moves. Here's some more information on the Strat from notes that I have taken from Rob's videos to help in the coding.

- Look for 2-1-2, 3-1-2, 2-2-2, 2-3-2, 2-1-3, 1-3-2 set up's. These strats give us retail traders the best signals.

- RevStrat can only occur after an Inside Bar. First, the 2d-1-2u reversal to the upside. But also note then that the 1-2u-2d is a rev strat back to the down side. 1-2d-2u is a reverse strat to upside. So, when you see a 2-1-2 reversal up, its important that the 2u doesnt come back in against you and then go 2d causing the rev strat down. Remember, a normal rev strat is simply a 1 followed by a 2-2 reversal, be it a 2u-2d or likewise a 2d-2u. The 3 itself is a reversal.
 
@Pelonsax, looking good...!!! I just tossed this onto a Renko Bar chart for an Option and matched it up with a lower study using HullMovingAvg(hl2, 13, 2) and the lower study helps eliminate some chop-bound trades... I'll try to have the chart up tomorrow to see how it performs in real time and report back...
 
@Pelonsax I see that you are excited about this indicator and are starting to see the potential of using this system. Since you asked for feedback, and as a warning of caution to any non-coders reading this, I will reiterate what others have pointed out.
There are conceptual errors here that go beyond the scope of help we can provide in the forum.
We can answer any specific questions about your scripting but I strongly recommend you complete some education about The Strat system before presenting an indicator using Rob's name. If you don't take the course, which I strongly recommend, at least watch the free videos on reversals and test your scripting with some trades. He is very generous with free material so there's no excuse not to educate yourself. The logic errors will become clearer to you. In the meantime it may be a good idea to edit your title and hold off on pushing your indicators to other groups until you have had a chance to understand this system. Best of luck to you.
 
@Pelonsax - Awesome job man! What you have started here has the potential to turn into a killer script. @akoplan brought up some good points. 2's occur when one side of the range is taken out. Especially, if the script can be coded for the measured moves. Here's some more information on the Strat from notes that I have taken from Rob's videos to help in the coding.

- Look for 2-1-2, 3-1-2, 2-2-2, 2-3-2, 2-1-3, 1-3-2 set up's. These strats give us retail traders the best signals.

- RevStrat can only occur after an Inside Bar. First, the 2d-1-2u reversal to the upside. But also note then that the 1-2u-2d is a rev strat back to the down side. 1-2d-2u is a reverse strat to upside. So, when you see a 2-1-2 reversal up, its important that the 2u doesnt come back in against you and then go 2d causing the rev strat down. Remember, a normal rev strat is simply a 1 followed by a 2-2 reversal, be it a 2u-2d or likewise a 2d-2u. The 3 itself is a reversal.
Thanks man. I'm actually working on that now. If you'll look at the original post you'll see the cheat sheet that I plan to code for next. I honestly just plan to code those combos directly into this study. I would really appreciate it if you could point me to a resource that gives an in depth explanation of all of the reversal or continuation patterns beyond the four basic reversals. Thanks in advance!
 
@Pelonsax - Well, I watched an option today and there were a lot of misfires so no trades were made... I have to agree with thinkchart that something is most likely missing... Keep at it and I'll try again...
 
According to Rob Smith's guest post for Steve Burns:

"The truth is there are only 4 ways that price can reverse. First, Scenario 2 in one direction followed by a 1, then a scenario 2 back in the other direction."

"Second, a scenario 2 in one direction followed by a 2 in the opposite direction"

"Third, Scenario 2 fails and goes scenario 3. An outside bar."

"4, Scenario 3 occurring at a high or low followed by a 1, then a 2 back into the previous range."

I see what y'all are talking about now. There's actually more than three scenarios. In reality, there are 6: each candle is either a 1U, 1D, 2U, 2D, 3U, 3D.

BACK TO THE DRAWING BOARD
 
Plus four timeframes, varying depending on trade style... And whatever else... Haven't had a chance to fully absorb Rob Smiths strategy yet as I keep getting interrupted...
 
Plus four timeframes, varying depending on trade style... And whatever else... Haven't had a chance to fully absorb Rob Smiths strategy yet as I keep getting interrupted...
Right. I'm not there yet with this first iteration. To begin with, I just want to code for the scenarios and the four basic reversals. I think I have a grasp on the logic for the scenarios. The more I think about it though, the more I think it HAS TO have a >= or <= but it also has to take both possibilities into account. And it's imperative to define first a onebar, twobar, threebar and then an upbar, downbar and then and ONLY THEN can you actually define the three basic scenarios and their corresponding direction. As far as I can conceptualize this should be the logic for the now SIX scenarios:


def insidebar = high <= high[1] and low >= low[1];
def outsidebar = high > high[1] and low < low[1];

def insidebarup = insidebar and open <= close;
def twoup = high > high[1] and low >= low[1];
def outsidebarup = outsidebar and open <= close;
def insidebardown = insidebar and open >= close;
def twodown = high <= high[1] and low < low[1];
def outsidebardown = outsidebar and open >= close;

This blows my definition of the four basic reversals completely out of the water. I was waaaaaay oversimplifying that. I'll keep on it, but for now, I'm going to figure out a way to plot these that makes sense.
 
Last edited:
Okay, I've changed the logic and added a pivot_high, pivot_low component for the 3-1-2. I have made all the changes in the code and logic be reflected in edits to my previous posts. The top thread has the most recent code and indicator link. I welcome any and all CONSTRUCTIVE criticism. Remember, as I mentioned originally, this is just the first draft (well, second now, really). I want to be able to visually depict the scenarios and four basic reversals correctly before I move onto more complex scenarios like rev strat or hammers or shooting stars. Just saying I'm wrong and adding absolutely no value whatsoever except to tell me to go study some more is useless. If you want to tell me I'm wrong, fine. Tell me how to fix it, or at the very least, tell me where exactly you think I'm wrong. Be specific.
 
Hello, first thank you for attempting this project. I believe this code is incorrect:

def insidebar = high <= high[1] and low >= low[1];

and should be:
def insidebar = high < high[1] and low > low[1];
 
Hello, first thank you for attempting this project. I believe this code is incorrect:

def insidebar = high <= high[1] and low >= low[1];

and should be:
def insidebar = high < high[1] and low > low[1];
I agree. However, you see a lot of instances (especially after-hours) where the price is exactly equal on one side or the other. How would you take those into account?
 
Hello, first thank you for attempting this project. I believe this code is incorrect:

def insidebar = high <= high[1] and low >= low[1];

and should be:
def insidebar = high < high[1] and low > low[1];
How about this? This reflects a bar that doesn't "take out" the high or the low of the previous range (to use Rob's words), but it also allows for the possibility that one side or the other might be equal:

(high < high[1] and low == low[1]) or (high == high[1] and low > low[1]);
 
Last edited:

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
413 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