Skip to content

IIndicatorsAccessor.PriceROC

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

The Price Rate of Change indicator is the percentage change of the current price and the price N periods ago.

Definition

PriceROC PriceROC(DataSeries source, int periods)
api.Indicators.PriceROC(source: DataSeries, periods: int) -> PriceROC

Parameters

Name C# type Python type Description
source DataSeries DataSeries The source data used for calculation.
periods int int The value of the periods used for calculation.

Returns PriceROC — Price Rate of Change indicator instance

Examples

var priceRoc = Indicators.PriceROC(Bars.ClosePrices, 12);
Print("Price ROC(12): {0}%", priceRoc.Result.LastValue);
priceRoc = api.Indicators.PriceROC(api.Bars.ClosePrices, 12)
api.Print(f"Price ROC(12): {priceRoc.Result.LastValue}%")