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.
MA cross within 'x' number of past days.
I know of a scan program offered by another company that permits one to insert a condition to the effect of "and ema(7) of the close crossed above ema(21) of close within last 'x' days". Is there a way to accomplish the same in a Stockcharts scan with the same or better brevity? Actually on the other scanner it can be entered with even less verbage: "and ema(7,close) crossed above ema(21,close) withing last 'x' days."
Thanks
Thanks
0
Best Answer
-
So you are looking for the EMA-7 to be above the EMA-21 today, but somewhere in say the last 5 days it has been below the EMA-21.
As you are looking at EMA's we could use the MACD which defines the difference between two EMA's. A positive MACD Line means EMA-7 is above EMA-21, a negative number means its below.
Thus you want greater than 0 today and less than 0 sometime in the last 5 days. The following scan will do that with just two lines of code.
[type = Stock]
and [MACD Line(7,21,9) > 0.0]
and [Min (5, MACD Line(7,21,9)) < 0.0]0
Answers
-
It certainly does Gord and I thank you. I should have thought of it as I use the PPO quite a bit to determine how far a moving average is from the close.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