Anchored VWAP Studio — Developer Guide: Data & Command Interface

Anchored VWAP Studio — Developer Guide: Data & Command Interface

30 Juni 2026, 14:57
Thomas Ludwig
0
49

This Developer Guide documents the public Data Interface v6, Command Interface v3 and Alert Event Interface v1 for Anchored VWAP Studio, including object names, transactional payload rules, snapshot reading, command keys, verified ACK handling, alert-event delivery diagnostics, command codes and integration practices.

Version: 1.20
Product: Anchored VWAP Studio by XTSFORGE
Product version: 1.2
Indicator: XTSFORGE A-VWAP Studio
Interfaces: Data Interface v6, Command Interface v3, Alert Event Interface v1

Product Page | Quick Start | User Manual

Documentation note: This article documents the public developer interfaces of Anchored VWAP Studio. It describes product operation only. It is not financial advice and does not provide trading recommendations, buy signals, sell signals, automated trading decisions or performance guarantees. For risk disclaimer, support scope, license/update notes and privacy information, please refer to the Product Page.

Article Map

This article is structured as follows:

  1. Overview
  2. Optional Developer Test Scripts
  3. Data Interface v6
  4. Data Interface Object Names
  5. Transactional Snapshot and Chunking Rules
  6. Data Interface Payload Fields
  7. Data Interface Reader Examples
  8. Data Interface Best Practices
  9. Command Interface v3
  10. Command Keys, Text Payloads and ACK Handling
  11. Public Command Table
  12. Command Sender Examples
  13. Alert Event Interface v1
  14. Public Enum and Value Reference
  15. Integration Best Practices
  16. Compatibility and Limitations
  17. Interface Changelog

1. Overview

This Developer Guide is intended for EA and script developers who want to integrate with XTSFORGE A-VWAP Studio from MetaTrader 5.

The indicator provides three public integration layers:

Interface Version Purpose
Data Interface v6 Read verified current indicator state, VWAP values, band values, alert metadata and anchor state through hidden chart objects.
Command Interface v3 Control supported indicator functions through terminal Global Variables and verified hidden text objects.
Alert Event Interface v1 Read committed alert events and delivery diagnostics through a dedicated dual-slot hidden-object stream.

Data Interface v6 and Alert Event Interface v1 are read-oriented. Command Interface v3 is write-oriented.

The interfaces can be used independently. Alert Event Interface v1 uses the Data Interface hidden-object namespace and is available only while Data Interface Mode is set to Hidden Objects.

The examples and test scripts are developer tools only. They are not trading systems and do not place, modify or close trades.

Interface scope notice: These interfaces provide local MetaTrader 5 state exchange only. They do not provide trading signals, financial advice, automated trading decisions or order execution. Any EA, script or automation using them must be independently tested and validated by its developer or user.


2. Optional Developer Test Scripts

Two readable source-code tests can be attached:

Script Purpose
XTSFORGE A-VWAP Studio - Data Interface Test.mq5 Read-only validation of Data Interface v6 heads, slots, manifests, chunks, checksums and fields.
XTSFORGE A-VWAP Studio - Command Interface Test.mq5 Tests Command Interface v3, ACK handling, commands and legacy v2 compatibility.

Copy the files to MQL5\Scripts\XTSFORGE\, compile them and run them on the chart containing the indicator.

  • Data test: enable Data Interface Mode = Hidden Objects.
  • Command test: use Bridge or Integrated UI + Bridge and keep Data Interface Mode enabled for verification.
  • The Command test temporarily changes settings and anchors. Run it on a test chart and allow restoration to finish.

The internal Alert Event regression script is not a public attachment; the reader contract is documented below.


3. Data Interface v6

3.1 Purpose

Data Interface v6 publishes current indicator state and latest closed-bar VWAP values through hidden chart label objects.

EAs and scripts can read these objects without accessing indicator buffers directly.

3.2 Enabling the Data Interface

Set Data Interface Mode to Hidden Objects. The corresponding enum value is VWAP_DATA_HIDDEN_OBJECTS.

When Data Interface Mode is Off, the indicator removes its current and legacy hidden data objects for the chart.

3.3 Data Value Mode

