New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
Using $SECTOR and $INDUSTRY in stock scans?
Is there a way to include the $SECTOR and or the $INDUSTRY in an actual scan...... for instance scan the whole population of stocks where the stock is crossing over the 20 day moving average and the $SECTOR is above the 20 day moving average and the $SECTOR 20 day moving average is above the $SECTOR 50 day moving average....
I am just trying to really find out if the $SECTOR and $INDUSTRY PARMS can be used in a scan along with stock scan criteria.
0
Comments
If you write $SECTOR into a scan phrase (e.g. and [sma(20, $SECTOR) > 10]), it doesn't pass "check syntax", so I guess the answer is no.
Good idea, though. You could submit it as a suggestion to support. It would take a while, but I think it would get serious consideration. I can see where it could be pretty demanding on server resources, though.
Thus we just have to break it into two separate parts. First scan the S&P sector ETF's to see which ones meet the criteria of being above the SMA20 and also SMA20 above SAM50.
Now you could make your own list of the nine S&P sector ETF's or if you have the Essentials chart pack installed its already there, list 3010 S&P Select Sector ETFs (SPDRs).
So this scan finds the sector or sectors which meet the sector criteria.
[favorites list is 118] // 3010 S&P Select Sector ETFs (SPDRs)
and [close > sma(20, close)]
and [sma(20, close) > sma(50, close)]
When I ran this scan this morning, only one sector met the criteria;
XLU Utilities Select Sector SPDR
So we just select the UtilitiesSector and look for the close above the SMA20, or a crossover of the close today above the SMA20
[group is UtilitiesSector]
and [close > sma(20, close)]
output 105 stocks
[group is UtilitiesSector]
and [close X sma(20, close)]
output 5 stocks.
The only way to associate $SECTOR and $INDUSTRY with one ticker/symbol where $SECTOR and $INDUSTRY are populated with something useful is via the SharpCharts workbench. The other charting tools are based on a set of ticker/symbols. Therefore, one cannot be associated with $SECTOR and $INDUSTRY.
For the record, SCC refers to $SECTOR and $INDUSTRY as: pseudo symbols.
Just for the record, you actually scan for just one symbol. This is a valid scan:
[type = stock]
and [symbol = "IBM"]
Limited usefulness, but it is possible.
To your main point, I don't think there's any technical reason the scan engine couldn't be modified to do what jfisher is asking. But a decision would have to be made whether it's worth doing - i.e. would demand for the feature attract and/or retain subscribers so that the development and support costs would pay for themselves.