Hi Traders, I am looking for a modified version of the vwap study in thinkorswim. I really like the way it is now but the fact that it keeps on resetting every day is not very productive on my daily timeframe. I know you can switch between days, weeks, and months but I want an extended timeframe. For example a "chart" timeframe. Something that is larger than the current ones. A yearly timeframe is also sometimes not very helpful because if there was big volume played in Dec. 2017 and I am playing the stock in Jan. 2018 the data is not valid. I would appreciate any kind of help as google couldnĀ“t help me out here. Thanks in advance, -Diego
Here is the Think or Swim code for multi-day VWAP - you select the start date, you can day 2 days, 50 days, a year, etc. input startDateYyyyMmDd = 20171116; def beyondStartDate = if GetYYYYMMDD() >= startDateYyyyMmDd then 1 else 0; plot VWAP = TotalSum(if beyondStartDate then (((high + low + close) / 3) * volume) else 0) / TotalSum(if beyondStartDate then volume else 0); VWAP.SetDefaultColor(Color.ORANGE); VWAP.SetStyle(Curve.SHORT_DASH); VWAP.SetLineWeight(1);
I dont see that as a real years VWAP.?? I got a proper one coded up in Thinkscript if you are interested? PM me for details.
The Think or Swim VWAP code I posted is correct - it is in perfect sync with the multi-day VWAP codes widely used by many on TradeStation & TradingView. It is accurate. TradingView 1 year VWAP Tradestation 1 year VWAP Think or Swim 1 year VWAP
i think i figured it out input startDateYyyyMmDd = 20181118; input startTimeHHMM = 0930; def beyondStartDate = if GetYYYYMMDD() >= startDateYyyyMmDd then 1 else 0; def beyondStartTime = if SecondsfromTime(startTimeHHMM) >= 0 then 1 else 0; plot VWAP = TotalSum(if beyondStartDate and beyondStartTime then (((high + low + close) / 3) * volume) else 0) / TotalSum(if beyondStartDate and beyondStartTime then volume else 0); VWAP.SetDefaultColor(Color.ORANGE); VWAP.SetStyle(Curve.SHORT_DASH); VWAP.SetLineWeight(1);