Monday, September 28, 2009

Market Breadth Studies for TOS




Here are two custom studies I've coded for TOS platform which deal specifically with NYSE Up/Down Volume.

The first one is NYSEBreadth and gives you a histogram which totals the Up Volume + Down Volume to give you total volume for the day. The blue line plotted over the histogram is the ratio to show how strong the volume was. If there is more up volume then down volume then the ratio will be (Up Volume/Down Volume). If there is more down volume then up volume then the ratio will be (Down Volume/Up Volume).  Another words, don't be using this as some type of oscillator or divergence indicator. This inidicator works on multiple timeframe, and I prefer looking at this volume rather than the SPY volume, because you can have days that are up in price but really take a behind the scenes look to see if there was any distribution going on.

NYSEBreadth:

declare lower;


def tVolume = close("$UVOL+$DVOL")/1000000;


def uVolume = close("$UVOL");
def dVolume = close("$DVOL");


plot Breadth = tvolume;


Breadth.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Breadth.DefineColor("Positive", Color.UPTICK);
Breadth.DefineColor("Negative", Color.DOWNTICK);
Breadth.AssignValueColor(if uVolume > dVolume then Breadth.color("Positive") else Breadth.color("Negative"));


plot volume;


volume = if(uVolume > dVolume, uVolume / dVolume, dVolume / uVolume);


Volume.SetStyle(curve.FIRM);
Volume.SetLineWeight(2);
Volume.SetDefaultColor(GetColor(3));



The second study that I developed is the ratio of Up Volume to Total Volume but I've noticed it plots much neater if  you smooth it out with a moving average. The default is 5. This is used to notice divergences and potential changes in trend before they happen.

NYSEBreadthRatio:


declare lower;


input length = 5;


def uVolume = close("$UVOL");
def dVolume = close("$DVOL");


def VolumeRatio = (uVolume/(uVolume+dVolume));


plot Avg = expaverage(Volumeratio, length);


Avg.SetStyle(curve.FIRM);
Avg.SetLineWeight(2);
Avg.SetDefaultColor(GetColor(7));

1 comments:

Unknown said...

It's good, effective & useful in a way. Thanks for sharing this stuff....



penny stock market

Post a Comment