InvestorsHub Logo

Quasi

01/19/11 6:16 PM

#6759 RE: MAJORXVII #6752

Re: Major.. scan range question..

Sorry its been a very busy time of year and it looks like no one else has given you any tips so far, so here's my take on the problem.

Not sure exactly what you put in the scan, but I assume it was something like this. And you were looking for stocks which have had a trading range over the last 30 days of at least 20% of todays close, the results seemed irrelevant.

[type = stock]
and [max (30, Range) > close * 0.20]

The problem is in the definition of range. With respect to the scanning engine, range is defined as the High minus the Low of the period. As this is a daily scan, it is looking for stocks which have had at least one DAILY "high - low" difference of at least 20% of todays close. This is quite different than what I believe you were trying to achieve.

So here's some coding which should work a little better. We need to find the highest close over the last 30 days and subtract from that the lowest close over the last 30 days, (of course the highest and lowest close will not be on the same day). Then we want this difference to be greater than 20% of todays close.

[type = stock]
and [[max (30, close) - min (30, close)] > close * 0.20]

** note we are using an extra set of square brackets to enclose the max minus min calculation.

Hope this gives you some ideas
Quasi