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.

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?

Best Answers

  • markdmarkd mod
    edited June 2018 Accepted Answer
    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:

    Also, this previous question has a quick and dirty summary of scan rules in one of the posts:
  • PeterPan8PeterPan8
    Accepted Answer
    Thank you Mark! You made my day! And many thanks for taking the time to answer all those questions from pros and newbies alike... You're the man :-)
  • markdmarkd mod
    Accepted Answer
    Thanks for the kind words. Appreciate the acknowledgment.
Sign In or Register to comment.