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.
Defining an uptrend in a scan
Hi,
I would like to define my uptrend scan in a way that it scans for stocks that have their 20 day ma above the 50 day ma for the entire period of x days (for example 50 days). What would be the best way to scan for this? So what I want is to have the 20 day MA above the 50 day ma the ENTIRE time of the lookback period.
Thanks!
Akroma
I would like to define my uptrend scan in a way that it scans for stocks that have their 20 day ma above the 50 day ma for the entire period of x days (for example 50 days). What would be the best way to scan for this? So what I want is to have the 20 day MA above the 50 day ma the ENTIRE time of the lookback period.
Thanks!
Akroma
0
Best Answers
-
You could use the following code if you need an SMA.
[type = Stock]
and [ SMA(20,close) > SMA(50,close) ]
and [ 1 days ago SMA(20,close) > 1 days ago SMA(50,close) ]
and [ 2 days ago SMA(20,close) > 2 days ago SMA(50,close) ]
and [ 3 days ago SMA(20,close) > 3 days ago SMA(50,close) ]
// ETC ETC
Or if you can use an EMA then we can use the MACD which calculates the difference between two EMA's. When the MACD line is above zero, the EMA20 is above EMA50. Then just use the min over time function to ensure the lowest value over the lookback period (50 trading days) is greater than zero.
[type = Stock]
and [Min (50, MACD Line(20,50,9) ) > 0.0]
0 -
Just a note: PMO is not calculated exactly like the MACD, although it's similar. PPO is exactly analogous.0
Answers
-
Thanks using the PMO line will work just as well as MACD I assume?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