#### Howdy, Stranger!

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

# How to scan for an embeded Moving Average of an Indicator

I tried Chartschool to find an answer to my riddle but to no avail.

Let's say I use RSI (14) as my main indicator, and I insert a moving average "behind" it, like the 10-day EMA.
So, how to create a scan that will find the crossover of the RSI over the "embedded" moving average?

I tried the following, but none are working:

[today RSI (14) x EMA 10 (RSI 14)]
[yesterday RSI (14) x EMA 10 (RSI 14)]
[today RSI (14) x yesterday EMA 10 (RSI 14)]

Any ideas how to do it?

• mod
Your logic is correct. Just a syntax issue.

and [RSI (14) x EMA(10, RSI (14))]

So, a couple of notes.

You don't need "today" or "yesterday" when using the "x" operator. It takes care of that for you (which you probably knew, until the first phrase didn't work).

When you use a function like ema( ) or sma( ), you have to follow the format for that function, just as you do for an indicator. You need the parentheses, if there are any, you need the right number of parameters in the right order, and you need the commas between them.

There are many scripting languages out there and they all have different rules. For Stockcharts, you can get the correct format for anything (in the daily time frame version) from the drop downs on the scan workbench. EMA( ) is under "Technical Indicators". You will have to edit the default form, but it gets you started.

The "Writing Scans" link at the bottom of the scan workbench page is worthwhile: