Triple 3 Inside Bars Indicator and Scanner for ThinkorSwim

Is it because that trigger bar is not yet visible? It should still show though. I should be able to see that it is a possible 4-bar play. I have the "potential" set to "Yes".

You're right. It's currently coded to detect the pattern only once the trigger bar has started. Now that you mention it, I will try to update it so potential pattern candidates are also detected during the "pause" bars. That makes sense. Should be pretty easy. I'll also look into that PYPL setup you mentioned. Hopefully there is a bug I can fix that will get us more results.
 
Ok figured it out. The reason PYPL didn't indicate at opening is because the trigger bar low dipped below the pause bar low. Strictly speaking, that broke the rules of the official 3 bar play. It's supposed to stay above it at all times.

But since this is customizable, I just updated my code above to version 1.4, which has the new option for the trigger bar to have the same min low as the pause bars min low (as opposed to the pause bars actual low). It also now shows the "potential" indicator on pause bars that meet criteria for potential setup, not just on the trigger bar.
 
@Stocksdfb
The 3 bars in that image don't look quite like a 3 bar play. The first bar is too short relative to the middle one. Here's a screenshot from the Live Traders video, mentioned above, with a summary:
a4p8upnl.jpg
 
Play with price, and time frame...concerns in quality of symbol, whether it has momentum and volume. https://tos.mx/CTjpAOk
These scans are open to interpretation,..but the pattern was produced on smaller time frames which I suspect "jared," trades.
 
Last edited by a moderator:
@Len20 thanks for updating the script. I played with it quite a bit yesterday. I added a few things like a yellow highlight for igniting bars but my code is not clean so I'll share later if you are interested. Still some igniting bars being detected where they shouldn't but that's just refining the parameters possibly.

I also added price bubbles that show the entry price and stop price once there is a potential play so that I can see right away my entry and stop prices (because maths...). I also want to add a line or bubble for profit exit price that can be added in the inputs like 1.5R or 2R, etc.


If still interested in improving this script further, a few suggestions:
  • To add a layer of proper detection for the igniting bar (still seems to detect incorrect bars), maybe looking at the number of green bars withing the last x bars or the ratio of green to red bars, or if the wick is really big), something like that (would need to think about this more).
  • Add a function that would look back for the pivots and resistance on a larger timescale (if I understand right now it's only '14', so it would be 14 minutes on the minute chart, not quite right I think) before marking the igniting bar, for example lookback 5-10 days or something like that.
  • Alternatively, use some sort of pivot study to detect the last 3 support and resistance on daily time scale for example (not sure what would be the best).
  • Add price bubbles for entry, stop and target (as we could know what they should be from the price data and pre-defined strategies)
  • Add a label or bubble or some sort of text that would show the calculated lot size for a defined amount set as an input for max loss (i.e. $10, $100). That would be calculated with the entry-stop amount.
  • Add an option to flash the background some color when an igniting bar or a potential 3-bar play is detected live, that way it's super visible when watching live in the morning on a large watchlist.
  • Would be great to have an option to hide all the past 3-bar plays or igniting bars that did not form a 3-bar play as this is really for real time detection not to look back in the past (not really important but could help keep the plots clean).


anyway, some thoughts....
 
@perig could you guide me in the right direction..which script version are you using? I have applied all 3 versions but wasn't able to generate arrow (potential or confirmed) in the indicators
 
@perig could you guide me in the right direction..which script version are you using? I have applied all 3 versions but wasn't able to generate arrow (potential or confirmed) in the indicators

I am using v1.4 as the base code. I modified the script to get it to work for me and added different colors, etc.. I think if you just want to show some patterns, set the parameters as loose as you can to over-dectect and then you can change them as you prefer to detect only the ones you want. I think the script can still be refined, especially for the igniting bar detection as it is all centered around that. Detecting potential 3-bar play is then quite simple. See my suggestions in my previous post for the improvements. Either I can get to it or the OP may still continue development.

Here is what you can try:
  • Show_Only_Above_Prev_High = no
  • Hide_During_Uptrend = no
  • pause_Low_Min_Perc = 40
  • pause_High_Min_Perc = 80
  • pause_High_max_Perc = 110
 
Drop to 5 Minute, I have volume on 100K, but a momentum filter for good stocks....I have em all day as long as scan is for 5 minutes....
 
@perig thanks for taking the time to respond & educate me. I am not good in coding at all. I copy pasted the 1st script/indicator from post #8 by Len20 (it reads version 1.4) and applied your settings.

@Thomas you mean to run this indicator at 5m chart instead of 1m? How did you set volume 100k? I couldn't find that section in settings. Or is this setting that you have mentioned above for the scan (2nd script) from post #8 as well?
 
@perig thanks for taking the time to respond & educate me. I am not good in coding at all. I copy pasted the 1st script/indicator from post #8 by Len20 (it reads version 1.4) and applied your settings.

@Thomas you mean to run this indicator at 5m chart instead of 1m? How did you set volume 100k? I couldn't find that section in settings. Or is this setting that you have mentioned above for the scan (2nd script) from post #8 as well?
Copy > TOS MAIN CHART> paste=set up>opened shared item... https://tos.mx/4zt7A6W
 
Updated my indicator above (HERE) to v1.5
"Show potential" now includes ignitor bar. Can now color bars. Background color change on signals. Pattern will signal when forming live, disappears if it fails. Uptrend detection lookback now won't overlap pre-market, reg hours, or afterhours time zones. Recoded some logic. Other fixes, tweaks.

@perig Great improvement ideas. I put a few into this update and made some other changes. It's unfortunately beyond my ability to incorporate pivot points and resistance, but I welcome anyone to modify and upgrade my code. The other ideas are great, but I'm probably gonna take a break from updating this for a while. I'm no pro so it's been mentally draining to code lol, but it was worth it and I'm pretty happy with it right now with v1.5. But if you see any bugs or it missed setups it should have signalled, please mention it and I'll try to fix it.
 
Last edited:
@Len20 could you expound on how to implement the code you posted. I am pretty sure I got the charts one setup as a study and it is showing so that is good. However, when I put the code into the Scan->Stock Hacker->Study->Custom->Paste your code. I get "Error script execution timeout". Maybe I am putting it in the wrong place? New to thinkscript. Sorry
 
It sounds like your're doing it right. I just tested it again and it worked fine for me. After you click on "Custom", click on the tab "Thinkscript Editor" and delete the default line of code. Then paste in there. Be sure to set the aggregation period that you want also. Another idea is maybe a copy/paste error missed some lines of code?
 
That was the issue. My aggregation period was set to default. did not work. I changed it to 10m and it worked. What aggregation do you suggest for optimal performance of this filter?

Edit: 5 minutes seems to work, also a Volume filter of 100k.. thanks Thomas.
Thanks Len for this awesome script, cant wait to mess around with it!
 
Last edited:
@Len20 this new version is great, so many new adjustments! Good job. I will play with it more and i'll feedback what I find out.

@BatmansKid I was able to get the scan to work and see some igniting bars for 3BP on all sorts of timescales. I like the 1D view as it is a slower moving trading scale but I was able to get results at other time scales as well.
 
Will this work with a Tick chart?

I tried on a chart set for tick and I can see the signals. However I don't think there is a tick setting for the scan, I only see time options (which I believe is from TOS, not this script specifically).
 
Great Study, I've been looking for this setup. Is there a way to change the color of the bars easily, and is there also a study or scan for the Bearish side? Thanks
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
580 Online
Create Post

Similar threads

Similar threads

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