This is a nice first step. It’s cool and I’m gonna play with it. Way to keep adding functions.
(NOTE: If I am wrong on the below, please correct me, I only looked quickly).
Any chance on really adding the ability to analyze and rank industries? What would be really helpful is to expand P123 funcationality to be more like a programming language so we have the the ability to automate (ranking of) industries / sectors.
I have wanted to do this for a few years.
Let’s take a specific example. Let’s say I want to rank industries higher if they are selling well below their median Price to sales average of the past 3 years. That seems fairly logical - if an industry is selling very far below it’s 3 year average price to sales, but still undergoing sales growth and holding fairly stable on margins, I may want to do a deep dive there. However, correct me if I’m wrong, but it’s still now incredibly cumbersome and painful to program this and use it at all - even if it can be done. I would have to create custom series for each industry then figure out some way to calculate their ratio of current average median price to sale, then figure out some way to rank them on the ratio of current price to sale versus the average. Can this one basic concept even be done with this new functionality?
What’s needed for world-class system building in the industry and sector side is for P123 to function more like a programming language with ‘loops’ and ‘automated user defined processes’. So, I can define a mini-program:
a) Calculate an average industry median price/sales ratio over past 5 years.
b) Calcuate current industry price/sale ratio.
c) Calculate ratio of current price/sale ratio over average price to sale ratio.
d) Apply the above steps to all industries.
e) Rank industries based on the resulting ranking of all these ratio’s.
Right now I have to manually create a custom series for each industry. That’s very inefficient time wise (it takes forever and doesn’t adapt as new industries come about). It’s too inefficient to make a user manually try and do this and not have more ‘smart logic’ within the P123 platform. It’s possible that this is a very valuable ranking factor. But, we can’t discover that because it’s still just too hard and cumbersome to use.
Other examples of things I want to do, find the smallest, highest-growth ‘emerging industries’ with the fewest competitors but highest margins. Can I do this easily? How?
(1) is a blended version of the new industry factors CurrYRevRatio4W and NextYRevRatio4W. This represents the new functionality.
(2) uses FMedian(“TotRevisions4W”,#Industry) close but not exactly the same.
Both use the S&P 500 universe. The performance graphs are shown below (attached).
Both ranking systems consist of industry factors only. There are no factors unique to an individual stock. Thus only the industries are being ranked and whether a stock has an NA should be irrelevant (I believe).
Based on the performance graphs I have to come to the conclusion that there is a problem with the way the new industry function is being calculated. And in fact, every time I try to look into how ranks are processed I feel the need to visit a shrink immediately afterwards
Here is a look at the rank data. You can see there are no N/As. The factor ranks both end at ~60. I thought it was a lot higher than that but today the bottom end is about 60. In any case I have to wonder why the ranks aren’t spread across 0-100.
Steve
Marco, you are releasing cool features faster than I can keep up. Thank you! I had been using the FMedian() function to estimate industry time series but I just got much better results using the new time series!
Now if only you would release variable position sizing; especially for ETFs…
Digging into this a little further, it appears that 60% of the industries are tied for last place. The ranking algorithm doesn’t assign ranks that span the range 0-100, but works from highest to lowest. Hence the lowest rank for today’s date is about 58. I’m not sure what the 2 N/As are all about as it is irrelevant what individual stocks are being covered by analysts.
I’d like to see an option where the ranks span the range. In this case the 60% of stocks would be assigned a rank of 0. The top ranked stocks 100. The way it works currently, the compacted range makes the factor(s) almost ineffective when combined with normal factors.
calif - you could in theory construct a ranking system using all industry factors. You would have to check to see if Balanced4 could be implemented (i.e. are all the industry factors available?). Then you could add additional stock factors to separate stocks within an industry.
Bad news. The Industry ratio CurrYRevRatio4W & NextYRevRatio4W is this
(#TotUpRev - #TotDnRev) / #TotEstimates
But to avoid divide by 0 it needs to check if #TotEstimates is NA or 0. The program is doing the check, but using the values of the very last stock in the industry. So it’s up to chance whether the last stock has values or not, resulting in many NAs for the Industry
Very sorry about this. Will be fixed later. I don’t think it’s a popular ratio since it’s not in the literature.
PS: this is not related to the new release. This bug has bee there since we switched to Compustat and had to re-write it. Which means that when we were checking for correctness, the industry we picked happened to have a stock in the last position with valid values
I think each one of these needs to be tested. Perhaps some people from the community can pitch in? Its better to get the bugs out of the way before models get unleashed.
Marco - is it difficult to expand the Sector factors i.e. include fundamentals?
I have these 2 rules in the screener for the universe.
HighValBar(120,0,#industry)<=25
Close(0,#industry) > SMA(40,0,#industry)
The universe shows a total of 169 stocks with those 2 rules included.
When I run the sim with this universe it returns: “No stocks were ranked. Empty universe found.”
Something does not work here. If I remove these rules from the universe and include them in the buy rules then the sim works perfectly ok.
Steve, not every TA function are available for industries and sectors. Only the ones with a series parameter for now. ChaikinAD should not be displayed in the sector node reference and give an error when used.
Geov, It works but your rules are too restrictive. Systems do not allow empty universes. Try loosening up the universe rules