Request for Three Line Break CHARTS OR INDICATOR DEVELOPMENT

Y

ykd2018x

Member
VIP
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

reds
yogesh
 
Last edited by a moderator:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
I found this one. Hope it's what you're looking for.

Code:
# THREELINEBREAK
# DREWGRIFFITH15 (C) 2014
# Found in https://github.com/hwrdprkns/ThinkOrSwim/blob/master/ThreeLineBreakSTUDY.ts

## NOT IN PRODUCTION ##

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 );
P.Hide();
 

Top