// Breadth of Stocks // Develops composites that can be plotted or manipulated as you wish // How to Run // 1) Select Group - Stocks or Market -NYSE,Nasdq, AMEX // 2) Select an issue with a long history in the current ticker window // 3) Set APPLY TO to use filter Market - Stocks // 4) Set RANGE to one bar... 1 n last quotations // 5) Press SCAN // adapted from code by Dick Areehoi //v2 // adds a minimum bar requirement to the condition ... //...and also an input variable for the number of bars required... //...and allows for the Hi and Lo bars number to be different... //...and substitutes H or L for C in the conditional arguments... //...and makes plotting of the Lower Lo's conditional so it starts at the same time as the HigherHi's //===================52 Weeks New High - Lows ================================== Buy = Sell = 0;//allows Scan to run inputHi = 250;//manually enter the number of lookback bars required inputLo = 125;//manually enter the number of lookback bars required //Find New Highs over the past 52 weeks. AddToComposite(IIf(H > HHV(Ref(H, -1), inputHi) AND BarIndex() > inputHi, 1,0) , "~StocksNewHi","X"); //Same for lows next. AddToComposite(IIf(L < LLV(Ref(L, -1), inputLo) AND BarIndex() > InputLo, 1,0), "~StocksNewLo","X"); NewHigh = Foreign("~StocksNewHi","X"); NewLow = Foreign("~StocksNewLo","X"); DIFF_H_L = NewHigh-NewLow; Plot(NewHigh,"NewHigh",colorGreen,styleThick|styleHistogram); Plot(IIf(BarIndex() > inputHi ,NewLow*-1,0 ),"NewLow",colorRed,styleThick|styleHistogram); Plot(0,"",1); //Plot(Diff_H_L,"Diff_H_L",colorBlack,styleLine);