Anchored VWAP Indicator for ThinkorSwim

C

chIza=iChis1A?H

Member
VIP
no bro, it needs to be delayed, so the arrows are fractals, fractals can only form after 2 bars, but it really doesnt matter if they form late because the point of those fractols are to create an anchored vwap so you can tell where future price might bounce.
OK I got your points but I observed another thing too, that is those arrows appeared and then disappeared too and after some time it make a permanent arrow so feel like a miss guided. what if if I buy/sell and then it disappeared gives a wrong alart, how to fix this issue ?? Thanks
 
rad14733

rad14733

Well-known member
VIP
OK I got your points but I observed another thing too, that is those arrows appeared and then disappeared too and after some time it make a permanent arrow so feel like a miss guided. what if if I buy/sell and then it disappeared gives a wrong alart, how to fix this issue ?? Thanks
Choose a different indicator if this one doesn't suit your needs... As coded, many studies/indicators repaint and there is little that can be done to remedy the issue due to reasons previously described... "Fixing" would essentially make them "different" indicators...
 
E

ext99k

Member
@chIza=iChis1A?H look up the William's Vix Fix, it doesn't repaint and it appears to have good efficiency at predicting the end of down trends
 
C

chIza=iChis1A?H

Member
VIP
no bro, it needs to be delayed, so the arrows are fractals, fractals can only form after 2 bars, but it really doesnt matter if they form late because the point of those fractols are to create an anchored vwap so you can tell where future price might bounce.
Thanks germanburrito for an update.
 
G

germanburrito

New member
@chIza=iChis1A?H yeah to be honest that script is not very good because the anchored vwaps keep getting restarted, I would much rather plot individual anchored vwaps, look into shannon, hes the one that has started using vwaps for retail traders.
 
C

chIza=iChis1A?H

Member
VIP
@germanburrito : Could you please send me the link for Shannon script, so can look into. Thanks
 
C

Chris77

New member
VIP
@BenTen , thank you for posting these three indicators. Are the first two (Original and VWAP Anch v0.2) supposed to be used to longer timeframe? like 1h or daily? I looked at them on 1 min and 2 min and arrows and lines dont automatically update. Also, the third one (Intraday) plots a line and nothing much else. Am I missing anything?
I'm interested to know if anyone is looking at any VWAP indicator for 1 or 3 min charts.
Thank you Ben for all your work and support.
 
BenTen

BenTen

Administrative
Staff
VIP
@Chris77 Honestly, I do not understand the first two versions that well. They seems to provide more than what we need in an Anchored VWAP indicator. I would say try either the Intraday Anchored VWAP or the one posted here.

Also, be sure to get a good understanding of what the Anchored VWAP is so you know how to adjust the indicator's settings: https://school.stockcharts.com/doku.php?id=technical_indicators:anchored_vwap
 
S

samoya

Member
VIP
I would like to use the VWAP also for the extended hours (dont know, if that is possible)
But when I change the time the VWAP doesn't work.
Can somebody be kind to help me?
Thank you.

Code:
#yakBro intraday anchoredVWAP excluding extended hours volume 2019

declare hide_on_daily;

def anchorTime = 0930;
def anchorEnd = 1600;

input ShowTodayOnly = yes;
def Today = if GetDay() == GetLastDay() then 1 else 0;
def postAnchorTime = if SecondsFromTime(anchorTime) >= 0 then 1 else 0;
def endAchorTime = if SecondsTillTime(anchorEnd) >= 0 then 1 else 0;

#plot anchorVWAP for intraday
def  volumeSum = compoundValue(1, if postAnchorTime and endAchorTime then volumeSum[1] + volume else 0, volume);
def  volumeVwapSum = compoundValue(1, if postAnchorTime and endAchorTime then volumeVwapSum[1] + volume * vwap else 0, volume * vwap);

plot anchorVWAP = if ShowTodayOnly and !Today then Double.NaN else if anchorTime then volumeVwapSum / volumeSum else Double.NaN;
anchorVWAP.setStyle(Curve.Firm);
anchorVWAP.setDefaultColor(Color.light_ORANGE);
anchorVWAP.setlineWeight(2);

