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.
Scan Price Performance Indicator
Hi Markd and All
Is it possible to write a scan for relative price performance to $SPX among various industry groups ?
This is to catch the industries with rising price performance ratio.
Is a scan possible to do such ? Thank you.
0
Comments
However, if you make a list of $DJUSxx industries and add $SPX, you could scan the list and rank by ROC(?).
So if the list is "DJUS industries", you would select it from the "Chart List" drop down:
[favorites list is 55] // DJUS industries
rank by ROC(63)
NOTE: I made up the number "55". Your list number will be different. Also, you can choose a shorter or longer ROC.
When you get the results, save the list - either to a new list, or replace an existing list - and check "Preserve sort order". Industries doing better than $SPX will be listed above it and have a lower sort number.
To determine which $DJUS industries to include, you can use the same names for industries that SC uses in its "Sectors and Industries" drop down. For instance, Automobiles is $DJUSAU and Railroads is $DJUSRR, etc.
I think you discussed about comparing relative performance among industries using price performance indicator or scan and rank by ROC before.
In order to pick out improving industry performance (weak to now strong), how often do you suggest I shall scan and rank the industries by ROC ? Or you think it's better to actually plot the price performance indicator to see the rising 50 day sma of the indicator ? I'm trying to see which method to use to pick out the improving industry performance. Thanks again.
You would run a scan on the list(s) and download the results. If you have the Excel skills, you can paste each weeks results into a single spreadsheet and look for the improving industries. Or, you can figure out how to capture the rank of each industry, have a spreadsheet with a column for each one, and each week add the current rank. If you format the cells for color (green if better rank , red if worse rank) the improving industries pop out. But it's a big job to create and a lot of work to maintain.
A less comprehensive way might be to scan your industry list(s) for ROC crossing above its (falling) MA 63 (or MA 50, whichever you prefer). Sometimes the MA is resistance, and the RS downtrend resumes, but sometimes its a breakout, or a prelude to a stronger price trend.
I like your latter idea that scans the industry lists for ROC crossing above the MA. I will write that scan sometime this week and check with you if scan is written correctly. Thanks in advance.
The cross above is a heads up, not necessarily an entry. It seems to be better, most of the time, to wait for entries until the 63 MA of RS (the price performance indicator) turns up or is already rising, so both the long ROC MA (63 of 126) and the RS MA are rising.
But, I'm still researching this, so it might be that I just found a market in which that seems to work, but it might not work at other times.
When you set up the chart with the ROC 126, you can make the ROC line invisible (opacity = 0.0) and just show the MAs with different colors, e.g. 5:red and 63:blue. A little easier to read.
Thanks for the idea.
Can you please demonstrate the new idea with scan formula ? I'm a bit confused. Thanks.
// the 63MA of ROC 126 is falling for at least the last month
and [sma(63, ROC(126)) < 21 days ago sma(63, ROC(126))]
// the 5 MA of ROC 126 crosses above the 63 MA of ROC 126
and [sma(5, ROC(126)) x sma(63, ROC(126))]
I will test it out later this weekend. Thanks again.
Got a question on your statement below:
When you set up the chart with the ROC 126, you can make the ROC line invisible (opacity = 0.0) and just show the MAs with different colors, e.g. 5:red and 63:blue. A little easier to read.
I can only set up one pane with sma(5) of ROC and another pane with sma(63). How do you set up both sma(5) and sma(63) of ROC in the same pane so you see the sma crossing each other ?
Using the strategy discussed in this thread, does XLE seem to be bottoming ?
Thanks for your kind contribution.
The Energy sector is showing some strength, likely due to the rise in oil. There have been some divergences in RS for XLE vs $SPX (lower lows on the daily XLE price chart, but not on the Price Performance indicator) which is positive. ROC shows internal (XLE vs. itself) slowing of downside momentum, which is also positive. The 5 hasn't yet crossed the 63, but that looks likely. But it's only a heads up, not necessarily a signal.
It doesn't look like there has been a lot of accumulation for the long term, which may mean there has not been a lot of stock taken off the market by institutions with expectation of much higher prices. So if stock prices rise, there is likely to be a lot of supply to meet buyers, making for a choppy rise. Some kind of news could change that and send prices up quickly to adjust for the new situation.
Thanks for the clarification. A few more questions:
1. I see ma(5) of ROC(126) at -10.35 vs ma(63) at -9.05. Since XLE has been rising since mid-July, I'd think ma(5) would have already crossed up ma(63) or ma(5) is larger than ma(63). Am I missing something ?
2. I have always wanted to ask this question. Which indicator do you use to show that "It doesn't look like there has been a lot of accumulation for the long term", as you stated above, if you don't mind sharing your expertise. CMF ? I always like to track stocks that have huge interest by big institutions, pension plans, 401k plans or mutual funds, etc. What analysis/indicators etc do you use to achieve this answer ?
Thanks and look forward toward your expertise..
I use Force(251) with a 63 MA. After an extended decline in a stock, so that Force goes negative, watch for Force to climb above its falling 63 MA, and the 63 MA to turn up. Price comes up off the lows and stays in a range above the lows, at least a few weeks, sometimes a few months. Then, there may or may not be a shakeout that tests or breaks support and then the mark up phase begins. This doesn't happen every time of course, and stocks can go into a long up leg without this pattern developing first.
For details on accumulation and distribution, google "Wyckoff pdf". You can download his course (you should have antivirus if you do this). There are some books available, too. Charting the Stock Market - the Wyckoff Method by Jack K Hutson; Three Skills of Top Trading by Hank Pruden (I think both available from the Stockcharts bookstore). Also check out the Wyckoff blog on this site.
As a side note, it may be that Force does not have to go below zero. It might be that Force only has to spend some time below its falling MA (because of a sell off that does not get Force below zero), then cross back above it. Possibly you could scan ahead of the crossover by looking for falling MA, Force below it and the 21 MA of Force below the 63 MA and closer to the 63 MA than say, two weeks ago (in other words, 63 MA - 21 MA less than two weeks ago 63 MA - 21 MA). I haven't done it or researched it, but it might be worth the effort. If it works, you should find more trades.
Thanks much for the demo which clarifies some of my confusion.
A few more questions:
1. CHL example showed that Force crossing above the sma(63) didn't work well. I would then assume this strategy only works in trending market not in trading range ?
2. On the other hand, does Force crossing below the sma (63) mean it's a long term sell ? Is this a late sell signal ? If so, how do you determine long term sell signal ?
3. Yes, I like to research into this strategy to see if it works.
Possibly you could scan ahead of the crossover by looking for falling MA, Force below it and the 21 MA of Force below the 63 MA and closer to the 63 MA than say, two weeks ago (in other words, 63 MA - 21 MA less than two weeks ago 63 MA - 21 MA).
[force(251) < sma(63,force(251))] : Force below MA
[weekly sma (63,force(251)) < 1 week ago sma(63,force(251))] and [1 week ago sma (63, force(251)) < 2 week ago sma (63,force(251))] etc or other better idea for falling MA ? : Falling MA
Not sure how you write scan for "the 21 MA of Force below the 63 MA and closer to the 63 MA than say, two weeks ago" ?
Please correct scan code if not done right.
I appreciate your time in this. Thanks for your tireless hard work.
and [sma(63, Force(251)) < 10 days ago sma(63, Force(251))]
// Force is below its MA 63
and [Force(251) < sma(63, Force(251))]
// MA 21 of Force also below MA 63
and [sma(21, Force(251)) < sma(63, Force(251))]
// MA 21 of Force and MA 63 of Force are converging
and [ [sma(63, Force(251)) - sma(21, Force(251))] < [ 10 days ago sma(63, Force(251)) - 10 days ago sma(21, Force(251))] ]
After you view the results for this code, you may also want to test for falling sma(63, close) and price below it. Accumulation generally occurs after a notable sell off, but the code above will get hits for stocks still rising.
To answer question 1 - it seems to work best for stocks showing long term growth - in other words, like ATVI, in a long term up trend.
Question 2 - when it works as a sell signal - Force breaking below rising MA - it should be early, not late. CHL shows that crossover in Sep 16, before the breakdown in Oct 16. However, if the stock is in a good long term up trend, I think its just a caution - not a change of trend. Some of your hits for the code above will give you an idea if you look left on the chart. You are likely to get a dip or a range, maybe, but not necessarily a change in trend.
Very insightful.
Can you explain a bit on the following statement below, as I'm a bit confused about it:
After you view the results for this code, you may also want to test for falling sma(63, close) and price below it. Accumulation generally occurs after a notable sell off, but the code above will get hits for stocks still rising.
Thanks.
To eliminate those hits, you can test for a sell off in price. The test would be a falling 63 MA of price and price below it:
and [sma(63, close) < 21 days ago sma(63, close)]
and [close < sma(63, close)]
I went back to review the charts for ATVI, AMT, CHL and TEVA using Force(251) with ma(63) of Force. It looks like this strategy works well while the stock in long-term uptrend like ATVI, AMT. But it didn't work for CHL and TEVA (both long-term downtrending).
Does weekly chart using Force(251) with ma(63) of Force have any meaning ? Because for TEVA, Force (251) crosses ma(63) of Force around Feb, 2017. However, using weekly chart, Force has not crossed its ma. Not sure if it is a good idea to wait for weekly Force to cross its ma ? For CHL, the same weekly Force has not crosses its ma yet.
On the other hand, for ATVI and AMT, their respective Force(251) on weekly chart crossed its ma(63) a bit later than on the daily chart. Is it a good idea to wait for the Force crossing its ma on the weekly chart to confirm ?
Thanks.
On the weekly, Force 251 would be almost 5 years and 63 about a year and a quarter, almost. Those periods may correspond to some higher level cycles, but I don't know what they would be and I haven't done any research on it. You could try four years (208) and one year (52). There may be a four year market cycle related to the political cycle. But keep in mind there are a lot of coincidences on charts. It's hard to pick out what kinds of events are really meaningful. I think you can only do that by finding lots of examples in many different markets and comparing outcomes. If you have programming skills and data, it makes it easier, although you should still look at the charts. A lot of work.
So to answer your question, I don't think the daily and weekly Force 251 events are meaningfully related.
If you want to see Force lines on the weekly chart that more or less correspond to Force 251 on the daily, you would use Force 52 and MA 13.
Also keep in mind the crossover is more of a set up - a heads up to look for an entry - not necessarily the entry itself.
Thanks for the input. I definitely agree.
On a separate question, if I were to look for improving oversold weekly stochastics in long-term uptrending stocks, would the following scan be appropriate or can it be improved:
[weekly slow stoch %K(14,3) <20]
and [Weekly Slow Stoch %K(14,3) >1 week ago Slow Stoch %K(14,3)]
and [1 week ago Slow Stoch %K(14,3) > 2 week ago Slow Stoch %K(14,3)]
and [2 week ago Slow Stoch %K(14,3) > 3 week ago Slow Stoch %K(14,3)]
and [sma(251, close) > 21 days ago sma(251, close)]
Thanks again.
I think it should be written this way, with additional "weekly" modifiers and using a weekly sma so you can verify results on one chart:
and [weekly slow stoch %K(14,3) <20]
and [Weekly Slow Stoch %K(14,3) >1 week ago weekly Slow Stoch %K(14,3)]
and [1 week ago weekly Slow Stoch %K(14,3) > 2 week ago weekly Slow Stoch %K(14,3)]
and [2 week ago weekly Slow Stoch %K(14,3) > 3 week ago weekly Slow Stoch %K(14,3)]
and [weekly sma(52, weekly close) > 3 weeks ago weekly sma(52, weekly close)]
I would offer that a drawback to using a specific pattern - three consecutive rising weeks with K still below 20 - is that not all good hits would necessarily follow this pattern. If you "open up" the condition a little, you will get more hits - of course there could be more junk in those hits as well.
A less restrictive scan would be to require that the minimum K in the last three was below 20 and the current K is the highest of the last three weeks. That way, current K can be above twenty and you don't have to have three consecutive weeks of higher K.
and [weekly Slow Stoch %K(14,3) =weekly max(3, weekly Slow Stoch %K(14,3))]
and [weekly min(3, weekly Slow Stoch %K(14,3)) < 20]
and [weekly sma(52, weekly close) > 3 weeks ago weekly sma(52, weekly close)]
I haven't really found a pattern that works well yet. I'm trying to find which pattern would work best. And agree with your suggestion on using a less restrictive scan since one pattern doesn't fit all.
In your August 3rd reply, you mentioned that the crossover is more of a set up - a heads up to look for an entry - not necessarily the entry itself.
What variables do you use to look for an entry ?
1. 52-week high on big volume ?
2. Long term MA cross over. Such as 50 sma crossing up 200 sma ?
3. look for oversold RSI ?
4. look for down-trending trend-line to be broken ?
5. any other ones or I'm completely off track ?
I really appreciate what you have taught me so far. Thanks for being so generous to share.
Good entries often occur near price channel intersections (which are support and resistance levels). I like calendar cycle based channels - 10 (half a month), 21, (a month), 63 (a quarter) and 251 (a year). The stronger the stock, the better the chance of a turn at or near the 10 or 21 lower price channels. The 63 mid and lower channel seem to work best if price comes into them kind of sideways - either a range or a long shallow decline. The 251 mid channel is similar. Sometimes the turn occurs near the 63 or 251 MA instead of the mid channel.
I think I understand some of your message but its entirety.
If it is not too troubling, can you please demonstrate using a trade or 2 in the past so I better understand your message ?
Thanks much. Look forward to your insight.
10 LPC (lower price channel) in March (blue channel)
Notice when Fast K 10 (blue line) dips below 20, it is often a good set up.
21 LPC in April (light red channel) - note there is also a 10 LPC entry before the 21.
Concentrations of buying (up volume bars) in December, February, show real interest.
Tall red bars in Dec, Feb don't make much downside progress, showing buyers are absorbing the selling.
RS is questionable in March, but good in April.
Thanks for the example and it's much clear now.
However, I keep having more questions. Thanks in advance for clarification.
You mentioned that
If you look left on the chart, you want to see that current prices are in the range of a strong up bar that advanced the trend. That shows this price level was once a demand area, so it is more likely to draw buyers again if the trend is intact.
I assumed this can apply to ~ Feb 14 where it closed higher with big volume. Or is there anywhere on the chart where the above statement applies ?
During trading range in Nov, Dec and January, there shall be more grey volume bars than red bars which show buying interest ?