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.


  • Options
    markdmarkd mod
    edited January 2015
    There is nothing in the scan builder dropdowns that suggests you can do this.

    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.

  • Options
    Yes it is possible, but not exactly as you have described. This is due to the fact that the output of one part of the scan would have to be the input to another part of the scan. Also the first part might not be a single output it could be multiple outputs.

    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.
  • Options
    I have a small point I would like to make that may shed light on how these two work: $SECTOR and $INDUSTRY are like variables associated with one ticker/symbol at a time. Without knowing the one ticker/symbol associated with $SECTOR and $INDUSTRY, these two variables are basically empty useless variables. This is exactly what would happen in the scan engine. The scan engine does not allow you to input one ticker/symbol as a parameter. So, plugging in $SECTOR and $INDUSTRY into the scan engine is like plugging in empty useless variables.

    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.
  • Options
    markdmarkd mod
    edited February 2015
    "The scan engine does not allow you to input one ticker/symbol as a parameter."

    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.
Sign In or Register to comment.