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 for a flat moving average

in Scanning
I have been trying to find a way to scan for EMA(15) to be flat for 5 to 8 bars. Of course there would be some wiggle, but basically flat.
Is there a way to look for a flat moving average?
Is there a way to look for a flat moving average?
0
Comments
-
Try this:
It says, the difference between the maximum and minimum value of the 15 day exponential moving average over the last 8 days is less that 1/10 of 1 per cent.
and [PctDiff(max(8,ema(15,close)), min(8,ema(15,close))) < 0.1]
Notice all the parentheses you have to get right- especially that there are three at the end of the PctDiff function.
You can play with the 0.1 at the end. A whole number is a per cent - so 1.0 would be 1 per cent. I don't think you would want to go higher than that for most stocks. To go smaller, I'm not sure how many decimals you can add after the decimal point, e.g. 0.0125. Give it a try.0 -
That is exactly what I needed, works as presented. Thanks much.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