InvestorsHub Logo
Followers 12
Posts 1003
Boards Moderated 1
Alias Born 10/29/2006

Re: MAJORXVII post# 6752

Wednesday, 01/19/2011 6:16:07 PM

Wednesday, January 19, 2011 6:16:07 PM

Post# of 7256
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

I don't work for Stockcharts, I'm just another user always trying to learn more and willing to share what I've already learned.
Stockcharts.com Support Forum

Join the InvestorsHub Community

Register for free to join our community of investors and share your ideas. You will also get access to streaming quotes, interactive charts, trades, portfolio, live options flow and more tools.