V2 - MAJOR UPDATE
Multiple improvements have been made:
Now works on charts without volume data. Added a condition which will use a constant value of 1 when volume data is unavailable, resulting in an unweighted 'AP'.
Included additional 'weighted inputs'. These are taken from Weight Gain 4000, for more details refer to that listing. These are best considered experimental. Due to the method of calculation they are probably not well suited to the actual WAP itself, however they may be more useful when used on the updated Side tracker.
The Side tracker functionality has been given a significant overhaul. We now have a global 'Aux' input which can be used to select another indicator when available, this can then be assigned to either the main WAP or the Side from the respective source inputs. Side now has its own custom source menu featuring the weighted inputs. A selection of Pine's onboard filters are available here applied to whichever source is selected (note the VWEMA here is a simple version analogous to a standard VWMA and not the elastic version). The default state is 'close' with no filter making this function as a standard price tracker.
Cosmetic improvements. The colour change conditions for the main WAP are now determined solely by the relative position of the side (for simplicity more than anything). The arithmetic and harmonic WAP lines are now coloured independently, something which will be more noticeable on charts with significant divergence. The fill here is now gradient based becoming more opaque as the price deviates further away and more transparent when price is closest, again this is something which will be more noticeable on volatile charts or those with greater divergence.
Added a third pair of bands.
Updated alerts. These are now solely determined by the side (post-filter if active). The previous buy/sell labels have been replaced with up/down triangles, allowing you to decide for yourself whether these should be regarded as buys or sells. The 'invert condition' function is thus no longer relevant and has been removed. Alert messages have been changed to reflect this ambiguity.
Aside from these, a few changes to the code have been made, mostly renaming and tidying. Overall, the core functionality and design principle remains as before.
Chart demonstration has been updated to better reflect the improvements.