groks

Origin VWAP: OVWAP

groks Uppdaterad   
Draw a VWAP support/resistance line anchored to the origin of the data series (like a daily VWAP, but from the beginning of time, never resetting).

Ideally the origin would be the first bar after the IPO. Tradingview (or your connected broker) doesn't always have a complete dataset, and in that case the OVWAP will be 'wrong', but converging to the correct value over time.

You can try to simulate this with the built-in VWAP indicator but it has several bugs and limitations. Firstly, the longest time period is century, but it is not 100 years, ie. a rolling century but the beginning of the century: 21 years ago. Secondly, even if your dataset is less than 21 years, if you use a lower time frame then the built-in VWAP's origin becomes the left-most loaded bar (about 5,000 bars ago) - it will draw the wrong value. The new Anchored VWAP drawing tool can't be used on lower time frames as it won't draw the line at all unless it sees the point where you anchored it.

You may want to cut 'n paste this code to use in some larger strategy. Unfortunately that's probably not possible. This script uses the 'resolution=' option of 'study()' set to '1W', so the whole script runs at the 1 week resolution. You would think it would be possible to instead use the 'security()' function to request data at the '1W' resolution, but it just resamples the current data set and so is limited to the rightmost 5,000 bars.

Look in the options to enable standard deviation lines.
Versionsinformation:
Update standard deviation bands calculation.
Versionsinformation:
(Fix example chart to remove stray drawings)
Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?