Fundamental Discrepancies aka JunkyTrannyCrash

wtf_dude

Active member
So this is something I've followed for years. When you have the market up or down you may or may have heard there are other stocks or indices you want to check to see if the market fundamentals or leading indicators support the move. Transports, high yield bonds, etc. This draft version just gives you the ability to choose labels that you want to see at a glance. It's got Junk bonds , transports, russell 2000, equal weight sp500, advance decline line change, CAT stock, crude oil, and copper to gold ratio for now. If there are any other support indicators you want labeled, let me know. Some of you may not understand why some of these are available. Either look it up or just turn the label off. This is called crash because when you see a bunch of red on an up day, you can be pretty sure there's gonna be a (fairly big) drop with the divergence. In bigger market dumps, it can really save your butt by signaling ahead of time.

Code:
#written JunkyTrannyCrash v1.0  by WTF_Dude
#leading indicators and discrepancy signals

declare upper;

def agg = AggregationPeriod.DAY;
#def currentTimeFrame = getAggregationPeriod();

input showJunk = yes; #show Junk label
input showTrans = yes; #show Trans label
input showEquals = yes; #show Equals label
input showRussell2000 = yes; #shows small caps move
input showAdvDec = yes; #show advance/decline line
input showCrude = yes; #show Crude label
input showCAT = yes; #show CAT as leading indicator
input showCopper_to_Gold = yes;
#CoppertoGold doesn't show an accurate percentage because its using futures. Just look for down or up to indicate future treasury rate moves.



def junkp = close("HYG");
def JPercentChg = 100 * (junkp / junkp[1] - 1);
def value = round(JPercentChg, 2);
AddLabel(  showJunk, "Junk: " + value + "%", if Junkp >= Junkp[1]
     then color.GREEN else color.RED );


def transp = close("IYT");
def TPercentChg = 100 * (transp / transp[1] - 1);
def value2 = round(TPercentChg, 2);
AddLabel(showTrans, "Trans: " + value2 + "%", if transp >= transp[1]
     then color.GREEN else color.RED );


def equalp = close("RSP");
def EPercentChg = 100 * (equalp / equalp [1] - 1);
def value3 = round(EPercentChg, 2);
AddLabel(showEquals, "Equal: " + value3 + "%", if equalp >= equalp[1]
     then color.GREEN else color.RED );


def small = close("IWM");
def RussPercentChange = 100 * (small / small[1] - 1);
def value8 = round(RussPercentChange, 2);
AddLabel(showRussell2000, "SmallCaps: " + value8 + "%", if RussPercentChange >= RussPercentChange[1]
     then color.GREEN else color.RED );



def level;
def Advances = close("$ADVN");
def Declines = close("$DECN");
def advnDecl = advnDecl[1] + if !IsNaN(Advances - Declines) then Advances - Declines else 0;
def ADDNfinal = 100 * (advnDecl / advnDecl[1] - 1);
def value4 = round(ADDNfinal, 2);
AddLabel( showADVDEC, "A/D Line: " + value4 + "%", if ADDNfinal >= ADDNfinal[1]
     then color.GREEN else color.RED );level = 0;




def crudep = close("/CL");
def cPercentChg = 100 * (crudep / crudep [1] - 1);
def value5 = round(cPercentChg, 2);
AddLabel( showCrude, "Crude: " + value5 + "%", if crudep >= crudep[1]
     then color.GREEN else color.rED );

def catmove = close("CAT");
def cATPercentChg = 100 * (catmove / catmove [1] - 1);
def value6 = round(cATPercentChg, 2);
AddLabel( showCAT, "CAT: " + value6 + "%", if CATMOVE >= CATMOVE[1]
     then color.GREEN else color.rED );



def Copper = close("/HG");
def Gold = close("/GC");

