Louis,

You may want to try the code below to find stocks that are trading in
a range or band.

// include within your parameters listing
RP = Param("Trading Range Period" , 30, 10, 240, 1);
MRB = Param("Max Range Band in %" , 20, 1, 30, 1);


// Calculate the trading Range Band --------------
RBH = Ref(HHV(Close,RP), -1);                           // Highest Close over 
Range Period
(Preceeding RP days)
RBL = Ref(LLV(Close,RP), -1);                           // Lowest Close over 
Range Period
(Preceeding RP days)
RBP = ((RBH - RBL) / RBH) * 100;                        // Range Band in 
percentage
IRB = RBP <= MRB;                                                               
// Range Band % less than Max RB %
CBR = C > RBH;                                                          // 
Close above Range Band?

The idea is to take a look at the highest closing price and the lowest
closing price over x days, determine how tight that trading range has
been.

I use the above code to find breakouts from these ranges.

MM

Reply via email to