Rate of Change free

by qualitiedx2 in category Trend at 17/02/2012
Description

The Rate-of-Change (ROC) indicator, which is also referred to as simply Momentum, is a pure momentum oscillator that measures the percent change in price from one period to the next.

Rate of Change

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader

using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = false, AccessRights = AccessRights.None)]
    public class ROC : Indicator
    {
    	[Parameter]
        public DataSeries Source { get; set; }
        
        [Output("Rate Of Change", IsHistogram = true)]
        public IndicatorDataSeries roc { get; set; }
        
        [Output("ROCline")]
        public IndicatorDataSeries rocline { get; set; }
		
		[Output("0", Color= Colors.Gray)]
        public IndicatorDataSeries zero { get; set; }
        
        [Parameter(DefaultValue = 14)]
        public int Period { get; set; }

        public override void Calculate(int index)
        {
        	zero[index] = 0;
            int barsAgo = Math.Min(index, Period);
            roc[index] = (((Source[index] - Source[index-barsAgo])/ Source[index-barsAgo])*100);
            rocline[index]=roc[index];
        }
    }
}
Comments

meloeduardov@gmail.com - July 07, 2018 @ 00:34

Hi, how can I set more than one moving average on the same chart?

evgrinaus - May 28, 2021 @ 12:26

try using the coppock curve

5