The Data Interface publishes closed-bar values. The full META payload field data_mode currently reports:

closed_bar_only

Developer integrations should treat published VWAP and band values as latest-closed-bar snapshots unless a future schema version documents another mode.

3.4 Transactional Design

Data Interface v6 uses two complete snapshot slots and one short atomic META head. The inactive slot is written and verified first. The short META head is committed only after the complete slot is available.

This design allows a reader to reject an incomplete new slot and continue using the previously committed slot.


4. Data Interface Object Names

4.1 Public Data Prefix

The public data-object prefix is:

XTSF:AVWAP:DATA

4.2 Chart-Specific Base

All Data and Alert Event objects for one chart use this base:

XTSF:AVWAP:DATA:<ChartID>

4.3 Atomic Commit Head

Logical object Object name
Atomic META commit head XTSF:AVWAP:DATA:<ChartID>:META

4.4 Slot-Specific Snapshot Roots

Logical object Object name pattern
Full META payload XTSF:AVWAP:DATA:<ChartID>:META:<Slot>
Daily period XTSF:AVWAP:DATA:<ChartID>:PERIOD:<Slot>:DAILY
Weekly period XTSF:AVWAP:DATA:<ChartID>:PERIOD:<Slot>:WEEKLY
Monthly period XTSF:AVWAP:DATA:<ChartID>:PERIOD:<Slot>:MONTHLY
Anchors summary XTSF:AVWAP:DATA:<ChartID>:ANCHORS:<Slot>
Anchor slot objects XTSF:AVWAP:DATA:<ChartID>:ANCHOR:<Slot>:01 through :20

Slot is 0 or 1.

4.5 Chunk Objects

Every slot-specific logical root stores a short manifest. Its payload chunks use:

<RootName>:C00
<RootName>:C01
...
<RootName>:C63

The former v5 :PART:001 format is legacy only and is not used by Data Interface v6.


5. Transactional Snapshot and Chunking Rules

5.1 Atomic META Head

The direct META head is not chunked. It contains a short payload:

v=6;type=commit;seq=<Sequence>;slot=<0-or-1>;ok=1

The head identifies the currently committed full snapshot slot.

5.2 Snapshot Slot Contents

Each complete slot contains 25 logical roots:

  • 1 full META root
  • 3 Period roots
  • 1 Anchors summary root
  • 20 Anchor slot roots

The META field expected_objects reports 25 for one slot. The direct atomic META head is not included in this count.

5.3 Root Manifest

Each slot-specific logical root uses manifest version 2:

v=2;s=<Sequence>;n=<ChunkCount>;l=<PayloadLength>;h=<FNV1a>;o=<0-or-1>

Field Meaning
v Root manifest version. Data Interface v6 uses manifest version 2.
s Sequence bound to the payload.
n Number of payload chunks.
l Reconstructed payload length in characters.
h FNV-1a checksum of the complete payload.
o Open/commit state: 0 while pending, 1 when committed.
e Optional error flag used by an error manifest.

5.4 Chunking Constants

Constant Value
chunk_size 60 characters
max_chunks 64
maximum logical payload capacity 3,840 characters
chunk index range C00 through C63

5.5 Writer Sequence

  1. Write the inactive slot with manifest o=0.
  2. Write and read back all Cxx chunks.
  3. Verify length, FNV-1a checksum and exact payload.
  4. Commit each root with o=1.
  5. After all 25 roots are valid, write the direct META head last.

Failed publication retains the pending sequence and slot for retry.

5.6 Recommended Reader Sequence

  1. Read and validate the direct META head; store seq and slot.
  2. Rebuild the selected slot's full META root from manifest v2 and Cxx chunks.
  3. Verify o=1, chunk count, length, checksum, schema v6, matching seq/slot and snapshot_complete=1.
  4. Read required roots from the same slot and require matching sequence and slot fields.
  5. Read the direct head again; accept only if it is unchanged.

5.7 Fallback Slot

If the head-selected slot cannot be rebuilt or validated, a defensive reader may validate the other slot and use it as a fallback when it contains a complete committed snapshot.

The fallback slot normally contains the previous completed sequence. A reader should not combine roots from different slots or sequences.

