RATE OF MA

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

    hi

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

    #50731 quote
    Nicolas
    Keymaster
    Master

    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
    #50748 quote
    PEDRAM.JOKAR
    Participant
    Average

    can i have the code of ROC?

    #50749 quote
    Nicolas
    Keymaster
    Master

    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.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
    BC
    Participant
    Master

    please take a look.

    Moving Average Slope

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

    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.

RATE OF MA


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

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

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