This indicator will plot market breadth for the NYSE or NASDAQ in one of four ways:
1) Advancing/Declining Issues Ratio
2) Advancing-Declining Issues Total
3) Advancing/Declining Volume Ratio
4) Advancing-Declining Volume Total
# MARKETBREADTH
# http://www.thinkscripter.com
# thinkscripter@gmail.com
# Last Update 21 Jan 2009
declare lower;
input display = {default ADIssuesRatio, ADIssues, ADVolumeRatio, ADVolume};
input market = {default NYSE, NASDAQ};
def advancing = if(market, close("$advn/q"), close("$advn"));
def declining = if(market, close("$decn/q"), close("$decn"));
def advVolume = if(market, close("$uvol/q"), close("$uvol"));
def decVolume = if(market, close("$dvol/q"), close("$dvol"));
plot Breadth;
switch(display) {
case ADIssuesRatio:
Breadth = if(advancing > declining, (advancing / declining), (-declining / advancing));
case ADIssues:
Breadth = advancing - declining;
case ADVolume:
Breadth = advVolume - decVolume;
case ADVolumeRatio:
Breadth = if( advVolume > decVolume, (advVolume / decVolume), (-decVolume / advVolume));
}
Breadth.AssignValueColor(if Breadth >= 0.0 then color.green else color.red);
Breadth.SetPaintingStrategy(paintingStrategy.HISTOGRAM);
Breadth.SetLineWeight(3);
plot ZeroLine = 0.0;
ZeroLine.SetDefaultColor(color.white);






Do you know where I can get the code for a mac based system?
As far as I know, ThinkScript is the same on a Mac as on a PC, so the code should be the same as on a PC.
GReat stuff!!
Thanks for sharing!
My pleasure!