I want to create industry breadth that count how many % of stock on that Sub-sector making relative 20 day high to SPY.
Please help to review below script and picture, thank you.
Script:
ensure industry is MedicalSpecialties:
MATCHFUNFIELD(FEED=FD, FIELD=IndustryName, FIELDVALUE=MedicalSpecialties)
RIC 20 day to spx::
RIC R1=RIC(DATESEL=Last Year, INDEX=SPX:WI)
C1=CLOSE(R1);
H1 = HIGHESTHIGH(C1, BARS=20, BACKTYPE=Bars, EQUAL=True);
R1 > H1
Thanks Donald. I think it would be best to separate the criteria as otherwise it will take too long. Create a scan for each industry and then save the results as a manual symbol list:
Another option would be to scan on our Russell 3000 list (covering 96% of the US equity market) which will be quicker than the exchange groups.
Once the list has been created you can then run the breadth calculations on the manual symbol lists. You can update the list every week or month as required.
Still have problem about to scan industry.
I use the script to scan, but got no result.
Please help to solve, thank you very much.
Script:
MATCHFUNFIELD(FEED=FD, FIELD=IndustryName, FIELDVALUE=Semiconductors)
I’ve tried that same Semiconductor script on both a Watchlist and a scan and they are returning the expected results. Can you confirm, if you open a Watchlist of the S&P500 and apply that script as a column, does it work there?
Can you send an export copy of that page to [email protected] please so we can view it here, I can’t see anything wrong on the image that would explain why it isn’t working.
The Breadth Engine calculates the percentage of the universe that meet that criteria ie the entire S&P500 - not just the semiconductors.
I think the only way to do it is to separate the industry scan from the breadth calculation. Run the scan and save the symbols in a new Manual List, and then run the breadth on that list.
There are only 18 semiconductor companies in the S&P500 of which 15 (83.33%) are above their 200MA. This matches the breadth calculation in the image below. One thing to note is that there are lots of industry definitions - many with only a handful of members - so creating breadth calculations for them all would be very time consuming. Have you considered doing it for the sectors instead, eg Electronic Technology?
Thank you for your advice.
I want to try to build the industry breadth first.
If that cost too much time, maybe i will back to the sector.
But i want to confirm one thing after i scan the industry and build the manual list.
If i use russell 3000 to scan and build the link list.
Is that list will auto update when russell 3000 reconstitution ?
And if i use the list to create breadth, the survivorship Bias-Free Data affect the breadth index?
As i remember, russell 3000 reconstitution once per year.
Is that mean i can’t create the data range of the breadth index more than one years?
We only have historical membership of the S&P500 so for the Russell 3000 the historical breadth that you calculate is based on the current list.
The R3000 list gets updated automatically so you would need to run the scans (maybe every quarter for delistings and additions) to rebuild your industry lists, and your breadth would then be calculated on the updated list.