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

So does anyone have a working scan that scans for inside bars on the hourly? My scan returns a bunch of stocks that are not inside bars on the hourly but if I set it to 30 minutes it seems to return accurate stocks? As you can see from the image below my scan setup up returns adbe, which the chart shows the closest inside bar 6 bars away. I've confirmed both extended hours are disabled in scan and chart. I feel like potentially the scan hour starts differently from the chart hour? Or does anyone else have ideas? I am new to coding in think script so could be an issue there but as I said earlier, other time frames seem to produce correct scans.
 
Like I said "Just load higher time frame charts to compare, it will show you that your FTFC code shows incorrect signals." You'll see it. Right now TSLA and SPY in the last hour of trading are good examples. Intraday labels showing the wrong 2 direction and color.
Without screenshots we can't really see anything because the labels show after market hours results too, we can't really tell what is wrong without screenshot explaining it. When I load TSLA with code above and I check higher timeframe, the labels are correct. So does the FTFC.

I don't exactly know what you're referring to thats wrong, my ONLY guess what you could be misunderstanding is how the labels on top work and how the TFC in the lower part works because I kind of mixed it up too.

For example: The labels on top represent the colors of the specific label specified just like the color candles. For example I could say: SPY on the monthly on the top label it shows a 2U with the COLOR being green... but on the TFC in the lower shows RED. If thats what you mean, the reason the TOP one is GREEN is because the CODE FOR A 2U is set to green....... it doesn't necessarily mean that the monthly candle is green, it means its following the 2U pattern, which is a bullish continuation pattern. The TFC at the lower part of the chartshows you the actual CANDLESTICK COLOR on that specific timeframe and the price that is shown in its box is the price where it will switch from RED to GREEN or GREEN to RED.

However the labels on TOP ONLY show the color specified for that specific pattern/number. Hope this is clear.


It is entirely possible that some of the issues being experienced by members are not the fault of the strats themselves but, rather, lag in watchlists... Watchlists are lower on the totem pole with regard to refreshing than charts... Not to mention the number of watchlist cells that need to be calculated... Toss in a bunch of charts with multiple studies and strategies and you're just adding more onto Thinkorswims workload... It all contributes to lag... Just some food for thought... ;)


As for watchlist columns, yes this is laggy. Sometimes they don't update till minutes later, this depends on your connection and also TOS' connection to servers, I've found it to be random. Sometimes it updates instantly other times it takes its sweet time.
 
So does anyone have a working scan that scans for inside bars on the hourly? My scan returns a bunch of stocks that are not inside bars on the hourly but if I set it to 30 minutes it seems to return accurate stocks? As you can see from the image below my scan setup up returns adbe, which the chart shows the closest inside bar 6 bars away. I've confirmed both extended hours are disabled in scan and chart. I feel like potentially the scan hour starts differently from the chart hour? Or does anyone else have ideas? I am new to coding in think script so could be an issue there but as I said earlier, other time frames seem to produce correct scans.



This video should clear that up for you. I used this to setup individual candle stick patterns I wanted based on 1-2-3 so when I need to scan for example "1" I can do that.
 
A great post @Pelonsax and other wise men/women who have contributed to this. Watched many videos of Rob Smith to get a grasp of the strategy, mainly looked for the actionable signals. Scratched my head for first few videos to understand what he was saying :cry:.

I came across the following which may help other newbies trying to understand this strategy/methodology. @Pelonsax please confirm if it makes sense. I am sure there are many more combinations, but these would give some basic idea.

What the 1, 2 or 3s stand for.
  • If the current bars High or Low is equal OR does not exceed the previous bar's High OR Low, it will be a "1" (Inside Bar)
  • If a candle exceeds the High OR the Low of the previous bar BUT not both, it will be a "2" (Note, equal to prev H/L does not count as exceeds)
  • If a candle exceeds both the High and the Low of the previous bar it will be a "3" (Outside Bar)

What the U, D or Up, Dn stand for.
  • If bar scores a "2" as stated above, then also we need to determine if it is a "2Up" or "2Dn"
  • 2Up or 2U = Any bar that scores a 2 AND makes a Higher High than the prev bar
  • 2Dn or 2D = Any bar that scores a 2 AND makes a Lower Low than the prev bar

Some multibars (combination of more than one scenario)
2Up/1/2Up = "Bullish Continuation Condition"
2Dn/1/2Dn = "Bearish Continuation Condition"
2Up/2Dn = "2 Bar Bearish Reversal Condition"
2Dn/2Up = "2 Bar Bullish Reversal Condition"
1/2Up/2Dn = "3 Bar Bearish Reversal Condition"
1/2Dn/2Up = "3 Bar Bullish Reversal Condition"

