Skip to content

Commit

Permalink
README: adding more information about STOCHRSI.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Dec 13, 2020
1 parent 947f480 commit 3f872e3
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Expand Up @@ -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)

This comment has been minimized.

Copy link
@ZaphodBeeblebrox12

ZaphodBeeblebrox12 Apr 5, 2022

So this is the code I used as you advised:

import yfinance as yf
import pandas as pd
from dateutil.relativedelta import relativedelta
import talib
df = yf.download(tickers='fb', start=datetime.datetime.now()-relativedelta(days=200), end= datetime.datetime.now(), interval="1d", progress = False)

rsi = talib.RSI(df['Close'], timeperiod=20)
k, d = talib.STOCH(rsi, rsi, rsi)

The `d` value is 2022-04-04    48.946233
But on TradingView it is showing 92.4. Did I miss something? Any help you can provide would be greatly appreciated! 
```

### Dependencies

Expand Down

3 comments on commit 3f872e3

@bluetyphoon77
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again, but if we are not a programmer and we just want to use the config file, how can we set this up ? thanks

@mrjbq7
Copy link
Collaborator Author

@mrjbq7 mrjbq7 commented on 3f872e3 Dec 18, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bluetyphoon77
Copy link

@bluetyphoon77 bluetyphoon77 commented on 3f872e3 Dec 18, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.