5.8 FNV-1a Checksum

Use unsigned 32-bit FNV-1a: start at 2166136261, XOR each MQL5 character value and multiply by 16777619.


6. Data Interface Payload Fields

6.1 Atomic META Head Fields

Field Meaning
v Data Interface schema version, currently 6.
type commit.
seq Committed snapshot sequence.
slot Committed snapshot slot, 0 or 1.
ok 1 for a valid committed head.

6.2 Full META Payload Fields

Field group Fields and meaning
Identity and schema v, type, seq, slot, slot_count, indicator_name, indicator_shortname, indicator_version, schema_version, symbol, period, timeframe, chart_id, digits.
Snapshot contract data_mode, snapshot_complete, commit_object, commit_head, expected_objects, period_objects, anchor_objects, anchor_slots_published.
Timing and status server_time, updated, closed_time, last_closed_bar_time, status, last_error.
Anchor workspace active_anchors, max_anchors, selected_anchor_slot, selector_new, anchor_visible, anchor_markers_locked, anchor_persistence_mode, reset_anchors_on_reset_boundary, safe_bars.
Periodic configuration daily_enabled, weekly_enabled, monthly_enabled, daily_reset_mode, weekly_reset_mode, daily_band_mode, anchor_band_mode, per_anchor_state, daily_history_mode, daily_days, weekly_weeks, monthly_months.
Calculation and control period_price_source, anchor_price_source, volume_mode, control_mode, data_interface_mode.
Alert setup alerts_enabled, alert_status, alert_warning, alert_terminal, alert_push, alert_email, push_configured, email_configured.
Alert targets alert_targets_daily, alert_targets_weekly, alert_targets_monthly, alert_targets_anchored, alert_targets_daily_bands, alert_targets_anchored_bands.
Alert rules alert_cross, alert_break, alert_touch, alert_band_touch, alert_direction, alert_evaluation_mode, alert_once_per_bar, alert_cooldown_seconds.
Alert Event stream alert_event_schema_version, alert_event_head, alert_event_seq, alert_event_active_slot, alert_event_dropped.
Delivery diagnostics alert_delivery_attempts, alert_delivery_accepted, alert_delivery_failed, alert_delivery_partial_failures, alert_last_requested_mask, alert_last_accepted_mask, alert_last_failed_mask, alert_last_push_error, alert_last_email_error, alert_last_attempt_time, alert_last_accepted_time.
Command contract command_schema_version, command_legacy_schema_version, command_legacy_supported, command_interface, command_key_base, command_legacy_key_base, command_requires_bridge_mode, command_bridge_active, command_ui_visible, command_supported_control_modes, command_event_id, command_ack, command_ack_commit, command_capabilities.
Capabilities capabilities.

The field command_requires_bridge_mode=0 means the interface is not restricted to Bridge-only mode. Commands are accepted in Bridge and Integrated UI + Bridge modes. Integrated UI-only mode ignores bridge commands.

6.3 PERIOD Payload Fields

Period roots exist for DAILY, WEEKLY and MONTHLY.

Field Meaning
v / type / seq / slot / name Schema version, payload type, snapshot sequence, snapshot slot and period name.
enabled / ok / time / value_source Visibility state, main-value validity, latest closed-bar time and value source.
bands_supported / band_mode Band capability and current band mode.
mid_ok / mid Main VWAP validity and value.
high_ok / high / low_ok / low Weighted high/low validity and values.
sd1_high_ok / sd1_high / sd1_low_ok / sd1_low Standard deviation level 1 validity and values.
sd2_high_ok / sd2_high / sd2_low_ok / sd2_low Standard deviation level 2 validity and values.
sd3_high_ok / sd3_high / sd3_low_ok / sd3_low Standard deviation level 3 validity and values.

Weekly and Monthly roots currently report bands_supported=0 and publish invalid band fields.

6.4 ANCHORS Summary Fields

Field Meaning
v / type / seq / slot Schema version, payload type, snapshot sequence and snapshot slot.
active_count / visible_count / max_anchors Anchor counts and configured active-slot limit.
global_visible Global Anchored VWAP visibility.
selected_anchor_slot / selector_new Selected slot number, or selector_new=1 when NEW is selected.
active_slots / visible_slots Comma-separated active and visually visible 1-based slot numbers.
anchor_times Comma-separated slot:timestamp pairs.

