Market Breadth Tick Internals Indicator for ThinkorSwim

J007RMC

Well-known member
2019 Donor
VIP
Found this thinkscript cloud I think

Code:
# based one
# TheoTrade_Comparative_QuanTicks
# Mobius Dev
# Copyright TheoTrade LLC
# added DJIA

declare lower;

input closeTime = 1555;
input labelOffset = 5;
input showFloatingLabels = yes;
defineglobalColor("NYSE", color.gray);
defineglobalColor("SNP", color.green);
defineglobalColor("NASDAQ", color.blue);
defineglobalColor("DJIA", color.red);
defineglobalColor("Russell", color.orange);
def openTime = 0930;
def rawTickData1 = hlc3("$TICKC"); #NYSE
def rawTickData2 = hlc3("$TIKSP"); #SPY
def rawTickData3 = hlc3("$TICK/Q"); #NASDAQ
def rawTickData4 = hlc3("$TIKI");  # DJIA
def rawTickData5 = hlc3("$TIKRL"); #russel

def maxTick1 = close("$ADVNC") + close("$DECNC") + close("$UNCNC");
def maxTick2 =  close("$ADVSP") + close("$DECLSP") + close("$UNCHSP");
def maxTick3 =  close("$ADVN/Q") + close("$DECN/Q") + close("$UNCN/Q");
def maxTick4 =  close("$ADVI") + close("$DECLI") + close("$UNCHI");
def maxTick5 = close("$ADVRL") + close("$DECLRL") + close("$UNCHRL");
def TickData1 = rawTickData1 / maxTick1;
def TickData2 = rawTickData2 / maxTick2;
def TickData3 = rawTickData3 / maxTick3;
def TickData4 = rawTickData4 / maxTick4;
def TickData5 = rawTickData5 / maxTick5;

def newday= GetDay() != GetDay()[1];
def RTH= SecondsTillTime(openTime) <= 0 and  SecondsTillTime(closeTime) >= 0 ;
#cumulative ticks
def CT1 = if !newday then CT1[1] + TickData1  else 0;
plot cumulativeTick1 = if !IsNaN(TickData1) and  CT1 <> 0 then CT1  else Double.NaN;

def CT2 = if !newday then CT2[1] + TickData2  else 0;
plot cumulativeTick2 = if !IsNaN(TickData2) and  CT2 <> 0 then CT2 else Double.NaN;

def CT3 = if !newday then CT3[1] + TickData3  else 0;
plot cumulativeTick3 = if !IsNaN(TickData3) and  CT3 <> 0 then CT3  else Double.NaN;

def CT4 = if !newday then CT4[1] + TickData4  else 0;
plot cumulativeTick4 = if !IsNaN(TickData4) and  CT4 <> 0 then CT4  else Double.NaN;

def CT5 = if !newday then CT5[1] + TickData5  else 0;
plot cumulativeTick5 = if !IsNaN(TickData5) and  CT5 <> 0 then CT5  else Double.NaN;


plot CT1DownTick = if cumulativeTick1 < cumulativeTick1[1]
                   then cumulativeTick1
                   else Double.NaN;
CT1DownTick.SetPaintingStrategy(PaintingStrategy.Points);
CT1DownTick.SetDefaultColor( color.dark_gray);
CT1DownTick.SetLineWeight(1);
CT1DownTick.HideBubble();
plot CT2DownTick = if cumulativeTick2 < cumulativeTick2[1]
                   then cumulativeTick2
                   else Double.NaN;
CT2DownTick.SetPaintingStrategy(PaintingStrategy.Points);
CT2DownTick.SetDefaultColor( color.dark_gray);
CT2DownTick.SetLineWeight(1);
CT2DownTick.HideBubble();
plot CT3DownTick = if cumulativeTick3 < cumulativeTick3[1]
                   then cumulativeTick3
                   else Double.NaN;
CT3DownTick.SetPaintingStrategy(PaintingStrategy.Points);
CT3DownTick.SetDefaultColor( color.dark_gray);
CT3DownTick.SetLineWeight(1);
CT3DownTick.HideBubble();
 
plot CT4DownTick = if cumulativeTick4 < cumulativeTick4[1]
                   then cumulativeTick4
                   else Double.NaN;
CT4DownTick.SetPaintingStrategy(PaintingStrategy.Points);
CT4DownTick.SetDefaultColor( color.dark_gray);
CT4DownTick.SetLineWeight(1);
CT4DownTick.HideBubble();

plot CT5DownTick = if cumulativeTick5 < cumulativeTick5[1]
                   then cumulativeTick5
                   else Double.NaN;
