2019 Donor
hello friends

recently i have been looking at THREE LINE BREAK CHARTS at some software and found its a very good way to look at price movments specially for trading breakouts and breakdowns in the markets.

In TOS this option of charting is not available , wonder is anyone is interested to develop an indicator which can change normal candle stick chart to TLB CHART.

For reference how TLB is calculated and made pls click to the link below
Full details for TLB is mentioned in the link. Happy trading & thanks in advance if anyone shows interest

Last edited by a moderator:
I found this one. Hope it's what you're looking for.

# Found in


def FirstLineHigh = if close[2] > close[3] then close[2] else close[3];

def FirstLineLow = if close[2] < close[3] then close[2] else close[3];

def SecondLineHigh = if close[1] > FirstLineHigh then close[1] # new high
                     else FirstLineHigh; # stays the same

def SecondLineLow = if close[1] < FirstLineLow then close[1] # new low
                    else FirstLineLow; # stays the same

def ThirdLineHigh = if close[0] > max(FirstLineHigh,SecondLineHigh) then close[0] # new high
                    else if close[0] < min(FirstLineLow,SecondLineLow) then SecondLineHigh # prev high becomes low
                    else SecondLineHigh; # stays the same

def ThirdLineLow = if close[0] < min(FirstLineLow,SecondLineLow) then close[0] # new low
                   else if close[0] > max(FirstLineHigh,SecondLineHigh) then SecondLineLow # prev low becomes high
                   else SecondLineLow; # stays the same

def tlbH = if ThirdLineHigh > max(ThirdLineHigh[1],ThirdLineHigh[2]) then ThirdLineHigh
           else ThirdLineHigh[1];

def tblL = if ThirdLineLow < min(ThirdLineLow[1],ThirdLineLow[2]) then ThirdLineLow
           else ThirdLineLow[1];

def isWhite = if ThirdLineHigh > max(ThirdLineHigh[1],ThirdLineHigh[2]) then yes
             else if ThirdLineLow < min(ThirdLineLow[1],ThirdLineLow[2]) then no
             else isWhite[1];

DefineGlobalColor( "3LBH", Color.WHITE );
DefineGlobalColor( "3LBL", Color.DARK_RED );
plot TLB_High = tlbH;
TLB_High.SetPaintingStrategy( PaintingStrategy.BOOLEAN_POINTS );
TLB_High.AssignValueColor( if isWhite then GlobalColor("3LBH") else GlobalColor("3LBL"));
plot TLB_Low = tblL;
TLB_Low.SetPaintingStrategy( PaintingStrategy.BOOLEAN_POINTS );
TLB_Low.AssignValueColor( if isWhite then GlobalColor("3LBH") else GlobalColor("3LBL"));
#AddCloud( TLB_High, TLB_Low, color1 = Color.WHITE, COLOR2 = COLOR.RED );
plot P = close;
P.SetPaintingStrategy( PaintingStrategy.POINTS );
Hi - is there a line break chart bar type available for thinkorswim? I see indicators on the forum but wasn't sure if anyone has created an actual bar type.
Here is what ThinkorSwim currently offer:

Hi Ben - is there a way to add a user input that customizes the number for line breaks i.e. 4 or 5 line break instead of 3? Also, there a way to set a scan for when the break happens (from high break to a low break)?
Here is a TradingView Three Line Strike Indicator if anyone is interested in converting it to TOS.

// This source code is subject to the terms of the Mozilla Public License 2.0 at
// © KewlTradez (Free to Use)

indicator(title='Kewl Strike', shorttitle='KS', overlay=true)

// Inputs
bear = input.bool(title='Bearish Three Line Strike', defval=true, group='Three Line Strike', tooltip="The Bearish Three Line Strike candlestick pattern has Three Bullish green candles followed by a Bearish engulfing candle. Signals the possible end of a retracement as part of a trend continuation strategy.\n\n")
bull = input.bool(title='Bullish Three Line Strike', defval=true, group='Three Line Strike', tooltip="The Bullish Three Line Strike candlestick pattern has Three Bearish red candles followed by a Bullish engulfing candle. Signals the possible end of a retracement as part of a trend continuation strategy.\n\n")

// Three Line Strike Condition
bearplot = close[3] > open[3] and close[2] > open[2] and close[1] > open[1] and close < open[1]
bullplot = close[3] < open[3] and close[2] < open[2] and close[1] < open[1] and close > open[1]

// Plots Three Line Strike Signals
plotshape(bull  ? bullplot : na, style=shape.arrowup, color=color.rgb(0, 255, 0, 0), location=location.belowbar, size=size.normal, text='Bull', title='Three Line Strike Bull')
plotshape(bear  ? bearplot : na, style=shape.arrowdown, color=color.rgb(255, 0, 0, 0), location=location.abovebar, size=size.normal, text='Bear', title='Three Line Strike Bear')

// Alert Conditions
alertcondition(bull, title='Bullish Three Line Strike', message='{{exchange}}:{{ticker}} {{interval}} - Bullish Three Line Strike')
alertcondition(bear, title='Bearish Three Line Strike', message='{{exchange}}:{{ticker}} {{interval}} - Bearish Three Line Strike')

// New Alert Conditions
if (bull and bullplot)
    m = '{{exchange}}:{{ticker}} {{interval}} - Bullish Three Line Strike'
    alert(message=m, freq=alert.freq_once_per_bar)
if (bear and bearplot)
    m = '{{exchange}}:{{ticker}} {{interval}} - Bearish Three Line Strike'
    alert(message=m, freq=alert.freq_once_per_bar)   

// End ###
Last edited:

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
351 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.