6.5 ANCHOR Slot Fields

Anchor roots exist for slots 01 through 20 in each snapshot slot.

Field Meaning
v / type / seq / snapshot_slot / slot Schema version, payload type, sequence, snapshot slot and 1-based anchor slot.
slot_enabled / active / visible Configured slot availability, anchor activity and final visual visibility.
global_visible / slot_visible / selected Global visibility, individual visibility and selector state.
ok / anchor_time / time / value_source Main-value validity, anchor timestamp, latest closed-bar time and value source.
color / band_mode / uses_hl_bands / uses_stddev_bands Per-anchor visual and band state.
label_mode / label_text Per-anchor label mode and sanitized label text or fallback label.
mid_ok / mid Anchored VWAP validity and value.
high_ok / high / low_ok / low Weighted high/low band validity and values.
sd1_* / sd2_* / sd3_* Standard deviation-band validity and values for levels 1, 2 and 3.

6.6 Value Validity Fields

A numeric value should be used only when its corresponding _ok field is 1. When a value is not valid, the payload still contains the numeric field with a neutral value so readers can use a stable schema.


7. Data Interface Reader Example

  1. Read XTSF:AVWAP:DATA:<ChartID>:META.
  2. For head v=6;type=commit;seq=42;slot=1;ok=1, read roots from slot 1.
  3. For each root, require manifest v=2, o=1, rebuild C00..C(n-1), then verify length and FNV-1a checksum.
  4. For Daily VWAP read ...:PERIOD:1:DAILY, require matching v, seq and slot, then use mid only when mid_ok=1.
  5. For anchors read the slot's ANCHORS summary and active ANCHOR roots 01..20.
  6. Read the direct META head again and restart if seq or slot changed.

If the selected slot fails validation, a complete internally consistent other slot may be used as the previous snapshot.


8. Data Interface Best Practices

  • Treat the direct META head as the atomic commit pointer, not as the full metadata payload.
  • Never combine roots from different snapshot slots.
  • Validate manifest version, open/commit state, chunk count, length and checksum.
  • Read the head before and after the selected slot.
  • Use the other slot only as a complete fallback snapshot.
  • Use seq to avoid repeated work.
  • Check schema_version before relying on fields.
  • Handle unknown future fields defensively.
  • Ignore inactive anchor slots.
  • Check each _ok field before using a numeric value.
  • Respect visible, slot_visible and global_visible when external behavior should follow the chart view.
  • Treat published VWAP values as closed-bar values.
  • Keep Data Interface Mode Off when no reader requires it.

9. Command Interface v3

9.1 Purpose

Command Interface v3 allows an EA or script to control supported indicator functions through terminal Global Variables and hidden text objects.

It is intended for deterministic external control, not for UI simulation.

9.2 Enabling Command Processing

Commands are accepted when Control Mode is set to Bridge or Integrated UI + Bridge. The corresponding enum values are VWAP_CTRL_BRIDGE and VWAP_CTRL_INTEGRATED_BRIDGE.

Integrated UI-only mode ignores bridge commands.

9.3 Command Interface v3 Base

The preferred compact v3 base is:

XTSF:AVWAP:CMD:<ChartID>

Example:

XTSF:AVWAP:CMD:123456789

9.4 Legacy Command Interface v2 Base

Published legacy v2 compatibility remains available under:

INV_AVWAP:<Symbol>:<Period>:<ChartID>

Example:

INV_AVWAP:EURUSD:5:123456789

New integrations should use Command Interface v3. If both namespaces contain new pending sequences, the indicator checks v3 first.

9.5 Sequence Priming

When the indicator initializes, it records the current command sequences in both namespaces. Existing stale commands are not replayed after reinitialization.


10. Command Keys, Text Payloads and ACK Handling

10.1 Command Keys