CT5DownTick.SetPaintingStrategy(PaintingStrategy.Points);
CT5DownTick.SetDefaultColor( color.dark_gray);
CT5DownTick.SetLineWeight(1);
CT5DownTick.HideBubble();


#colors
cumulativeTick1.SetDefaultColor(GlobalColor("NYSE")); #NYSE
cumulativeTick1.SetLineWeight(2);
cumulativeTick2.SetDefaultColor(GlobalColor("SNP")); #SP500
cumulativeTick2.SetLineWeight(2);
cumulativeTick3.SetDefaultColor(GlobalColor("NASDAQ")); # NASDAQ
cumulativeTick3.SetLineWeight(2);
cumulativeTick4.SetDefaultColor(GlobalColor("DJIA")); # DJIA
cumulativeTick4.SetLineWeight(2);
cumulativeTick5.SetDefaultColor(GlobalColor("Russell")); #  Russel
cumulativeTick5.SetLineWeight(2);
cumulativeTick1.HideBubble(); cumulativeTick2.HideBubble();
cumulativeTick3.HideBubble(); cumulativeTick4.HideBubble();  cumulativeTick5.HideBubble();
plot allUp = if cumulativeTick1 > cumulativeTick1[1] and
                cumulativeTick2 > cumulativeTick2[1] and
                cumulativeTick3 > cumulativeTick3[1] and
                cumulativeTick4 > cumulativeTick4[1] and
                cumulativeTick5 > cumulativeTick5[1]
             then 0
             else Double.NaN;
allUp.SetPaintingStrategy(PaintingStrategy.LINE_VS_TRIANGLES);
allUp.SetDefaultColor(Color.green);
allUp.setLineWeight(5);
allup.HideBubble();
plot allDown = if cumulativeTick1 < cumulativeTick1[1] and
                  cumulativeTick2 < cumulativeTick2[1] and
                  cumulativeTick3 < cumulativeTick3[1] and
                  cumulativeTick4 < cumulativeTick4[1] and
                  cumulativeTick5 < cumulativeTick5[1]
               then 0
               else Double.NaN;
allDown.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
allDown.SetDefaultColor(Color.red);
allDown.SetLineWeight(5);
allDown.HideBubble();
plot zero = if isNaN(close) then double.nan else 0;
zero.SetDefaultColor(Color.dark_gray);
zero.HideBubble();
zero.HideTitle();
AddVerticalLine(SecondsTillTime(openTime) == 0 or (GetDay() != GetDay()[1] and (SecondsTillTime(0000) > 0)), "", Color.GRAY, 1);
#AddLabel(!showFloatingLabels, "SP500", Color.dark_green);
#AddLabel(!showFloatingLabels, "NYSE", Color.Black);
#AddLabel(!showFloatingLabels, "NASDAQ", Color.BLUE);
#AddLabel(!showFloatingLabels, "DJIA", Color.dark_red);
#AddLabel(!showFloatingLabels, "R2000", Color.orange);
AddChartBubble(
IsNaN(close[labelOffset - 1]) and !IsNaN(close[labelOffset]) and showFloatingLabels, cumulativeTick1[labelOffset], "NYSE",GlobalColor("NYSE"), yes);
AddChartBubble(IsNaN(close[labelOffset - 1]) and !IsNaN(close[labelOffset]) and showFloatingLabels, cumulativeTick2[labelOffset], "SNP", GlobalColor("SNP"), yes);
AddChartBubble(IsNaN(close[labelOffset - 1]) and !IsNaN(close[labelOffset]) and showFloatingLabels, cumulativeTick3[labelOffset], "nasdaq", GlobalColor("NASDAQ"), yes);
AddChartBubble(IsNaN(close[labelOffset - 1]) and !IsNaN(close[labelOffset]) and showFloatingLabels, cumulativeTick3[labelOffset], "DJIA",GlobalColor("DJIA"), yes);
AddChartBubble(IsNaN(close[labelOffset - 1]) and !IsNaN(close[labelOffset]) and showFloatingLabels, cumulativeTick5[labelOffset], "R2000",GlobalColor("Russell"), yes);

# End Code TheoTrade QuanTicks

https://tos.mx/QnhWBd6
 

markos

Well-known member
VIP
Yes, my understanding is that Mobius released it after a obligatory holding period. :)
 
Last edited:

Trading51

Active member
2019 Donor
Does anyone have a clear understanding of what each line is representing or what it means above or below the zero level ?
 

Similar threads

Top