def cgr = cgr[1] + if !IsNaN(copper / gold) then copper / gold else 0;
def copgoldratio = 100 * (cgr / cgr[1] - 1);
def value7 = round(copgoldratio, 2);
AddLabel( showCopper_to_Gold, "Copper/Gold: " + value7 + "%", if copgoldratio >= copgoldratio[1]
     then color.GREEN else color.RED );
 
Last edited by a moderator:

MatthewA

Active member
This is really cool but I don't think logic plays a strong role in the todays markets... Remember British Airlines was unable to maintain or acquire new planes lost several planes due to negligence and had almost no flights due to the CCP sickness... AND the stock goes UP???
I am trying to work with things that indicate a strong trend or that the FED is supporting or relaxing some security...
What do you think are good fast arrow indicators? Like zero lag ?
Also I have to do something with this... A trend, momentum and cycle Trading System v3.0 (CSA) - useThinkScript
 

MatthewA

Active member
I would keep this on the 10 Year Yield TNX all the time... That and oil brother... I don't know enough to play with anything else.
 

wtf_dude

Active member
This is really cool but I don't think logic plays a strong role in the todays markets... Remember British Airlines was unable to maintain or acquire new planes lost several planes due to negligence and had almost no flights due to the CCP sickness... AND the stock goes UP???
I am trying to work with things that indicate a strong trend or that the FED is supporting or relaxing some security...
What do you think are good fast arrow indicators? Like zero lag ?
Also I have to do something with this... A trend, momentum and cycle Trading System v3.0 (CSA) - useThinkScript
This isn't really for trends, it's about looking at broad market clues for future direction. For instance, dow theory says transports heading lower with the market heading higher (divergence) usually indicates a reversion will happen. Copper to gold ratio is sometimes used as an analog for the direction of interest rates (another market leading indicator. etc etc etc). This dashboard just gives a quick list of common broad market clue indicators. If you're looking for "zero lag" uppers for trend and reversals, the fastest I've seen so far peroanlly is the TMO higher agg breakout indicator.
 

MatthewA

Active member
the TMO higher agg breakout indicator
Thank You I'm going to check this out...

So this indicator is similar to Pairs trading? That makes a lot of sense, but far less icon focused than Coke vs. Pepsi...
Sometime it would be cool to see an example of how you might use it... Like with food shortages being expected hopefully someone jumps in to overproduce food???
 

rad14733

Well-known member
VIP
@Samus Aran When all you hear is crickets that's a sign that you may need to either check Google for results or ask TOS Customer Support if you think it might be somewhere in TOS... But Google is probably your quickest answer... Continuing to ask is no guarantee of the answer you want and is considered poor forum etiquette...
 

EnV-T

New member
VIP
So this is something I've followed for years. When you have the market up or down you may or may have heard there are other stocks or indices you want to check to see if the market fundamentals or leading indicators support the move. Transports, high yield bonds, etc. This draft version just gives you the ability to choose labels that you want to see at a glance. It's got Junk bonds , transports, russell 2000, equal weight sp500, advance decline line change, CAT stock, crude oil, and copper to gold ratio for now. If there are any other support indicators you want labeled, let me know. Some of you may not understand why some of these are available. Either look it up or just turn the label off. This is called crash because when you see a bunch of red on an up day, you can be pretty sure there's gonna be a (fairly big) drop with the divergence. In bigger market dumps, it can really save your butt by signaling ahead of time.

Code:
#written JunkyTrannyCrash v1.0  by WTF_Dude
#leading indicators and discrepancy signals

declare upper;

def agg = AggregationPeriod.DAY;
#def currentTimeFrame = getAggregationPeriod();

input showJunk = yes; #show Junk label
input showTrans = yes; #show Trans label
input showEquals = yes; #show Equals label
input showRussell2000 = yes; #shows small caps move
input showAdvDec = yes; #show advance/decline line
input showCrude = yes; #show Crude label
input showCAT = yes; #show CAT as leading indicator
input showCopper_to_Gold = yes;
#CoppertoGold doesn't show an accurate percentage because its using futures. Just look for down or up to indicate future treasury rate moves.



