Anchored VWAP — ForexBestRobots edition 1.01 — MT5
SOURCE ONLY. No ready EX4/EX5. Native MQL compilation, rendering, dragging,
broker history synchronization, real messages and sound NOT verified.
Actual functions/drivers tested outside MetaTrader with modeled APIs; this is
not a native terminal test and not a profit backtest.

INSTALL
Extract ZIP. MetaTrader > File > Open Data Folder > MQL5.
Copy Indicators there; keep upstream separately as the unchanged reference.
Open Indicators/Anchored_VWAP_ForexBestRobots.mq5 in matching desktop MetaEditor; F7.
Inspect errors/warnings. Refresh Navigator > Indicators and attach to a demo
chart with ample history. No DLL or extra include needed. Not directly
installable in MetaTrader mobile. Modified source UTF-16LE BOM.

CALCULATION
V=sum(v*p)/sum(v), default p=(H+L+C)/3. Other choices HLCC/4, HL/2, Close, Open.
MT4: broker tick volume. MT5: VOLUME_TICK default, or VOLUME_REAL if provided.
One representative per candle, not each individual executed trade.
Population variance=sum(v*(p-V)^2)/sum(v). No n-1 sample correction.
Bands V +/- SDMultiplier*SD, default2.0. Weighted Welford state reduces
cancellation. Hidden buffers3/4/5 now mean/weight/M2, not upstream raw sums.
Zero weight adds nothing; before any positive weight output empty, afterwards
carry cumulative state. NEVER replace missing volume with one. Invalid price
or negative/nonfinite weight empties calculation until valid recalculation.
MT5 real volume often absent on spot Forex; zero real volume gives no curve.
Our website's HistData examples count supplied quote records as weights;
the original Volume field is zero and NOT used. These are explanatory data,
not native broker history, exchange volume or a market-wide cost basis.

ANCHOR / CALENDAR
One active anchor. Default BarsBack100 includes anchor shift100 through0:
normally101 candles. Short history clamps default shift to oldest loaded bar.
Calendar mode chooses first AVAILABLE candle of the current period; incomplete
history truncates that initial period. Broker chart clock, Monday-based week.
No timezone conversion. Our figures use UTC and explicit EST+5 conversion.
Drag selects the whole candle containing the chosen time, not a tick-level start.
AutoUpdate=true: bars-back resets every new candle; calendar resets at the
next period boundary. A manual drag holds between those resets. Use false
to hold it. Re-anchoring replaces the previous curve, not a stack of sessions.
Anchors in future/before loaded history give empty output, not a current-bar
fallback. Load history or choose a covered anchor. Reattach after corrected
old history if a complete refresh is needed. Many/long ranges can slow terminal.

ALERTS
Default all3 event switches OFF, AlertPopup ON, sound/email/push OFF.
VWAP up: Close1>V1 AND Close2<=V2; down opposite. Two CLOSED chart candles.
Band equality counts inside. Exit inside->outside; return outside->inside.
Both evaluated candles require positive SELECTED volume.
ShowBand=false hides bands but does not disable calculation or enabled events.
SDMultiplier0 disables band exit/return, not VWAP crosses.
Initial attach, history reset and manual move produce no immediate old alerts.
Later check once per new chart candle; independent families may fire together.
Auto-updated anchors use their newly selected range. No orders. Email/push
require terminal setup/running; sound file alert.wav must be available.

OWNERSHIP / INPUTS
MT4:19 functional inputs +5 Comment_ separators. MT5:20, adds VolumeType.
BarsBack>=1; finite SDMultiplier>=0; AnchorLineWidth1..5; valid enum values.
ObjectPrefix default ForexBestRobots-AVWAP-, unique, nonempty/no spaces/max40.
Duplicate/nested namespaces rejected. Failed init does not delete other objects.
Do not delete hidden InstanceLock. Only owned anchor/lock are managed.
Own tagged anchor is preserved on timeframe change/recompile and reused on init;
removed on explicit indicator removal/parameter change. Other lines not taken.

LICENSE
Original copyright2026 EarnForex.com retained. Apache-2.0 full LICENSE.
https://github.com/EarnForex/Anchored-VWAP/tree/ea63d699c33ae5f0decafed00f569b442ed8ee7f
No NOTICE in pinned tree. Changes in marked source, CHANGES and patch.
No endorsement implied. Original bytes unchanged. CHECKSUMS covers every
other entry. INSTALL/ contains12 native instructions.
https://forexbestrobots.com/indicators/anchored-vwap-mt4-mt5.html
