ROCR100
Rate of change ratio 100 scale: (price/prevPrice)*100ROCR100
real = ROCR100(close, timeperiod=10)
Plot
![Rate of change ratio 100 scale: (price/prevPrice)*100](https://app.cloudquant.com/docstatic/talib/momentum-indicators/rocr100_3600.png)
Working Example
from cloudquant.interfaces import Strategy
from collections import OrderedDict
import ktgfunc
import talib
class WE_ROCR100(Strategy):
def on_start(self, md, order, service, account):
# symbol and timestamp
print(self.symbol + ": " + service.time_to_string(service.system_time))
daily_bars = md.bar.daily(start=-100)
close = daily_bars.close
real = talib.ROCR100(close, timeperiod=10)
# get the date values
dates = service._context.market._storage.market_hours.keys()
dateList = []
for date in dates:
dateList.append(str(date.strftime('%Y-%m-%d')))
dates = sorted(dateList, reverse=True)[1:101]
dates.sort()
dict = OrderedDict()
dict['date'] = dates
dict['close'] = close
dict['real'] = real
symbol = 'ROCR100: ' + self.symbol
print ktgfunc.talib_table(symbol, 1, dict)
Console
MSFT: 2017-02-09 09:30:00.000000
ROCR100: MSFT | ||
---|---|---|
Input | Output | |
date | close | real |
2016-09-16 | 56.87 | nan |
2016-09-19 | 56.55 | nan |
2016-09-20 | 56.43 | nan |
2016-09-21 | 57.37 | nan |
2016-09-22 | 57.43 | nan |
2016-09-23 | 57.04 | nan |
2016-09-26 | 56.52 | nan |
2016-09-27 | 57.56 | nan |
2016-09-28 | 57.64 | nan |
2016-09-29 | 57.01 | nan |
2016-09-30 | 57.21 | 100.61 |
2016-10-03 | 57.03 | 100.86 |
2016-10-04 | 56.86 | 100.76 |
2016-10-05 | 57.25 | 99.79 |
2016-10-06 | 57.35 | 99.86 |
2016-10-07 | 57.41 | 100.64 |
2016-10-10 | 57.65 | 102.00 |
2016-10-11 | 56.81 | 98.69 |
2016-10-12 | 56.73 | 98.41 |
2016-10-13 | 56.54 | 99.16 |
2016-10-14 | 57.03 | 99.69 |
2016-10-17 | 56.84 | 99.65 |
2016-10-18 | 57.27 | 100.73 |
2016-10-19 | 57.14 | 99.81 |
2016-10-20 | 56.87 | 99.15 |
2016-10-21 | 59.26 | 103.22 |
2016-10-24 | 60.59 | 105.10 |
2016-10-25 | 60.58 | 106.64 |
2016-10-26 | 60.22 | 106.16 |
2016-10-27 | 59.70 | 105.59 |
2016-10-28 | 59.47 | 104.27 |
2016-10-31 | 59.52 | 104.72 |
2016-11-01 | 59.40 | 103.71 |
2016-11-02 | 59.03 | 103.30 |
2016-11-03 | 58.81 | 103.42 |
2016-11-04 | 58.32 | 98.41 |
2016-11-07 | 60.01 | 99.05 |
2016-11-08 | 60.06 | 99.15 |
2016-11-09 | 59.77 | 99.24 |
2016-11-10 | 58.31 | 97.67 |
2016-11-11 | 58.62 | 98.58 |
2016-11-14 | 57.73 | 97.00 |
2016-11-15 | 58.87 | 99.11 |
2016-11-16 | 59.65 | 101.05 |
2016-11-17 | 60.64 | 103.11 |
2016-11-18 | 60.35 | 103.49 |
2016-11-21 | 60.86 | 101.41 |
2016-11-22 | 61.12 | 101.76 |
2016-11-23 | 60.40 | 101.06 |
2016-11-25 | 60.53 | 103.81 |
2016-11-28 | 60.61 | 103.39 |
2016-11-29 | 61.09 | 105.82 |
2016-11-30 | 60.26 | 102.36 |
2016-12-01 | 59.20 | 99.25 |
2016-12-02 | 59.25 | 97.71 |
2016-12-05 | 60.22 | 99.78 |
2016-12-06 | 59.95 | 98.50 |
2016-12-07 | 61.37 | 100.41 |
2016-12-08 | 61.01 | 101.01 |
2016-12-09 | 61.97 | 102.38 |
2016-12-12 | 62.17 | 102.57 |
2016-12-13 | 62.98 | 103.09 |
2016-12-14 | 62.68 | 104.02 |
2016-12-15 | 62.58 | 105.71 |
2016-12-16 | 62.30 | 105.15 |
2016-12-19 | 63.62 | 105.65 |
2016-12-20 | 63.54 | 105.99 |
2016-12-21 | 63.54 | 103.54 |
2016-12-22 | 63.55 | 104.16 |
2016-12-23 | 63.24 | 102.05 |
2016-12-27 | 63.28 | 101.79 |
2016-12-28 | 62.99 | 100.02 |
2016-12-29 | 62.90 | 100.35 |
2016-12-30 | 62.14 | 99.30 |
2017-01-03 | 62.58 | 100.45 |
2017-01-04 | 62.30 | 97.93 |
2017-01-05 | 62.30 | 98.05 |
2017-01-06 | 62.84 | 98.90 |
2017-01-09 | 62.64 | 98.57 |
2017-01-10 | 62.62 | 99.02 |
2017-01-11 | 63.19 | 99.86 |
2017-01-12 | 62.61 | 99.40 |
2017-01-13 | 62.70 | 99.68 |
2017-01-17 | 62.53 | 100.63 |
2017-01-18 | 62.50 | 99.87 |
2017-01-19 | 62.30 | 100.00 |
2017-01-20 | 62.74 | 100.71 |
2017-01-23 | 62.96 | 100.19 |
2017-01-24 | 63.52 | 101.40 |
2017-01-25 | 63.68 | 101.69 |
2017-01-26 | 64.27 | 101.71 |
2017-01-27 | 65.78 | 105.06 |
2017-01-30 | 65.13 | 103.88 |
2017-01-31 | 64.65 | 103.39 |
2017-02-01 | 63.58 | 101.73 |
2017-02-02 | 63.17 | 101.40 |
2017-02-03 | 63.68 | 101.50 |
2017-02-06 | 63.64 | 101.08 |
2017-02-07 | 63.43 | 99.86 |
2017-02-08 | 63.34 | 99.47 |