Fundamental Discrepancies aka JunkyTrannyCrash

wtf_dude

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:
MattATM

MattATM

Active member
VIP
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
 
MattATM

MattATM

Active member
VIP
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

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

MattATM

Active member
VIP
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???
 

Similar threads

Top