Overbought and Oversold Stochastic Screener

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #151469 quote
    sfjeelani
    Participant
    New

    Dear All

    Can someone please point me in the right direction on finding  Overbought and Oversold conditions for Stochastic indicator. I have just found stochastic and MACD crossover indicator, would be great if screener could pick overbought and oversold conditions for this.

    Stochastic MACD Oscillator

    Many thanks

    #151470 quote
    robertogozzi
    Moderator
    Master

    There you go:

    LookBack = 20
    if barindex >= 26 then
       LL       = lowest[LookBack](low)
       HH       = highest[LookBack](high)
       StEMA12  = (Average[12,1](close) - LL) / (HH - LL)
       StEMA26  = (Average[26,1](close) - LL) / (HH - LL)
       StMACD   = (StEMA12 - StEMA26) * 100
       SigLine  = Average[9,1](StMACD)
       hhmacd   = max(sigline,max(hhmacd,stmacd))
       llmacd   = min(sigline,min(llmacd,stmacd))
       macdperc = ((stmacd-llmacd)/(hhmacd-llmacd))*100
       sigperc  = ((sigline-llmacd)/(hhmacd-llmacd))*100
    endif
    Result = 0
    IF macdperc >= 80 THEN            //OverBought
       Result = 1
    ELSIF macdperc <= 20 THEN         //OverSold
       Result = 2
    ENDIF
    SCREENER[Result](Result AS "1=Ob, 2=Os")
    #151479 quote
    sfjeelani
    Participant
    New

    Many thanks Roberto.

    When I run, it shows syntax error: This variable is not used in the code:sigperc

    Is there I am doing something wrong?

    #151481 quote
    Vonasi
    Moderator
    Master

    Just delete line 12

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Overbought and Oversold Stochastic Screener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
sfjeelani @sfjeelani Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by Vonasi
5 years, 2 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 11/25/2020
Status: Active
Attachments: No files
Logo Logo
Loading...