def junkp = close("HYG");
def JPercentChg = 100 * (junkp / junkp[1] - 1);
def value = round(JPercentChg, 2);
AddLabel(  showJunk, "Junk: " + value + "%", if Junkp >= Junkp[1]
     then color.GREEN else color.RED );


def transp = close("IYT");
def TPercentChg = 100 * (transp / transp[1] - 1);
def value2 = round(TPercentChg, 2);
AddLabel(showTrans, "Trans: " + value2 + "%", if transp >= transp[1]
     then color.GREEN else color.RED );


def equalp = close("RSP");
def EPercentChg = 100 * (equalp / equalp [1] - 1);
def value3 = round(EPercentChg, 2);
AddLabel(showEquals, "Equal: " + value3 + "%", if equalp >= equalp[1]
     then color.GREEN else color.RED );


def small = close("IWM");
def RussPercentChange = 100 * (small / small[1] - 1);
def value8 = round(RussPercentChange, 2);
AddLabel(showRussell2000, "SmallCaps: " + value8 + "%", if RussPercentChange >= RussPercentChange[1]
     then color.GREEN else color.RED );



def level;
def Advances = close("$ADVN");
def Declines = close("$DECN");
def advnDecl = advnDecl[1] + if !IsNaN(Advances - Declines) then Advances - Declines else 0;
def ADDNfinal = 100 * (advnDecl / advnDecl[1] - 1);
def value4 = round(ADDNfinal, 2);
AddLabel( showADVDEC, "A/D Line: " + value4 + "%", if ADDNfinal >= ADDNfinal[1]
     then color.GREEN else color.RED );level = 0;




def crudep = close("/CL");
def cPercentChg = 100 * (crudep / crudep [1] - 1);
def value5 = round(cPercentChg, 2);
AddLabel( showCrude, "Crude: " + value5 + "%", if crudep >= crudep[1]
     then color.GREEN else color.rED );

def catmove = close("CAT");
def cATPercentChg = 100 * (catmove / catmove [1] - 1);
def value6 = round(cATPercentChg, 2);
AddLabel( showCAT, "CAT: " + value6 + "%", if CATMOVE >= CATMOVE[1]
     then color.GREEN else color.rED );



def Copper = close("/HG");
def Gold = close("/GC");

def cgr = cgr[1] + if !IsNaN(copper / gold) then copper / gold else 0;
def copgoldratio = 100 * (cgr / cgr[1] - 1);
def value7 = round(copgoldratio, 2);
AddLabel( showCopper_to_Gold, "Copper/Gold: " + value7 + "%", if copgoldratio >= copgoldratio[1]
     then color.GREEN else color.RED );


Can you make a script that includes upper labels for SPY, QQQ, VIX, $DXY, TLT while also including the current labels in this script?
 

iFrostyy

New member
VIP
So this is something I've followed for years. When you have the market up or down you may or may have heard there are other stocks or indices you want to check to see if the market fundamentals or leading indicators support the move. Transports, high yield bonds, etc. This draft version just gives you the ability to choose labels that you want to see at a glance. It's got Junk bonds , transports, russell 2000, equal weight sp500, advance decline line change, CAT stock, crude oil, and copper to gold ratio for now. If there are any other support indicators you want labeled, let me know. Some of you may not understand why some of these are available. Either look it up or just turn the label off. This is called crash because when you see a bunch of red on an up day, you can be pretty sure there's gonna be a (fairly big) drop with the divergence. In bigger market dumps, it can really save your butt by signaling ahead of time.

Code:
#written JunkyTrannyCrash v1.0  by WTF_Dude
#leading indicators and discrepancy signals

declare upper;

def agg = AggregationPeriod.DAY;
#def currentTimeFrame = getAggregationPeriod();

