Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feed data to calculate stochrsi #26

Closed
CnsAd opened this issue Mar 25, 2019 · 6 comments
Closed

feed data to calculate stochrsi #26

CnsAd opened this issue Mar 25, 2019 · 6 comments

Comments

@CnsAd
Copy link

CnsAd commented Mar 25, 2019

I use the below code to calculate the stochrsi:

klines = bot.client.get_klines(symbol=coin, interval=intv)
    array = np.array(klines, dtype='f8')
    df = pd.DataFrame(data=array[:, 0:6], columns=["date", "open", "high", "low", "close", "volume"])
    fastd, fastk = ti.stochrsi(np.array(df['close'].values), 14)

But I receive an Error: ValueError: too many values to unpack (expected 2)
What's wrong?

@CnsAd CnsAd closed this as completed Mar 28, 2019
@CnsAd CnsAd reopened this Mar 28, 2019
@CnsAd
Copy link
Author

CnsAd commented Mar 28, 2019

I noticed that it calculates only ONE output as StochRSI. What if I want to have fastd and fastk as usual StochRSI like what we see in any exchanges or tradingview.com?

@codeplea
Copy link
Member

Are you sure you want StochRSI? It sounds like you just want Stoch.

@CnsAd
Copy link
Author

CnsAd commented Mar 28, 2019

I used ti.stochrsi and I want Stoch RSI

@CnsAd
Copy link
Author

CnsAd commented Mar 28, 2019

image

@codeplea
Copy link
Member

Ok, so Tulip Indicators implements StochRSI as originally described in Stocks & Commodities V. 11:05: Stochastic RSI And Dynamic Momentum Index by Tushar Chande and Stanley Kroll.

It sounds like what you want, is to apply Stoch to RSI, which is actually also pretty common. Currently TI won't do this, but it will likely be added in the near future. More info here: TulipCharts/tulipindicators#23

Anyway, I think you can run RSI and then run STOCH on the result to obtain what you're looking for.

@CnsAd
Copy link
Author

CnsAd commented Mar 28, 2019

TY

@CnsAd CnsAd closed this as completed Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants