TradingView
pkr_btc
18 sty 2019 03:22

multiday auto vwap 

Bitcoin / US Dollar Perpetual Inverse Swap ContractBitMEX

Opis

work in progress script to automatically generate multi vwaps - starting with current day and generating the prior 2 days to that.

Informacje o Wersji

start from current day

Informacje o Wersji

Added user options to toggle each available VWAP

Informacje o Wersji

Added optional custom start date VWAP

Informacje o Wersji

Modify calculation to use hlc3 instead of hl2

Informacje o Wersji

Added version numbering

Informacje o Wersji

Remove test indicators from screenshot

Informacje o Wersji

Support for version 4 of pine script
Komentarze
dax50
Hi @stinkbug
I have a problem that when I open a 5min chart on mondays, it doesn´t show the 2- and 3-day VWAPS because pine script seems to be using sunday & saturday into consideration as well. Is anybody experiencing this as well? Is there a fix for that?
kettlekube
Hi! Appreciate your work! Did this break all of a sudden? Just started using it like a week ago. Thanks!
kettlekube
I see. Since it's the first of the month, the code is trying to find September 0 and September -1 - which don't exist. Thanks for your work still! Gonna see if I can tweak this
pkr_btc
@kettlekube, Yeah, didn't find a fix for the issue last time I tried to fix it. Let me know if you manage to find anything that solves the problem and I will also update it here.
kettlekube
@pkr_btc, My brother was able to fix

//declare timestamp minus 1 day (ie: yesterday)
ts1 = timenow - 86400000

plot( useroption1 ? draw_vwap(dayofmonth(ts1), month(ts1), year(ts1)): na, style=line, color=#f48fb1,linewidth=4)

// (I did change the useroption# to make it more intuitive for me)
kettlekube
@pkr_btc, Doesn't fix excluding Sun/Sat thought haha. (I added additional "previous days" to try to catch more previous day VWAPs when it's Monday. Maybe one day we'll figure out how to exclude the weekends

Thanks again for your help!
xyttra
Would love it if this was fixed. I use 2-day vwap but it doesn't work 1st day of each month.
stinkbug
Will you be updating to version 4?
pkr_btc
@stinkbug, what will be the advantage for this? I will if there is a good reason.
stinkbug
@pkr_btc, Just to combine it with other indicators
Więcej