From 3f872e3ff53a2ef0fa85c9ed8da66515001b2eed Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sun, 13 Dec 2020 08:39:32 -0800 Subject: [PATCH] README: adding more information about STOCHRSI. --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 648dc4037..d18f7945a 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,24 @@ first answer to [this question](https://stackoverflow.com/questions/54082459/fat If you wonder why ``STOCHRSI`` gives you different results than you expect, probably you want ``STOCH`` applied to ``RSI``, which is a little different -than the ``STOCHRSI`` which is ``STOCHF`` applied to ``RSI``. +than the ``STOCHRSI`` which is ``STOCHF`` applied to ``RSI``: + +```python +>>> import talib +>>> import numpy +>>> c = numpy.random.randn(100) + +# this is the library function +>>> k, d = talib.STOCHRSI(c) + +# this produces the same result, calling STOCHF +>>> rsi = talib.RSI(c) +>>> k, d = talib.STOCHF(rsi, rsi, rsi) + +# you might want this instead, calling STOCH +>>> rsi = talib.RSI(c) +>>> k, d = talib.STOCH(rsi, rsi, rsi) +``` ### Dependencies