Key / object Purpose
<Base>:CMD_SEQ Positive integer command sequence. Commit this last.
<Base>:CMD_CODE Numeric command code.
<Base>:CMD_TIME Integer datetime payload.
<Base>:CMD_VALUE Numeric, boolean, enum, color or cooldown payload.
<Base>:CMD_SLOT 1-based anchor slot payload.
<Base>:CMD_TEXT Hidden OBJ_LABEL text object for label-text payloads.
<Base>:CMD_TEXT_SEQ v3 Global Variable that binds CMD_TEXT to the committed CMD_SEQ.

10.2 v3 Text Payload Rules

  • CMD_TEXT is used only by command 19.
  • OBJPROP_TEXT and OBJPROP_TOOLTIP must match.
  • CMD_TEXT_SEQ must equal the committed CMD_SEQ.
  • Maximum text length is 32 characters.

Legacy v2 text handling remains available without CMD_TEXT_SEQ.

10.3 ACK Keys and Objects

ACK key / object Purpose
<Base>:CMD_ACK_SEQ Committed ACK sequence. Written last.
<Base>:CMD_ACK_CODE Processed command code.
<Base>:CMD_ACK_CHANGED 1 if state changed, otherwise 0.
<Base>:CMD_ACK_TIME Processing timestamp.
<Base>:CMD_ACK_ERROR_CODE Public numeric error-code class.
<Base>:CMD_ACK_STATUS Verified hidden text object containing ok, no_change, error or ignored.
<Base>:CMD_ACK_ERROR Verified hidden text object containing an error identifier or none.

10.4 ACK Commit Rule

The indicator writes and verifies every ACK field and text object first, then commits CMD_ACK_SEQ last. Read ACK details only after CMD_ACK_SEQ equals the submitted sequence.

10.5 Typical ACK Status Values

Status Meaning
ok The command was valid and changed indicator state.
no_change The command was valid but the requested state was already active.
error The command was rejected.
ignored The sequence was processed but the command was intentionally ignored, for example CMD_NONE.

10.6 Public ACK Error-Code Classes

Code Name Meaning
0 VWAP_CMD_ERROR_NONE No transport or validation error.
1 VWAP_CMD_ERROR_MISSING_PAYLOAD Required payload is missing or v3 text verification failed.
2 VWAP_CMD_ERROR_INVALID_PAYLOAD Payload value, sequence, slot, time, text or command-specific range is invalid.
3 VWAP_CMD_ERROR_TERMINAL_CONFIGURATION Push or email was requested but not configured in MetaTrader 5.
4 VWAP_CMD_ERROR_UNKNOWN_COMMAND Command code is not supported.
5 VWAP_CMD_ERROR_ACK_TRANSPORT The indicator could not publish a complete verified ACK.

10.7 Recommended Writing Order

  1. Write required numeric payloads.
  2. For command 19, write matching CMD_TEXT text/tooltip and CMD_TEXT_SEQ.
  3. Write CMD_CODE and CMD_SEQ last.
  4. Optionally send chart event 1001.
  5. Wait for matching CMD_ACK_SEQ and then read the ACK.

11. Public Command Table

