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

can i merging two indictors #378

Closed
Ylelmon opened this issue Aug 23, 2021 · 7 comments
Closed

can i merging two indictors #378

Ylelmon opened this issue Aug 23, 2021 · 7 comments
Labels
good first issue Good for newcomers info Informational question Further information is requested

Comments

@Ylelmon
Copy link

Ylelmon commented Aug 23, 2021

If I wrote help(ta.inductor)

It will print calculations of inductors so can I merge tow indicators to become one indictor ?

@twopirllc twopirllc added good first issue Good for newcomers info Informational question Further information is requested labels Aug 23, 2021
@Ylelmon Ylelmon closed this as completed Aug 23, 2021
@twopirllc
Copy link
Owner

@Ylelmon?

@Ylelmon Ylelmon changed the title How to calculate indicator can i merging two indictors Aug 23, 2021
@Ylelmon
Copy link
Author

Ylelmon commented Aug 23, 2021

If I wrote help(ta.inductor)

It will print calculations of inductors so can I merge tow indicators to become one indictor ?

@twopirllc
Copy link
Owner

@Ylelmon,

so can I merge tow indicators to become one indictor ?

Yes, you can merge two indicators or chain or compose them. You can even create your own indicator which does that and add it to the library or your forked copy of the library.

What indicators were you attempting to merge? Please be detailed.

Thanks,
KJ

@Ylelmon
Copy link
Author

Ylelmon commented Aug 24, 2021

Zscore and Vwap

@twopirllc
Copy link
Owner

@Ylelmon,

To clarify, you want the zscore of vwap?

If so, here is a basic outline.

import pandas as pd
import pandas_ta as ta

df = # your ohlcv data

# VWAP requires the DataFrame index to be a DatetimeIndex.
# Replace "datetime" with the appropriate column from your DataFrame
df.set_index(pd.DatetimeIndex(df["datetime"]), inplace=True)

# Get vwap and add it to the df 
vwap = df.ta.vwap(append=True)

# Input vwap into zscore and add result to the df
zs = df.ta.zscore(close=vwap, append=True)

print(df.columns) # Verify they are there

# Quick plot of zscore(vwap)
zs.plot(figsize=(16,3), color=["blue"], grid=True).axhline(0, color="black")

Hope this helps!

Kind Regards,
KJ

@Ylelmon
Copy link
Author

Ylelmon commented Aug 24, 2021

Yoooh thx

@SUVIANY
Copy link

SUVIANY commented Oct 9, 2021

hey KJ
thx for all support u are offering

I try it but i want to use my on period how can i do this ?

@twopirllc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers info Informational question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants