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.

Weekly Full Stochastic Scan (14,3,3)

I am new to and am asking for some help.

I am trying to write a scan where the Weekly Full Stoch (14,3,3) crosses above the 50 line.
Any idea how to do that? Your help would be greatly appreciated.


Gary Bird


  • markdmarkd mod
    edited February 2018
    The condition you are looking for is

    and [weekly Full Stoch %K(14,3,3) x 50]

    But to write a complete scan, you need more. I'm guessing you want a quick start, but it does take a little time and effort to get a handle on the scan language and strategies for writing scans.

    Fortunately, there is some great documentation to get you started:

    This is kind of a cheat sheet that I wrote for myself some time ago:

    Scan writing rules

    Every condition must be enclosed by two brackets – an opening bracket “[“ and a closing bracket “]”.

    [ close > 10 ]

    Every condition must have two terms connected by an operator.
    In the condition above, the terms are “close” and “10”. The operator is “>”.

    There are two kinds of terms, numeric and non-numeric.

    Numeric terms evaluate to a number. Prices, indicators, things like P/E or market cap, etc. are numeric terms because they evaluate to a number.

    Non-numeric terms do not evaluate to a number. They are used to define types or groups of symbols you want to work with, like [group is SP500]. (“group” and “SP500” are the terms, “is” is the operator).

    The two terms in your condition must be both of the same type - numeric or non-numeric.

    Numeric terms will be connected by operators like >, <, x, =, >=, etc.
    Non-numeric terms will be connected by operators like “is”, “contains”, etc. See the documentation for a complete list of operators.

    Indicators have time frames. The most common are daily, weekly and monthly. If you are scanning in the daily time frame, you can just write the indicator as is, without a modifier. If you use a different time frame, you have to specify all terms with a modifier "weekly" or "monthly".


    and [weekly MACD Signal(12,26,9) x weekly MACD Line(12,26,9)]

    and [weekly sma(12, weekly close) x weekly sma(12, weekly close)]

    In the second example, note the "weekly" modifier is used twice - once for sma( ) and once for "close".

    The scan MUST begin with the opening bracket of the first condition.

    [ group is SP500]

    Every subsequent condition must be preceded by the word “and” or “or”.


    [group is SP500]
    and [MACD Line (12,29,9) x MACD Signal(12,29,9)]
    and [Slow Stoch %K(14,3) > 50]

    (this scan demonstrates syntax only, not a “real” scan to use)

    The “or” operator can be used with or without grouping brackets.

    So there are really two forms of “or”
    … or … without brackets
    … [ or ] … with brackets

    If you use the “or” even once in your scan, without brackets around it, you will get results for EVERY condition in the scan (for which there are matching symbols).

    Example: This scan will give you EVERY stock on the NYSE, whether or not they meet the MACD and ROC conditions AND every stock for the MACD condition AND every stock for the ROC condition – even if they are on the NASD or another exchange.

    [exchange is NYSE]
    and [MACD Hist(12,26,9) x 0]
    or [ROC Signal(12,30) > ROC(12)]

    But, if you use the “or” with grouping brackets

    [exchange is NYSE]
    [MACD HIst(12,26,9) x 0]
    [ROC Signal(12,30) > ROC(12)]

    You will get ONLY stocks on the NYSE that meet EITHER the MACD condition or the ROC condition.

    You should include comments in your scan to explain the purpose of the scan and what each line does. Comments make it easier to remember why you wrote the scan and to understand why each condition is there when you come back to it later.

    A comment line begins with “//” or “##”

    // This scan gets NYSE stocks showing bullish MACD or ROC events
    [exchange is NYSE]
    // MACD 12 crosses above the 26
    And [MACD HIst(12,26,9) x 0]
    // ROC is under its signal line
    [ROC Signal(12,30) > ROC(12)]
  • Thanks MakD for taking your time to help me. Much appreciated. I will definitely study and learn from this.
Sign In or Register to comment.