ZWAP (ZigZag Anchored VWAP) [Kioseff Trading]Hello!
Quick script showcasing the new polyline function for Pine Script!
Features
Up to 100 high/low pivot points auto anchored VWAP
Visible range auto anchored VWAP
Curved ZigZag (Adjustable!)
With the new polyline function, auto-anchored VWAP at specific price points is more viable.
When using line.new() only 500 lines can exist on the chart concurrently and, since VWAP is calculated on every update, a "proper" VWAP drawn using line.new() can extend 500 bars at most, to which no additional VWAP lines can be drawn after.
Of course, when using the plot() function a VWAP line will draw on every bar; however, this method isn't highly compatible with auto-anchoring VWAP lines.
However!
A polyline, from beginning to end irrespective of the number of coordinates used, constitutes 1 polyline; 100 can exist simultaneously with 10,000 xy coordinates per line.
The image above shows an attempt to draw the same auto-anchored VWAP lines using the line.new() function. Not an ideal outcome!
The image above shows the same attempt using the polyline.new() function!
Very nice (:
The image above shows the indicator auto anchoring to zig zag turning points.
Subsequent to a new anchoring, VWAP is calculated for the following bars - up to the current bar.
Thank you for checking this out; if you have any ideas to spice it up feel free to comment!
Autoanchoredvwap
VWAP Market Session AnchoredVWAP Market Session Anchored differs from the traditional VWAP or VWAP Auto Anchored indicator in that the Volume Weighted Average Price calculation is automatically anchored to four major market session starts: Sydney, London, Tokyo, New York.
Settings
Source: the source for the VWAP calculation.
Offset: changing this number will move the VWAP either Forwards or Backwards, relative to the current market. Zero is the default.
Band: enabling this will show Standard Deviation bands.
Band Multiplier: the value the Standard Deviation bands will be multiplied by before being plotted on the chart.
Sessions : enabling the sessions will plot the respective anchored VWAP on chart.
Custom: enabling this will show a custom user-defined session.
Custom UTC : the custom session is defined by a starting UTC hour followed by the ending UTC hour.
Usage
Similar to the traditional VWAP, VWAP Market Session Anchored is a technical analysis tool used to measure the average price weighted by volume. VWAP Market Session Anchored can be used to identify the trend during a specific market session.
Limitations
When setting a custom session, be mindful that calculations are based off of the Coordinated Universal Time (UTC) time, you must convert your local time zone to UTC in order to have an accurate representation of your custom session.
It is not recommended to use this indicator on timeframes above 1 hour as market sessions only last a few hours.