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

volume weigted macd indicator #106

Closed
tarantula3535 opened this issue Aug 18, 2020 · 4 comments
Closed

volume weigted macd indicator #106

tarantula3535 opened this issue Aug 18, 2020 · 4 comments
Labels
Enhancement New feature or request Good first issue Good for newcomers

Comments

@tarantula3535
Copy link

tarantula3535 commented Aug 18, 2020

hi i use this indicator.. anyone should helpfull.. here is the tradingview's link
https://tr.tradingview.com/script/wVe6AfGA-VOLUME-WEIGHTED-MACD-V2-VWMACDV2-BY-KIVAN%C3%87-fr3762/

def vwmacd(dataframe, fastperiod=12, slowperiod=26, signalperiod=9):
# //author: KIVANC @fr3762 on twitter
# https://tr.tradingview.com/script/wVe6AfGA-VOLUME-WEIGHTED-MACD-V2-VWMACDV2-BY-KIVAN%C3%87-fr3762/
# study("VOLUME WEIGHTED MACD V2", shorttitle="VWMACDV2")
# fastperiod = input(12,title="fastperiod",type=integer,minval=1,maxval=500)
# slowperiod = input(26,title="slowperiod",type=integer,minval=1,maxval=500)
# signalperiod = input(9,title="signalperiod",type=integer,minval=1,maxval=500)
# fastMA = ema(volume*close, fastperiod)/ema(volume, fastperiod)
# slowMA = ema(volume*close, slowperiod)/ema(volume, slowperiod)
# vwmacd = fastMA - slowMA
# signal = ema(vwmacd, signalperiod)
# hist= vwmacd - signal
# plot(vwmacd, color=blue, linewidth=2)
# plot(signal, color=red, linewidth=2)
# plot(hist, color=green, linewidth=4, style=histogram)
# plot(0, color=black)
    import talib.abstract as ta
    df = dataframe.copy()
    df["fastMA"] = ta.EMA(df["volume"]*df["close"], fastperiod) / ta.EMA(df["volume"], fastperiod)
    df["slowMA"] = ta.EMA(df["volume"]*df["close"], slowperiod) / ta.EMA(df["volume"], slowperiod)
    df["vwmacd"] = df["fastMA"] - df["slowMA"]
    df["signal"] = ta.EMA(df["vwmacd"], signalperiod)
    df["hist"] = df["vwmacd"] - df["signal"]
    df = df.drop(
        columns=['fastMA', 'slowMA', 'high', 'low', 'close', 'open']
    )
#return columns vwmacd,signal,hist
    return df
@xmatthias xmatthias added Enhancement New feature or request Good first issue Good for newcomers labels Aug 19, 2020
@ozandem
Copy link

ozandem commented Sep 28, 2020

Hi tarantula3535 could you provide any information how to use this indicator in strategy?

Thank you

@tarantula3535
Copy link
Author

hi...you can use just like macd... vmacd cross signal...
If you want to use a sample, I can send it after a few hours when it is on the pc ..

@ozandem
Copy link

ozandem commented Sep 28, 2020

It will be greatful if you could provide any sample with this indicator.

@tarantula3535
Copy link
Author

call the library and in the populate indicators
image
write that code...
and whatever you want to use in the buy/sell trend cross? or >
image

xmatthias added a commit that referenced this issue Sep 29, 2020
As posted in #106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants