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.
scanning formula for stocks under moving average
Comments
-
There are so many ways that could happen, that writing a scan for that specific requirement would pretty complex.
But, in most normally behaving stocks, the stock would have to be in a long term down trend. This is an off-the-top of my head approach to capture that condition:
and [ROC(251) < 0]
and [251 days ago ROC(251) < 0]
So, in other words, for two years (not necessarily calendar years) in a row, the stock has lost ground between the beginning and end of a 251 day period. That allows for a lot of fluctuation, but overall the trend will be down.
Very rough and ready, but maybe a useful starting point.0 -
how would I add additional criteria such as it is now risen above its 30 day moving average for 30 days0
-
Well, if you are ok with emas instead of smas, there is a trick you can use with MACD Hist.
Set up a chart with MACD Hist(1,30,0) instead of the default parameters. With these parameters, the Hist bar represents the distance between the close and the ema. When the close (ema(1, close)) is above the ema(30, close), the Hist bar is positive (above the zero line).
To scan for the close above the zero line for 30 days, you would scan for
and [min(30, MACD Hist(1,30,0)) > 0]
In other words, the smallest difference between the close and the ema is not less than (or equal to) zero.
Then you would have to test for the close below the ema 31 days ago, so
and [30 days ago close < 31 days ago ema(30)]
or you could say
and [31 days ago MACD Hist(1,30,0) < 0]
same thing.0 -
so to conclude i join these two formulas and [ROC(251) < 0]
and [251 days ago ROC(251) < 0] and [30 days ago close < 31 days ago ema(30)]0 -
You also need the MACD Hist. Also, days ago should both be 31 for close and ema.0
Categories
- All Categories
- 2.3K StockCharts
- 395 SharpCharts
- 146 Other Charting Tools
- 69 Saved Charts and ChartLists
- 1.5K Scanning
- 73 Data Issues
- 177 Other StockCharts Questions
- 218 Technical Analysis
- 155 Using Technical Analysis
- 2 InterMarket and International
- 19 Market and Breadth Indicators
- 42 Market Analysis
- 109 Trading
- 109 Trading Strategies
- 163 S.C.A.N the StockCharts Answer Network forum
- 65 Using this StockCharts Answer Network forum
- 98 s.c.a.n. archives
- 5 Off-Topic
- 6 The Cogitation & Rumination Emporium
- Forum Test Area