| hazan 7 posts
 msg #108908
 - Ignore hazan
 | 11/19/2012 6:06:03 AM 
 Hi,
 
 I want to create a filter that shows how many days the stock had a change in the range of the current day change +- 0.5 percent.
 e.g. if the stock XXX went up 3%, then I want to show how many times it had a change between 2.5% to 3.5% in the last 100 days
 The filter will show all stocks and just add a column that shows the number of times it was in the range in the last 100 days..
 
 I tried to do it as below, but it doesn't work, any suggestions ?
 It shows 100 for "inRangeCount" column all the time because it refers to "dayChange" of the day it checks and not the last day.
 
 set{dayChange, close/open}
 set{lowerDayRange, dayChange - 0.005}
 set{upperDayRange, dayChange + 0.005}
 set{aboveLowerDayRange, count(dayChange > lowerDayRange,1)}
 set{belowUpperDayRange, count(dayChange < upperDayRange,1)}
 set{isInRange, aboveLowerDayRange + belowUpperDayRange}
 set{inRangeCount, count(isInRange > 1 ,100)}
 
 close < 100 and
 Average Volume(30) is above 200000
 
 add column inRangeCount
 
 SORT COLUMN 5 DESCENDING
 
 
 
 |