I want to put two standard deviations onto anchored VWAP
Like I have done to VWAP on this chart
shared chart link: https://tos.mx/!HUJOhtRh
Code:
#yakBro intraday anchoredVWAP excluding extended hours volume 2019
# https://usethinkscript.com/threads/anchored-vwap-indicator-for-thinkorswim.171/post-11014
declare hide_on_daily;
def anchorTime = 0800;
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.white);
anchorVWAP.setlineWeight(2);
Like I have done to VWAP on this chart
shared chart link: https://tos.mx/!HUJOhtRh
Last edited by a moderator: