Rate of change ratio 100 scale
ROCR100 scales the rate of change ratio to a percentage. It is calculated as (price/prevPrice)*100.
Method
tm.ta.rocr100(source, timeperiod)
Inputs
Parameter | Argument type | Description | Default Value |
---|---|---|---|
source | pd.Series | Input data series | - |
timeperiod | int | Number of periods for the indicator | 10 |
Outputs
Output | Type |
---|---|
rocr100 | np.ndarray |
Example usage
import tradomate as tm
@tm.strategy()def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Rate of change ratio 100 scale: (price/prevPrice)*100 rocr100 = tm.ta.rocr100(data.close, timeperiod=10)
# Get the last value and print last_value = rocr100.iloc[-1] tm.log(f"Last value of Rate of change ratio 100 scale: (price/prevPrice)*100 is {last_value}")
# Plot the values of rocr100 tm.plot(rocr100, title="Rate of change ratio 100 scale: (price/prevPrice)*100", overlay=False)