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.
What am I Missing?
I want a scan to identify when the 13 week ema crosses above the 34 week ema. The scan syntex says the scan is correct but when I run the scan it says "no data in the tables." Could someone help me identify what is incorrect with this scan?
[type is stock]
// Scan to identify when the 13 week EMA crosses above the 34 week EMA
and [group is SP600]
and [group is SP400]
//Moving Averages are correctly Positioned
and [weekly EMA(13) > weekly EMA (34)]
//Moving Average Cross over
and [weekly EMA(13) x weekly EMA(34)]
and [ EMA(13,Close) > 0 days ago EMA(34,Close)]
Thanks,
Bryce A
[type is stock]
// Scan to identify when the 13 week EMA crosses above the 34 week EMA
and [group is SP600]
and [group is SP400]
//Moving Averages are correctly Positioned
and [weekly EMA(13) > weekly EMA (34)]
//Moving Average Cross over
and [weekly EMA(13) x weekly EMA(34)]
and [ EMA(13,Close) > 0 days ago EMA(34,Close)]
Thanks,
Bryce A
0
Comments
-
Hi @Bryceand1, welcome aboard.
This is the error:
and [group is SP600]
and [group is SP400]
No symbol belongs to BOTH the sp6 and sp4. But some symbols belong to sp4 OR sp6.
So, the first line should be
[ [group is sp600] or [group is sp400] ]
You need the extra brackets to isolate the OR statement, so the scan sees that the OR applies only to the alternative within the extra brackets. If you don't isolate the OR, the scan will return symbols for any condition that is true in the whole scan.
Also, this is redundant:
//Moving Averages are correctly Positioned
and [weekly EMA(13) > weekly EMA (34)]
- probably OK if you leave it in, because it should be true if the next line is, but not necessary
This is also redundant, for the same reason:
and [ EMA(13,Close) > 0 days ago EMA(34,Close)]
So the whole thing would be:
// begin 13-34 week crossover scan
// universe to scan
[ [group is sp600] or [group is sp400] ]
//Moving Average Cross over
and [weekly EMA(13, close) x weekly EMA(34, close)]
// end scan
Pretty simple after all. I like how you thought things through, though, and documented everything. Great form! Easy to follow your thinking and that makes it easier to find the sticky points.
Just a note:
weekly EMA(13) is OK, because the default value (what the scan engine assumes you mean when you don't specify) is the close. But it's good form to specify, so there is no question what you are asking for - e.g. if you misremember the default, it could take a while to find the problem, if there is one.
0 -
Mark, Thank you for helping identify my mistake. I am new at scans so your knowledge and experience is so appreciated. Thank you again0
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