// Downloaded From https://www.WiseStockTrader.com
AddToComposite(C/LLV(C,60)>=1.3,"~POS30QTR","X",19);
AddToComposite(C/HHV(C,60)<=.7,"~NEG30QTR","X",19);

// above is the breadth measurement that showed the most promise.
//You could comment out all the other indicators and
//possibly speed things up.

AddToComposite(C/Ref(C,-1)>=1.04,"~POS4DAILY","X",19);
AddToComposite(C/Ref(C,-1)<=.96,"~NEG4DAILY","X",19);
AddToComposite(C/LLV(C,20)>=1.2,"~POS20MO","X",19);
AddToComposite(C/HHV(C,20)<=.8,"~NEG20MO","X",19);
AddToComposite(L==LLV(L,60),"~NEWLOW60","X",19);
AddToComposite(H==HHV(H,60),"~NEWHI60","X",19);




myrsi=RSI(2);
AddToComposite(myrsi<10,"~LO_RSI_COMP","X",19);
AddToComposite(myrsi>90,"~HI_RSI_COMP","X",19);

rsi14=RSI(14);
AddToComposite(rsi14<30,"~LO_RSI14_COMP","X",19);
AddToComposite(rsi14>70,"~HI_RSI14_COMP","X",19);



AddToComposite(C>BBandTop(C),"~HI_BB_COMP","X",19);
AddToComposite(C<BBandBot(C),"~LO_BB_COMP","X",19);

pos4d=Foreign("~POS4DAILY","C");
neg4d=Foreign("~NEG4DAILY","C");
pos30q=Foreign("~POS30QTR","C");
neg30q=Foreign("~NEG30QTR","C");
pos20m=Foreign("~POS20MO","C");
neg20m=Foreign("~NEG20MO","C");
spyop=Foreign("SPY","O");
spycl=Foreign("SPY","C");
newlow=Foreign("~NEWLOW60","C");
newhi=Foreign("~NEWHI60","C");
posrsi14=Foreign("~HI_RSI14_COMP","C");
negris14=Foreign("~LO_RSI14_COMP","C");



Buy=Sell=Cover=Short=0;


Filter = 1;
AddColumn(pos4d,"+4% today",1);
AddColumn(neg4d,"-4% today",1);
AddColumn(pos30q,"+30% qtr",1);
AddColumn(neg30q,"-30% qtr",1);
AddColumn(pos20m,"+20% month",1);
AddColumn(neg20m,"-20% month",1);
AddColumn(spyop,"SPY Open",1.2);
AddColumn(spycl,"SPY Close",1.2);
AddColumn(newlow,"New 60d Low",1.0);
AddColumn(newhi,"New 60d Hi",1.0);
AddColumn(pos30q/(pos30q+neg30q)*100,"30q dif",1.2);
AddColumn(newhi/(newhi+newlow)*100,"hi-lo dif",1.2);