Code Name Required payload Value range / note
0 CMD_NONE none Processed as ignored.
1 CMD_ADD_ANCHOR CMD_TIME Adds an anchor at the normalized chart-bar time using the first free active slot.
2 CMD_DEL_ANCHOR CMD_TIME Deletes an anchor matching the normalized chart-bar time.
3 CMD_CLEAR_ALL none Clears all active anchors.
4 CMD_SET_DAILY_VWAP CMD_VALUE 0/1.
5 CMD_SET_DAILY_HISTORY CMD_VALUE Negative = Full, 0 or 1 = current day, 2..5 = last N days.
6 CMD_SET_DAILY_BAND CMD_VALUE 0 OFF, 1 H/L, 2 StdDev, 3 Dual.
7 CMD_SET_ANCHOR_BAND CMD_VALUE Sets NEW/default and all active-anchor band modes, 0..3.
8 CMD_SET_WEEKLY_VWAP CMD_VALUE 0/1.
9 CMD_SET_MONTHLY_VWAP CMD_VALUE 0/1.
10 CMD_SET_ALERTS CMD_VALUE 0/1.
11 CMD_SET_ANCHOR_GLOBAL_VISIBILITY CMD_VALUE 0/1.
12 CMD_SET_ANCHOR_LOCK CMD_VALUE 0/1.
13 CMD_SET_ANCHOR_SLOT_TIME CMD_SLOT + CMD_TIME Sets or moves one 1-based anchor slot.
14 CMD_DEL_ANCHOR_SLOT CMD_SLOT Deletes one 1-based anchor slot.
15 CMD_SET_ANCHOR_SLOT_VISIBILITY CMD_SLOT + CMD_VALUE 0/1.
16 CMD_SET_ANCHOR_SLOT_COLOR CMD_SLOT + CMD_VALUE MQL5 color integer.
17 CMD_SET_ANCHOR_SLOT_BAND CMD_SLOT + CMD_VALUE 0 OFF, 1 H/L, 2 StdDev, 3 Dual.
18 CMD_SET_ANCHOR_SLOT_LABEL_MODE CMD_SLOT + CMD_VALUE 0 OFF, 1 #, 2 Price, 3 # + Price, 4 Custom, 5 Custom + Price.
19 CMD_SET_ANCHOR_SLOT_LABEL_TEXT CMD_SLOT + CMD_TEXT + CMD_TEXT_SEQ v3 verified text, maximum 32 characters.
20 CMD_SET_WEEKLY_HISTORY CMD_VALUE 0 Full, 1..12 weeks.
21 CMD_SET_MONTHLY_HISTORY CMD_VALUE 0 Full, 1..12 months.
22 CMD_SET_ALERT_CHANNEL_TERMINAL CMD_VALUE 0/1.
23 CMD_SET_ALERT_CHANNEL_PUSH CMD_VALUE 0/1; enabling requires MetaTrader push configuration.
24 CMD_SET_ALERT_CHANNEL_EMAIL CMD_VALUE 0/1; enabling requires MetaTrader email configuration.
25 CMD_SET_ALERT_TARGET_DAILY CMD_VALUE 0/1.
26 CMD_SET_ALERT_TARGET_WEEKLY CMD_VALUE 0/1.
27 CMD_SET_ALERT_TARGET_MONTHLY CMD_VALUE 0/1.
28 CMD_SET_ALERT_TARGET_ANCHORED CMD_VALUE 0/1.
29 CMD_SET_ALERT_TARGET_DAILY_BANDS CMD_VALUE 0/1.
30 CMD_SET_ALERT_TARGET_ANCHORED_BANDS CMD_VALUE 0/1.
31 CMD_SET_ALERT_TRIGGER_CROSS CMD_VALUE 0/1.
32 CMD_SET_ALERT_TRIGGER_BREAK CMD_VALUE 0/1.
33 CMD_SET_ALERT_TRIGGER_TOUCH CMD_VALUE 0/1.
34 CMD_SET_ALERT_TRIGGER_BAND_TOUCH CMD_VALUE 0/1.
35 CMD_SET_ALERT_DIRECTION CMD_VALUE 0 Both, 1 Bullish only, 2 Bearish only.
36 CMD_SET_ALERT_EVALUATION_MODE CMD_VALUE 0 Closed bar, 1 Intrabar.
37 CMD_SET_ALERT_ONCE_PER_BAR CMD_VALUE 0/1.
38 CMD_SET_ALERT_COOLDOWN CMD_VALUE 0..3600 seconds.


12. Command Sender Examples

The attached Command test contains the complete sender and restoration workflow.

12.1 Numeric Command

Build XTSF:AVWAP:CMD:<ChartID>, write payload and CMD_CODE, then commit CMD_SEQ. Example: command 8 with CMD_VALUE=1 enables Weekly VWAP.

12.2 Anchor Slot

Command 13 uses CMD_SLOT=1 and CMD_TIME set to a chart-bar datetime.

12.3 Label Text

Command 19 uses CMD_SLOT, matching CMD_TEXT text/tooltip and CMD_TEXT_SEQ bound to the new CMD_SEQ.

12.4 ACK

Wait for matching CMD_ACK_SEQ, read the remaining ACK fields and treat no_change as successful processing without a state change.

12.5 Legacy v2

Existing integrations can continue using the INV_AVWAP base. New integrations should use v3.


13. Alert Event Interface v1

13.1 Purpose

Alert Event Interface v1 publishes the latest committed alert events and delivery results for external readers.

