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.

DIVERGENCE (Looking for Shorts)

I'm looking for stocks where todays close is higher than say its 90 day SMA and its Full Stochastic "D" is lower than its 90 day SMA. I'm having a lot of trouble with the second part.


  • Options
    markdmarkd mod
    edited September 2016
    I'm assuming you mean you are having trouble writing the scan, not with the expected results.

    I think this should do it:

    and [Full Stoch %D(14,3,3) < sma(90, Full Stoch %D(14,3,3))]

    There are two tricks to it - one is knowing that you can put Full Stoch() inside the sma() function, instead of "close", and the second is, you have to remember you are using TWO functions when you do that. Both functions use opening and closing parentheses, so when you put one function inside the other function, you need to remember to use TWO closing parentheses. If you only use one, like this,

    and [Full Stoch %D(14,3,3) < sma(90, Full Stoch %D(14,3,3)]

    the check syntax will give you an error, but it will say something like "could not parse....expecting an integer' or some other message that doesn't explicitly say you need a second closing parenthesis. But it does tell you correctly exactly which phrase is the problem.

    If that doesn't work for you, post what you have.

  • Options
    MarkD - Bingo! The extra set of parenthesis did the trick. Thank you so much-RV
Sign In or Register to comment.