Translation request: Stochastic Close/Close

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #63132 quote
    biwosz
    Participant
    New

    Hi,

    In MT4 Stochastic implementation there are two options for “Price Field”:

    Low/High

    Close/Close

    It looks like only first option (Low/High) is implemented in ProRealtime Stochastic. Can I ask for Close/Close option to be implemented as well? (or translated).

    Following the article in https://www.forexfactory.com/showthread.php?t=36225

    “As far as I can tell, High/Low uses the following formula to calc %K:
    100 x (Recent Close – Lowest Low*) / (Highest High* – Lowest Low*)
    [* for the last N periods, where N is the %K parameter]

    whereas Close/Close uses the following formula to calc %K:
    100 x (Recent Close – Lowest Close*) / (Highest Close* – Lowest Close*)”

    Not sure if this is correct but I have not found alternative source with correct formula.

    Thanks.

    #63160 quote
    Nicolas
    Keymaster
    Master

    Here is the stochastic code with Close/Close:

    r=5
    q=3
    p=14
    REM Computes the highest and lowest prices on p bars
    
    hi = highest[p](close)
    lo = lowest[p](close)
    
    REM Let's build the oscillator
    
    oscillator = ((close - lo) / (hi - lo) * 100)
    
    REM We can now compute the Stochastic lines
    
    lineK = average[q](oscillator)
    lineD = average[r](lineK)
    
    RETURN lineK AS "%K", lineD AS "%D"
    #63321 quote
    biwosz
    Participant
    New

    Many thanks Nicolas, that was really quick! will check it now.

    🙂

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

Translation request: Stochastic Close/Close


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
biwosz @biwosz Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by biwosz
7 years, 11 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/19/2018
Status: Active
Attachments: No files
Logo Logo
Loading...