[/IMG]
 
BenTen

BenTen

Administrative
Staff
VIP
@samoya

Look at def anchorTime = 0930; in your code.
 
BenTen

BenTen

Administrative
Staff
VIP
@samoya Don't know if it's going to work but since you want to get VWAP for pre-market hours, you should set it to any premarket hours time.
 
Y

yman

Member
Hi was looking to see if its possible to plot the anchored vwap from days high or low instead of open
thanks
 
C

chIza=iChis1A?H

Member
VIP
I would like to use the VWAP also for the extended hours (dont know, if that is possible)
But when I change the time the VWAP doesn't work.
Can somebody be kind to help me?
Thank you.

Code:
#yakBro intraday anchoredVWAP excluding extended hours volume 2019

declare hide_on_daily;

def anchorTime = 0930;
def anchorEnd = 1600;

input ShowTodayOnly = yes;
def Today = if GetDay() == GetLastDay() then 1 else 0;
def postAnchorTime = if SecondsFromTime(anchorTime) >= 0 then 1 else 0;
def endAchorTime = if SecondsTillTime(anchorEnd) >= 0 then 1 else 0;

#plot anchorVWAP for intraday
def  volumeSum = compoundValue(1, if postAnchorTime and endAchorTime then volumeSum[1] + volume else 0, volume);
def  volumeVwapSum = compoundValue(1, if postAnchorTime and endAchorTime then volumeVwapSum[1] + volume * vwap else 0, volume * vwap);

plot anchorVWAP = if ShowTodayOnly and !Today then Double.NaN else if anchorTime then volumeVwapSum / volumeSum else Double.NaN;
anchorVWAP.setStyle(Curve.Firm);
anchorVWAP.setDefaultColor(Color.light_ORANGE);
anchorVWAP.setlineWeight(2);

[/IMG]
I always has one question whenever I do see such hardcoded "times" in programming code. Futures hours are open for most of the time windows in EACH Day ( Sunday 6 PM ET to Friday 4:15 PM ) , so can we replace def anchorTime = 0000 and def anchorEnd = 1159 , so technically its open for all the day.
 
Teamstoney

Teamstoney

New member
VIP
@germanburrito : Could you please send me the link for Shannon script, so can look into. Thanks
He might be talking about Brian Shannon of Alphtrends. He uses an anchored VWAP and with TC2000 can click on any candle in a chart to base the anchor point...
 
Teamstoney

Teamstoney

New member
VIP
There are a few VWAP indicators here, but they all require that the start datetime be defined explicitly in code.
Is there a way to anchor the start point using the user interface, ie, to drag the start point around the chart in the same way that the trendline drawings are anchored?

here is an example:

https://alphatrends.net/archives/2017/12/use-anchored-vwap-avwap/
Alan, I'm an Alphatrends fan and have been looking for what you are asking for without any luck. Did you ever find a clink to define start point anchored VWAP like TC2000?
 
G

germanburrito

New member
Alan, I'm an Alphatrends fan and have been looking for what you are asking for without any luck. Did you ever find a clink to define start point anchored VWAP like TC2000?
heres a way to do it, because thinkorswim doesnt allow to point and plot. basically what you do is you put a bar counter underneath on the lower studies and it will tell you the bar number that you desire to plot when you hover over it, then you simple click on the vwap line and that will already e plotted and change it to that bar number.

vwap- upper study

Code:
def Data = BarNumber();
input Number_Of_Bar = 1;
input price = close;
def bar =  Data >= Number_Of_Bar;
def pv = if bar then pv[1] + price * volume else 0;
def cumvolume = if bar then cumvolume[1] + volume else 0;
plot vw = pv / cumvolume;
def bars = data - number_Of_Bar;
def sample = if bar then sample[1] + sqr(price - vw) else 0;
def var = sample/bars;
def dev = sqrt(var);

bar counter- lower sudy

declare lower;
plot b = barnumber();
 

Similar threads

Top