It does not send orders and does not make trading decisions.

The stream is available only when Data Interface Mode is Hidden Objects.

13.2 Object Names

Logical object Object name
Atomic Alert Event head XTSF:AVWAP:DATA:<ChartID>:ALERT
Alert Event slot 0 XTSF:AVWAP:DATA:<ChartID>:ALERT:0
Alert Event slot 1 XTSF:AVWAP:DATA:<ChartID>:ALERT:1

The slot-specific Alert Event roots use the same manifest version 2, Cxx chunking, 60-character chunk size, 64-chunk limit, length verification and FNV-1a checksum as Data Interface v6.

13.3 Atomic Alert Event Head

The direct head payload is:

v=1;type=alert_commit;seq=<Sequence>;slot=<0-or-1>;ok=1

13.4 Alert Event Payload Fields

Field Meaning
v / type / seq / slot Alert Event schema version, alert_event type, sequence and event slot.
data_seq Latest committed Data Interface sequence known when the event was created.
symbol / period / timeframe Chart identity.
attempt_time / bar_time Delivery-attempt time and signal-bar time.
accepted 1 when at least one requested channel accepted the alert, otherwise 0.
requested_mask Bit mask of selected delivery channels.
accepted_mask Bit mask of channels that accepted delivery.
failed_mask Bit mask of selected channels that failed.
push_error / email_error MetaTrader error codes for failed Push or Email delivery.
level Alert level as a non-localized numeric string.
rule_key Internal public rule identifier used to distinguish alert suppression state.
target Readable alert target.
event Readable event type.
failure Delivery-failure summary or none.
message Sanitized alert message.

13.5 Delivery Channel Masks

Value Number Meaning
VWAP_ALERT_CHANNEL_NONE 0 No channel.
VWAP_ALERT_CHANNEL_TERMINAL 1 Terminal Alert channel.
VWAP_ALERT_CHANNEL_PUSH 2 Push notification channel.
VWAP_ALERT_CHANNEL_EMAIL 4 Email channel.

Masks can be combined. For example, requested_mask=7 means Terminal, Push and Email were requested.

13.6 Delivery Semantics

  • Terminal is accepted when selected; Push and Email require a successful MetaTrader function result.
  • Fully failed and partially failed attempts can still publish diagnostic events.
  • Cooldown and once-per-bar state is committed only after at least one channel accepts the market alert.
  • Retrying event publication does not resend the market alert.

13.7 Recommended Reader Sequence

  1. Read the direct ALERT head and store seq/slot.
  2. Rebuild and verify ALERT:<Slot> using manifest v2 and Cxx chunks.
  3. Require schema v1, type=alert_event and matching seq/slot.
  4. Read the head again and accept only if unchanged.

13.8 Stream Behavior

The stream keeps two alternating event slots. It is a latest-event transport, not an unlimited historical queue.

If a previous event publication is still pending and cannot be completed before a new event is queued, the newest event can be dropped. The cumulative count is published through alert_event_dropped in the full META payload.

13.9 META Diagnostics

The full Data Interface META payload exposes Alert Event sequence and slot state, aggregate delivery counters, last requested/accepted/failed masks, Push and Email error codes, and last attempt and accepted times.

External monitoring can use these fields even when it does not need the full Alert Event message.


14. Public Enum and Value Reference

14.1 Band Modes

Value Number Meaning
VWAP_BANDS_OFF 0 Disabled.
VWAP_BANDS_HL 1 Weighted H/L.
VWAP_BANDS_STDDEV 2 Weighted standard deviation.
VWAP_BANDS_HL_STDDEV 3 Weighted H/L plus standard deviation.

14.2 Label Modes

Value Number Meaning
PERIODIC_VWAP_LABEL_OFF 0 No Periodic label.
PERIODIC_VWAP_LABEL_NAME 1 Name only.
PERIODIC_VWAP_LABEL_PRICE 2 Price only.
PERIODIC_VWAP_LABEL_NAME_PRICE 3 Name plus price.
AVWAP_LABEL_OFF 0 No Anchored VWAP label.
AVWAP_LABEL_NUMBER 1 Anchor number only.
AVWAP_LABEL_PRICE 2 Price only.
AVWAP_LABEL_NUMBER_PRICE 3 Anchor number plus price.
AVWAP_LABEL_CUSTOM 4 Custom text only.
AVWAP_LABEL_CUSTOM_PRICE 5 Custom text plus price.

