Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
Talib
Overlap Studies
Momentum Indicators
Volume Indicators
Volatility Indicators
Cycle Indicators
Price Transform
Statistic Functions
Math Transform
Math Operators
Pattern Recognition
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

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

TypeDescription

array

Two-dimensional array: [fast %K array, fast %D array] (a tuple in the same order in Python).

Arguments

NameTypeRequiredDescription

inReal

Record array / numeric array

Yes

K-line array (close prices are used) or numeric array; in Python, pass a numeric array such as records.Close.

optInTimePeriod

number

No

Calculation period. Default 14.

optInFastK_Period

number

No

Fast %K period. Default 5.

optInFastD_Period

number

No

Fast %D period. Default 3.

optInFastD_MAType

number

No

Moving average type of fast %D; see the MAType table on the Talib page. Default 0 (SMA).

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)].