Smoothed Williams %r

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #217907 quote
    neddyboyneddyboy
    Participant
    New

    Hi,

    Does anyone know how to code a smoothed Williams % indicator?

    I’ve search the code library but can’t find anything.

    Thanks

    Jim

    #217960 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    This is the code by Nicolas:

    //PRC_WilliamsRpercent - 01.09.2016 - Nicolas @ www.prorealcode.com
    //
    period = 14
    hh     = highest[period](high)
    ll     = lowest[period](low)
    Wp     = ((hh-close)/(hh-ll))*-100
    return Wp as "Williams R percent", -20 as "-20 level", -80 as "-80 level"

    you can add the smoothing just BEFORE the last line:

    //PRC_WilliamsRpercent - 01.09.2016 - Nicolas @ www.prorealcode.com
    //
    period = 14
    hh     = highest[period](high)
    ll     = lowest[period](low)
    Wp     = ((hh-close)/(hh-ll))*-100
    Smooth = average[period,0](Wp)
    return Wp as "Williams R percent", Smooth as "Williams R% Smoothed", -20 as "-20 level", -80 as "-80 level"

    you can  change the type of MA (o=sma, 1=ema, etc… as from https://www.prorealcode.com/documentation/average/) and periods.

    neddyboy thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Smoothed Williams %r


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
neddyboy @neddyboy Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
3 years, 2 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/19/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...