talib.STOCHRSI
Calculates the Stochastic Relative Strength Index and returns the fast %K and fast %D.
talib.STOCHRSI(inReal)
talib.STOCHRSI(inReal, optInTimePeriod)
talib.STOCHRSI(inReal, optInTimePeriod, optInFastK_Period)
talib.STOCHRSI(inReal, optInTimePeriod, optInFastK_Period, optInFastD_Period)
talib.STOCHRSI(inReal, optInTimePeriod, optInFastK_Period, optInFastD_Period, optInFastD_MAType)Examples
Compute the Stochastic Relative Strength Index from the latest K-lines.
javascript
function main() {
var records = exchange.GetRecords()
if (!records) return
var ret = talib.STOCHRSI(records)
// Output: [fast %K array, fast %D array]
Log(ret)
}
python
import talib
def main():
records = exchange.GetRecords()
if not records:
return
ret = talib.STOCHRSI(records.Close)
# Output: (fast %K array, fast %D array)
Log(ret)Returns
| Type | Description |
array | Two-dimensional array: [fast %K array, fast %D array] (a tuple in the same order in Python). |
Arguments
| Name | Type | Required | Description |
inReal |
| Yes | K-line array (close prices are used) or numeric array; in Python, pass a numeric array such as |
optInTimePeriod | number | No | Calculation period. Default |
optInFastK_Period | number | No | Fast %K period. Default |
optInFastD_Period | number | No | Fast %D period. Default |
optInFastD_MAType | number | No | Moving average type of fast %D; see the MAType table on the |
See Also
Remarks
TA-Lib equivalent: STOCHRSI(Records[Close],Time Period = 14,Fast-K Period = 5,Fast-D Period = 3,Fast-D MA = 0) = [Array(outFastK),Array(outFastD)].