The above scenarios should always be analysed by looking at multiple time-frames. The ideal situation occurs when all time frames (for ex: Year,Month, Week, Day) point in the same direction, which is known as Full Time Frame Continuity.

I will now go and read this thread all over again. :)
 
Last edited:
So does anyone have a working scan that scans for inside bars on the hourly? My scan returns a bunch of stocks that are not inside bars on the hourly but if I set it to 30 minutes it seems to return accurate stocks? As you can see from the image below my scan setup up returns adbe, which the chart shows the closest inside bar 6 bars away. I've confirmed both extended hours are disabled in scan and chart. I feel like potentially the scan hour starts differently from the chart hour? Or does anyone else have ideas? I am new to coding in think script so could be an issue there but as I said earlier, other time frames seem to produce correct scans.

This video should clear that up for you. I used this to setup individual candle stick patterns I wanted based on 1-2-3 so when I need to scan for example "1" I can do that.


For anyone having the issue I had, this video is a great way to set up the scan but you will still sometimes find incorrect returns unless you disable "start aggregations at market open" in the equities tab on chart settings. This fixed it for me.
 
Could someone please help on back testing the ThreeBull, ThreeBear strategy by adding the required code to backtest in TOS? Would really appreciate it - thanks again for the great work!
 
@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.

@shizah Regarding those combinations that you listed before (2-1-2, 3-1-2, 2-2-2, 2-3-2, 2-1-3, 1-3-2), does 1-3-2 mean reversal? If last 2 is up, next candle could mean a down one? I'm trying to understand the basics and any help is appreciated.
Thank you.
 
I added code to the top post for expanded STRAT bar watchlist columns that now show the current bar (in brackets) on each time frame and the last two bars before that. They are color coded to include reversals. Here's what they look like. Other than cyan or magenta for reversals, the color is based on the current bar.
JXfTMz6.png
 
I added code to the top post for expanded STRAT bar watchlist columns that now show the current bar (in brackets) on each time frame and the last two bars before that. They are color coded to include reversals. Here's what they look like. Other than cyan or magenta for reversals, the color is based on the current bar.
JXfTMz6.png

Thank you @Pelonsax for chart, it's very useful. Do you have it for 1 min too? I assume candles work the same in general. There are some that come up often as 1U-3-2D or 1D-3-2U or 1D-3-2D; normally I follow the last bar and consider 3 itself as reversal more of the time. It's a great indicator!
Appreciate sharing it.
 
Thank you @Pelonsax for chart, it's very useful. Do you have it for 1 min too? I assume candles work the same in general. There are some that come up often as 1U-3-2D or 1D-3-2U or 1D-3-2D; normally I follow the last bar and consider 3 itself as reversal more of the time. It's a great indicator!
Appreciate sharing it.
It's the same exact code for the one minute. The only thing that changes on the watchlist column is how you set the aggregation of that column so if you copy and paste the code and set it to 1 min, you get what you're looking for.
 
Do the arrows only show in direction of TFC? I see it on 1minute when I open your "ALL IN 1 STYLE" where everything is loaded on a single chart but when I switch to like 5minutes, the arrows disappear? Is it only meant to work on 1minute charts?
 
Do the arrows only show in direction of TFC? I see it on 1minute when I open your "ALL IN 1 STYLE" where everything is loaded on a single chart but when I switch to like 5minutes, the arrows disappear? Is it only meant to work on 1minute charts?
Yeah for now it does. I assume you're talking about the Time Frame Continuity Study that paints the highest open cyan and the lowest open magenta. That has gray arrows that show up when there is FTFC. The intraday study is set to 1m, 5m, 15m, 30, and 60m. So if you're on anything higher than the one minute, it won't show up. However, I just posted a study that draws the opens and paints a bubble that is either red green or white. That study works on all time frames and any chart. I can make the other study work the same way if you'd like, it's just that these are getting to the point where they start to slow down the machine. The alternative would be to recode that study to start on 5m instead of 1 and then at least it would work on any chart that is set between 1m and 5m. Let me know what you think.
 
I have added a tutorial video at the very top of the first post that illustrates how to set these studies up
 
I added another video tutorial for how to set up the watchlist columns. BTW if you like Jazz, check out some of the other videos on my page. I play tenor sax.
 

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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