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

Hey guys any one know how to fix this code
im trying to make a scan for

1) 2down-green that the high is equal to 50% previous bar (3 green)
2) and low is 2% below previous bar (3 green)

Three_Bar_green (1)
Two_down_Green()High = 50% of last bar and low is 2% below las bar low
 
Last edited:

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

Oh wow...I absolutely LOVE this. I'm going to play with this a bunch. I might add some Strat candle combos to the bubble if thats ok. cool stuff!
 
i didn't look through all the pages, so not sure if this exists.

i made a study to display arrows after the last bar , to represent higher time frames.
https://usethinkscript.com/threads/mtf-arrows-choose-1-of-3-sets-of-5-periods.8959/
Tutorials
MTF Arrows: choose 1 of 3 sets, of 5 periods
Good job, works great. However any chance of cutting it down to just the arrows and the time label/box only? Would like it without the two yellow "current_bar and Agg set bar." I cut out the yellow bubble code but the label code I am not to sure about.
 
Is this right?

im trying to make a scan for

1) 2down-green that the high is equal to 50% previous bar (3 green)
2) and low is 2% below previous bar (3 green)

#
Three_Bar_green (1)
Two_down_Green[0]
and
High [0]= hl/2 [1]
and
low [0] >= * .02 [1]
#
 
Another request, I am trying to make an alert with the Strat study that will message and Bell alert me when the last candle closes as a number one (inside) candle. Here is the code I am messing with with and having no luck:
# Alert
Plot Priorinsidebar = (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]);

Alert = (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]);

When I add the Bell and AlertBar function at the end of the Alert line it flags the whole line red and with just the above text it only flags the "Alert" red?
Any help would be greatly appreciated.
 
Another request, I am trying to make an alert with the Strat study that will message and Bell alert me when the last candle closes as a number one (inside) candle. Here is the code I am messing with with and having no luck:
# Alert
Plot Priorinsidebar = (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]);

Alert = (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]);

When I add the Bell and AlertBar function at the end of the Alert line it flags the whole line red and with just the above text it only flags the "Alert" red?
Any help would be greatly appreciated.
A noob question what dos the == do?
 
This is rather simple to accomplish in the ToS candlestick pattern editor. You can use the graphical interface and don't even need to know how to script. This is a basic inside bar search. you can also create 3-1 or 2-1 patterns. You then use the scanner and add the pattern as a search criteria.
Screen-Shot-2021-12-08-at-6-54-31-PM.png
I was able to set it up, but it wasn't one of more choices for personal scans from the stock hacker scan. How do I get it to my scanner? Again I am looking for inside bar days on a daily
 
Good job, works great. However any chance of cutting it down to just the arrows and the time label/box only? Would like it without the two yellow "current_bar and Agg set bar." I cut out the yellow bubble code but the label code I am not to sure about.
yes, that is possible, to not show some labels.
i have updated the study, to allow choosing stats and/or time labels.
https://usethinkscript.com/threads/mtf-arrows-choose-1-of-3-sets-of-5-periods.8959/

if you downloaded the updated study and dont want to experiment with the code, then stop reading.

----------------------------------------
if you want to experiment with some label code, read this

to keep some label code from showing a label,
. add a # in front of the code line, to disable it forever.
. change the 1st parameter in an addlabel( ), so it is a 0 or false value.
. add/change an input variable to the study and add/change it in the addlabel(). (what i did)

to disable the stats labels, find these code lines and add a # . code line numbers in () for ref, to make it easier to find them.
# AddLabel(show_labels, "-", Color.BLACK); (167)
# addlabel(show_labels, arrow_data, color.yellow); (168)
# addlabel(show_labels , " [" + off2 + "] ", color.yellow); (169)

# AddLabel(show_labels, "-", Color.BLACK); (201)
# AddLabel(show_labels, "Agg set: " + mtf_time_group, Color.YELLOW ); (202)


or change the addlabel() 1st parameter variable, to control them separately from other labels,
input show_stats = no;
AddLabel(show_stats, "-", Color.BLACK); (167)
addlabel(show_stats, arrow_data, color.yellow); (168)
addlabel(show_stats , " [" + off2 + "] ", color.yellow); (169)

AddLabel(show_stats, "-", Color.BLACK); (201)
AddLabel(show_stats, "Agg set: " + mtf_time_group, Color.YELLOW ); (202)
 
Is this right?

im trying to make a scan for

1) 2down-green that the high is equal to 50% previous bar (3 green)
2) and low is 2% below previous bar (3 green)

#
Three_Bar_green (1)
Two_down_Green[0]
and
High [0]= hl/2 [1]
and
low [0] >= * .02 [1]
#

Did ypu have any luck creating the scan? This idea is great.
 
yes, that is possible, to not show some labels.
i have updated the study, to allow choosing stats and/or time labels.
https://usethinkscript.com/threads/mtf-arrows-choose-1-of-3-sets-of-5-periods.8959/

if you downloaded the updated study and dont want to experiment with the code, then stop reading.

----------------------------------------
if you want to experiment with some label code, read this

to keep some label code from showing a label,
. add a # in front of the code line, to disable it forever.
. change the 1st parameter in an addlabel( ), so it is a 0 or false value.
. add/change an input variable to the study and add/change it in the addlabel(). (what i did)

to disable the stats labels, find these code lines and add a # . code line numbers in () for ref, to make it easier to find them.
# AddLabel(show_labels, "-", Color.BLACK); (167)
# addlabel(show_labels, arrow_data, color.yellow); (168)
# addlabel(show_labels , " [" + off2 + "] ", color.yellow); (169)

# AddLabel(show_labels, "-", Color.BLACK); (201)
# AddLabel(show_labels, "Agg set: " + mtf_time_group, Color.YELLOW ); (202)


or change the addlabel() 1st parameter variable, to control them separately from other labels,
input show_stats = no;
AddLabel(show_stats, "-", Color.BLACK); (167)
addlabel(show_stats, arrow_data, color.yellow); (168)
addlabel(show_stats , " [" + off2 + "] ", color.yellow); (169)

AddLabel(show_stats, "-", Color.BLACK); (201)
AddLabel(show_stats, "Agg set: " + mtf_time_group, Color.YELLOW ); (202)
Thanks a bunch halcyonguy, numbering them really helped also!
 
Did ypu have any luck creating the scan? This idea is great.
somewhat i cant figure out the % part. if you run the first part and just look at the chart you can get nice potential


high[0] < hl2 [1]
and
low [0]* 1.02 < low [1]
and
green_candle ()[0]
and
three_OutsideBar () [1]
 
Last edited:
The Pre-Loaded chart set-up - Pre-Loaded intraday chart: https://tos.mx/q7Bfm3J (Now complete with TFC study!) - won't load the candles??? The volume bars show but nothing shows on the price chart??? Any ideas?

Thanks. Joe
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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