Three Bar Reversal Pattern and Indicator for ThinkorSwim

@spencepuppy You can find it under the Patterns list. It will plot up arrows on every morning doji star candlestick.

fXD5JWV.png
 
@LynnChen Try this:

Code:
# Generation time: 2020-08-05T22:36:03.729Z

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

PatternPlot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
PatternPlot.SetDefaultColor(GetColor(0));
Ben, can you add an alert to this please?
 
Does this make sense for 3 bar down (bearish) indicator?

Code:
# 3 Bar Down
def PatternPlotDown =
    IsUp[3] and
    IsUp[2] and
    IsUp[1] and
    IsDown[0] and
    low[1] > close[0];

plot arrowDown = arrows and PatternPlotDown;

arrowDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
arrowDown.SetDefaultColor(GetColor(0));
 
@arv06 Haven't checked but you can try to build it using the Candlestick Pattern Editor in TOS, much easier.
 
The three bar reversal pattern is a significant signal in technical analysis, often used by traders to identify potential trend reversals. It typically consists of three consecutive bars on a price chart, indicating a shift from a prevailing trend to a new direction. This pattern is characterized by the first bar representing the current trend, followed by a second bar indicating a potential reversal, and finally confirmed by the third bar, which typically closes beyond the high or low of the first bar, signaling a reversal. Traders often use this pattern to make informed decisions about entering or exiting positions in the market.
xgCSoNa.png

The setup looks for a few consecutive red candlesticks and the final bar being a green candle closing higher than previous bars.

Here is an example:

View attachment 4554

Below is the code to identify bullish trigger bar in the Three Bar Reversal pattern. It also comes with an alert system.

thinkScript Code

Rich (BB code):
# Three-Bar Reversal Indicator
# Found in the thinkScript Archive
# Alert added by WalkingBallista
# https://usethinkscript.com/d/187-three-bar-reversal-pattern-and-indicator-for-thinkorswim

def TBRup = close > open[1] and close[1] < close[2]  and close[2] < close[3] and close[3] < close[4];
plot bullish = if TBRup then high else Double.NaN;
bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
alert(bullish,"TBR Up", alert.Bar,sound.ding);

Shareable Link

https://tos.mx/pLfTyM

If you would like to look for bearish trigger bar in this pattern, you can insert the following code into that indicator.

Rich (BB code):
def TBRdown = close < open[1] and close[1] > close[2] and close[2] > close[3] and close[3] > close[4];
plot bearish = if TBRdown then low else Double.NaN;
bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
alert(bearish,"TBR Down", alert.Bar, sound.ding);

The script was posted on the thinkScript Lounge Archive. It did not mention who created the indicIf
Can this be tweaked to trigger a signal if it takes more than three candles to close over/under the first? Say, the third candle doesn't close above the first. Can it be tweaked to trigger on the first candle that does?
 

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
426 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