input showJunk = yes; #show Junk label
input showTrans = yes; #show Trans label
input showEquals = yes; #show Equals label
input showRussell2000 = yes; #shows small caps move
input showAdvDec = yes; #show advance/decline line
input showCrude = yes; #show Crude label
input showCAT = yes; #show CAT as leading indicator
input showCopper_to_Gold = yes;
#CoppertoGold doesn't show an accurate percentage because its using futures. Just look for down or up to indicate future treasury rate moves.



def junkp = close("HYG");
def JPercentChg = 100 * (junkp / junkp[1] - 1);
def value = round(JPercentChg, 2);
AddLabel(  showJunk, "Junk: " + value + "%", if Junkp >= Junkp[1]
     then color.GREEN else color.RED );


def transp = close("IYT");
def TPercentChg = 100 * (transp / transp[1] - 1);
def value2 = round(TPercentChg, 2);
AddLabel(showTrans, "Trans: " + value2 + "%", if transp >= transp[1]
     then color.GREEN else color.RED );


def equalp = close("RSP");
def EPercentChg = 100 * (equalp / equalp [1] - 1);
def value3 = round(EPercentChg, 2);
AddLabel(showEquals, "Equal: " + value3 + "%", if equalp >= equalp[1]
     then color.GREEN else color.RED );


def small = close("IWM");
def RussPercentChange = 100 * (small / small[1] - 1);
def value8 = round(RussPercentChange, 2);
AddLabel(showRussell2000, "SmallCaps: " + value8 + "%", if RussPercentChange >= RussPercentChange[1]
     then color.GREEN else color.RED );



def level;
def Advances = close("$ADVN");
def Declines = close("$DECN");
def advnDecl = advnDecl[1] + if !IsNaN(Advances - Declines) then Advances - Declines else 0;
def ADDNfinal = 100 * (advnDecl / advnDecl[1] - 1);
def value4 = round(ADDNfinal, 2);
AddLabel( showADVDEC, "A/D Line: " + value4 + "%", if ADDNfinal >= ADDNfinal[1]
     then color.GREEN else color.RED );level = 0;




def crudep = close("/CL");
def cPercentChg = 100 * (crudep / crudep [1] - 1);
def value5 = round(cPercentChg, 2);
AddLabel( showCrude, "Crude: " + value5 + "%", if crudep >= crudep[1]
     then color.GREEN else color.rED );

def catmove = close("CAT");
def cATPercentChg = 100 * (catmove / catmove [1] - 1);
def value6 = round(cATPercentChg, 2);
AddLabel( showCAT, "CAT: " + value6 + "%", if CATMOVE >= CATMOVE[1]
     then color.GREEN else color.rED );



def Copper = close("/HG");
def Gold = close("/GC");

def cgr = cgr[1] + if !IsNaN(copper / gold) then copper / gold else 0;
def copgoldratio = 100 * (cgr / cgr[1] - 1);
def value7 = round(copgoldratio, 2);
AddLabel( showCopper_to_Gold, "Copper/Gold: " + value7 + "%", if copgoldratio >= copgoldratio[1]
     then color.GREEN else color.RED );
Yes if you could please Add QQQ, TLT and VIX those are 3 of the most important indicators thank you!
 

rad14733

Well-known member
VIP
Yes if you could please Add QQQ, TLT and VIX those are 3 of the most important indicators thank you!
@iFrostyy You could add them yourself as an exercise in learning Thinkscript rather than asking others to do your coding for you... Thinkscript is self-documenting so just replicate how it is coded for other symbols... The only way to learn is to start... It shouldn't take you five minutes to Copy & Paste a block of code several times and edit the symbol names, or replace existing symbol names...
 

iFrostyy

New member
VIP
@iFrostyy You could add them yourself as an exercise in learning Thinkscript rather than asking others to do your coding for you... Thinkscript is self-documenting so just replicate how it is coded for other symbols... The only way to learn is to start... It shouldn't take you five minutes to Copy & Paste a block of code several times and edit the symbol names, or replace existing symbol names...
Yeah i figured it out, getting better each day!
 

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