14.3 Price Source Values

Value Number Meaning
VWAP_PRICE_CLOSE 0 Close.
VWAP_PRICE_HL2 1 HL/2.
VWAP_PRICE_HLC3 2 HLC/3.
VWAP_PRICE_OHLC4 3 OHLC/4.

14.4 Volume Mode Values

Value Number Meaning
AVWAP_VOL_TICK 0 Tick volume.
AVWAP_VOL_REAL 1 Real volume.
AVWAP_VOL_AUTO 2 Automatic available-volume selection.

14.5 Reset Mode Values

Value Number Meaning
DAILY_VWAP_RESET_SERVER_DAY 0 Server calendar day.
DAILY_VWAP_RESET_SYMBOL_SESSION 1 Symbol session start.
WEEKLY_VWAP_RESET_SERVER_WEEK 0 Server calendar week.
WEEKLY_VWAP_RESET_FIRST_SESSION 1 First symbol session of the week.

14.6 Control and Data Interface Modes

Value Number Meaning
VWAP_CTRL_INTEGRATED 0 Integrated UI only; commands ignored.
VWAP_CTRL_BRIDGE 1 Bridge only; integrated UI hidden.
VWAP_CTRL_INTEGRATED_BRIDGE 2 Integrated UI plus Command Interface.
VWAP_DATA_OFF 0 Data and Alert Event objects disabled and removed.
VWAP_DATA_HIDDEN_OBJECTS 1 Hidden-object Data and Alert Event publishing.

14.7 Alert Values

Value Number Meaning
VWAP_ALERT_CLOSED_BAR 0 Closed-bar evaluation.
VWAP_ALERT_INTRABAR 1 Intrabar evaluation.
VWAP_ALERT_DIRECTION_BOTH 0 Both directions.
VWAP_ALERT_DIRECTION_BULLISH 1 Bullish only.
VWAP_ALERT_DIRECTION_BEARISH 2 Bearish only.

14.8 Daily History Mode Values

Value Number Meaning
VWAP_HISTORY_CURRENT_ONLY 0 Current Daily VWAP period only.
VWAP_HISTORY_LAST_N 1 Last N Daily VWAP periods. Public workflow supports 2..5 days.
VWAP_HISTORY_ALL 2 Full available Daily VWAP history.


15. Integration Best Practices

  • Use Data v6 for state, Command v3 for control and Alert Event v1 for committed alert events.
  • Use the v3 namespace for new command integrations.
  • Write payloads before CMD_SEQ and bind text with CMD_TEXT_SEQ.
  • Read ACK details only after committed CMD_ACK_SEQ.
  • Validate heads, slots, manifests, chunks, lengths, checksums and schema versions.
  • Never combine different slots or sequences.
  • Handle missing and unknown fields defensively.
  • Run state-changing tests on a test chart and allow restoration to finish.

16. Compatibility and Limitations

Product v1.2 documents Data Interface v6, Command Interface v3 and Alert Event Interface v1.

  • Data v6 replaces v5 unslotted roots and PART chunks.
  • Command v3 is preferred; published v2 compatibility remains under INV_AVWAP.
  • Alert Event v1 requires Data Interface Mode = Hidden Objects.
  • Interfaces are local and chart-specific and do not execute orders.
  • MetaTrader object and Global Variable timing still applies.
  • Readers should check versions and ignore unknown future fields.

17. Interface Changelog

Release Interface changes
Documentation 1.20 / Product 1.2 Data v6 dual-slot snapshots and manifest v2; Command v3 compact keys, text binding and verified ACK; Alert Event v1 event stream and delivery diagnostics.
Documentation 1.00 Initial Data v5 and Command v2 public contracts.

Future public interface changes are documented here and in the product changelog.


Documentation Series

This article belongs to the Anchored VWAP Studio documentation series:

For risk disclaimer, support scope, license/update notes and privacy information, please refer to the Product Page.