It looks like you're new here. If you want to get involved, click one of these buttons!

- 1.7K All Categories
- 1.3K StockCharts
- 271 SharpCharts
- 65 Other Charting Tools
- 27 Saved Charts and ChartLists
- 830 Scanning
- 41 Data Issues
- 95 Other StockCharts Questions
- 117 Technical Analysis
- 91 Using Technical Analysis
- InterMarket and International
- 11 Market and Breadth Indicators
- 15 Market Analysis
- 64 Trading
- 64 Trading Strategies
- 132 S.C.A.N the StockCharts Answer Network forum
- 40 Using this StockCharts Answer Network forum
- 92 s.c.a.n. archives
- 10 Off-Topic
- 8 The Cogitation & Rumination Emporium
- 2 Forum Test Area

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.

## Comments

and [a - b < c]

"a" and "b" are the EMA and SMA of your choice, like ema(50,close) and sma(10,close). "c" is the difference between them of your choice - 0, 1, 2.5, etc.

But there are some wrinkles.

If you want only positive results (a is above b on the chart, or same thing, b is below a), then

and [a > b]

and [ a - b < c]

only negative results (a is below b):

and [a < b]

and [ a - b > c]

Note the change of the comparison operator for negative numbers from < (less than) to > (greater than). Also "c" would be a negative number: -1, -2.5, etc.

If you don't care whether the result is positive or negative, then you need the absval() function:

and [absval(a-b) < c]

Watch your parentheses with this one.

If you want to compare multiple mas, just repeat the appropriate statements for each comparison.