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.

Stochastics Scan - Wrong Default Values


I am looking for a scan to check for stocks at the base of stochastics getting ready to turn up.

Every scan I have tried keeps taking me back to the top of the stochastics range (80) which as many know, is not a good indicator.

I attached a chart of what I am looking for here on

The following code is wrong. Although it works, it will give results of an over bought indicator at the top of the range. (80)

AND [Slow Stoch %K (70,3) > 50]
AND [ADX Line (14) < 20]
AND [today's Slow Stoch %K (14,3) x 80]

I tried this also...

AND [weekly Slow Stoch %K(14,3) x weekly Slow Stoch %D(14,3)]

Something is definitely wrong with the coding within StockCharts. This cannot be this difficult for something that looks so easy to accomplish.

I want stocks that are at the bottom of the stochastics range. (20) - Turning up as indicated within the chart attached.

Any help would be sincerely appreciated.

Happy New Year and best of luck with all your trades!



  • Your screen shot doesn't show the parameters used, so it's not as helpful as it could be.

    Your code -

    AND [today's Slow Stoch %K (14,3) x 80]

    asks for %K crossing above 80. That appears to be what the screen shot shows (assuming its K(14,3)).

    The first two lines appear to be irrelevant to the Slow K 14,3 crossover problem. You should test your slow K solution first by itself (i.e. comment out the other conditions), then add back those conditions.

    Try this:

    If you want a Slow K crosses above Slow D, when both are below 20, first code for Slow K < 20 and Slow D < 20,
    then code for Slow K x Slow D.

    You may want only Slow D to be below 20, because if a strong price move produces the crossover, it could lift K above 20.

    I've used the scan engine for decades, and it works. That is, it gives you what you actually ask for - which is not always what you THOUGHT you asked for. Not criticizing - I've been there myself more than once.
  • Thank you for your time and response.

    I attached another chart to give you a better idea of what I am looking for,

    With the default settings within StockCharts, the results always give you results at the top of the Stochastics range which is around 80. (See Attached)

    I need the results to show me stocks that are turning up from the bottom of the range. (20)

    I tried K < 20 & D < 20 and it only returned 1 stock.

    Is there any other way / code to accomplish this scan?

    Thanks again for your time and help!

    xoxo Kimberly

  • This code asks for the Slow Stoch K to be crossing 80 today.

    AND [Slow Stoch %K (70,3) > 50]
    AND [ADX Line (14) < 20]
    AND [today's Slow Stoch %K (14,3) x 80]

    If you want to find crossing up from below 20 you need to change

    AND [today's Slow Stoch %K (14,3) x 80]


    AND [today's Slow Stoch %K (14,3) x 20]

    Or if you want to see ones that had Slow Stoch K below 20 in the recent past you could use a MIN

    and [min(10,Slow Stoch %K(14,3)) < 20] (this was not checked for syntax)

    This would show ones that had a, or still have a, Slow Stoch K below 20 in the past 10 days.

  • To best troubleshoot your issues, you would need to post your entire scan code and the chart setting for the Slow Stoch you are showing. Sometimes I have a different criteria on my chart than what I'm scanning for. Like I have a default weekly chart I'm using and I'm scanning for daily data. It definitely can have me scratching my head wondering why the scan returned a symbol that is looking different on the chart.
  • Thank you for your time and response.

    I tried both of the syntax you listed, no results showing which I find very hard to believe.

    I did have those in a scan before my post and they did not work.

    I find it hard to believe that with thousands of stocks from 5 and over, the syntax is not returning any results. This is why I posted the question as a coding problem within StockCharts.

    As you can see from my examples above, I've tried several different syntax options.

    I cannot believe something so simple is so difficult to accomplish.

    So the only syntax that returns one (1) stock is the following code:

    and [Slow Stoch %K(14,3) < 20.0]

    and [Slow Stoch %D(14,3) < 20.0]

    There cannot be only 1 stock turning up from being oversold using Stochastics.

    I am shocked.

    Any other ideas?

    Thanks again for your time and help!

    xoxo Kimberly
  • markdmarkd mod
    edited January 18
    I ran this code, which is yours, copied and pasted, (except for group is sp500) and got 24 hits:

    [group is sp500]

    and [Slow Stoch %K(14,3) < 20.0]

    and [Slow Stoch %D(14,3) < 20.0]

    That suggests that your additional conditions are limiting your results. Keep in mind, the more conditions you specify, the fewer results you will get. Also, some combinations of conditions may be fighting with each other, so to speak. For instance, your K 70 > 50 may be limiting the number of K 20 results < 20.

    On the other hand, you can set the run date to past dates with the calendar tool (Starting 0 trading days before... located above the scan window - click on the zero to select a different run date). This allows you to test a scan in different market states - e.g. right now the market is generally rising short term (well, not today). A couple of months or more ago, the market was generally falling. The number of hits a particular scan will get varies with the market, sometimes drastically.

  • I think the issue has to do with the other unknowns, like the universe and other parts of the scan that weren't posted.

    running the below against the SP1500 returns 7 results for today

    // this code looks for either the K line or the D line crossing above 20

    [[group is SP400] or [group is SP500] or [group is SP600]]

    and [[Slow Stoch %K(14,3) x 20.0] or [Slow Stoch %D(14,3) x 20.0]]

  • Kimberly7Kimberly7
    edited January 18
    I want to thank everyone for posting. I am still trying to figure this code out. If I remove some of the other syntax, I will not get what I need in the scan. I think, StockCharts will not allow me to search the multiple criteria I am trying to search on. If I get any good results, I will post the search for everyone to have. Thanks again for all your help! Best of luck with all your trades! xoxo Kimberly
  • If you can clearly explain what it is that you are looking to find, then it is much easier to assist. This forum is for users to share ideas and assist others.

    The original code you shared looks like this:

    AND [Slow Stoch %K (70,3) > 50]
    AND [ADX Line (14) < 20]
    AND [today's Slow Stoch %K (14,3) x 80]

    A good way to troubleshoot is to "remove" some of the criteria so the scan engine ignores that line(s) in the scan. To "remove" the lines you put a double backslash // in front of the line(s) you would like to remove.

    AND [Slow Stoch %K (70,3) > 50]
    //AND [ADX Line (14) < 20]
    //AND [today's Slow Stoch %K (14,3) x 80]

    This is often a good method to troubleshoot a scan that isn't providing what you think it should be.

    The above would look at your universe and return those that have a Slow Stock K 70,3 greater than 50. You could then look at those charts and see if they are in alignment with your goal of the scan. If not, you can change that 1st line to better align with what you want to see, and run again.

    Once you are happy with what you are seeing in the results so far, you can remove the // in front of the next line and run the scan to see the results.

    AND [Slow Stoch %K (70,3) > 50]
    AND [ADX Line (14) < 20]
    //AND [today's Slow Stoch %K (14,3) x 80]

    Run it again and review the results. Repeat the modification of the 2nd line if necessary, run/review and move to the 3rd line.

    We know that the third line is never going to show things with a Slow Stoch K around 20. That code is looking for a cross of 80, so the only ones that will show are the ones that have a Slow Stoch K that is 81 and above.

    If you get stuck, post the code in a response for assistance. Or a better description of what you expect to see vs what you are seeing.

  • markdmarkd mod
    edited January 19

    I assure you, the scan engine will return what you ask for. I have written literally thousands of scans. The scan language itself is flexible enough to accommodate any logical possibility. And the results are always correct. I check.

    As @lmkwin suggests, if you want to share you entire scan, we can look for any kinks and suggest alternatives.

    It might also be helpful to describe in words what you are looking for, and not just the code.
Sign In or Register to comment.