RATE OF MA

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #50711 quote
    PEDRAM.JOKARPEDRAM.JOKAR
    Participant
    Average

    hi

    How i can i code to get the rate of Moving Average?

    #50731 quote
    NicolasNicolas
    Keymaster
    Legend

    You can use the Rate Of Change indicator (ROC):

    in this example, the rate of change over the last 10 periods of a 20 periods simple moving average:

    a = roc[10](average[20])
    
    return a
    PEDRAM.JOKAR thanked this post
    rate-of-change-of-moving-average.png rate-of-change-of-moving-average.png
    #50748 quote
    PEDRAM.JOKARPEDRAM.JOKAR
    Participant
    Average

    can i have the code of ROC?

    #50749 quote
    NicolasNicolas
    Keymaster
    Legend

    What is the ‘Price Rate Of Change – ROC’

    The price rate of change (ROC) is a technical indicator of momentum that measures the percentage change in price between the current price and the price n periods in the past. It is calculated by using the following formula:

    ROC = (Most recent closing price – Closing price n periods ago) / Closing price n periods ago x 100

    #50900 quote
    PEDRAM.JOKARPEDRAM.JOKAR
    Participant
    Average

    actually i am looking for slope of moving average. that code is not as what i want as ROC is already delayed than the slope can be seen in the chart. so what should i do?

    #50903 quote
    BCBC
    Participant
    Master

    please take a look.

    Moving Average Slope

    PEDRAM.JOKAR and Nicolas thanked this post
    #50915 quote
    NicolasNicolas
    Keymaster
    Legend

    that code is not as what i want as ROC is already delayed

    No delay with just 1 period for ROC:

    a = roc[1](average[20])
    
    return a
Viewing 7 posts - 1 through 7 (of 7 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

RATE OF MA


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by NicolasNicolas
8 years, 12 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/27/2017
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...