77 lines
3.9 KiB
MQL5
#ifndef VZ_SESSIONS_DEFS_MQH
| |||
#define VZ_SESSIONS_DEFS_MQH
| |||
//+------------------------------------------------------------------+
| |||
//| VZ_SessionsDefs.mqh |
| |||
//| Shared contract between VZ_Sessions.mq5 and any consumer of it. |
| |||
//| Both sides include this file so buffer indices cannot drift. |
| |||
//| Changing a buffer number here is a breaking change — rebuild |
| |||
//| the indicator AND every EA that reads it. |
| |||
//+------------------------------------------------------------------+
| |||
| |||
// Value carried by the SESSION_ID buffer.
| |||
// Windows are configurable, but OVERLAP always means "London and New York
| |||
// are both open" and takes precedence over either single-session label.
| |||
enum ENUM_VZ_SESSION
| |||
{
| |||
VZ_SESS_OFF = 0, // between sessions (post-NY, pre-Asia)
| |||
VZ_SESS_ASIA = 1,
| |||
VZ_SESS_LONDON = 2, // London open, NY not yet
| |||
VZ_SESS_OVERLAP = 3, // London + NY both open
| |||
VZ_SESS_NY = 4 // NY open, London closed
| |||
};
| |||
| |||
// Value carried by the AMD_PHASE / AMD_PHASE_RETRO buffers.
| |||
enum ENUM_VZ_AMD_PHASE
| |||
{
| |||
VZ_AMD_NONE = 0, // outside a tracked cycle
| |||
VZ_AMD_ACCUMULATION = 1, // Asia window open, range building
| |||
VZ_AMD_PENDING = 2, // Asia closed, waiting for a sweep
| |||
VZ_AMD_MANIPULATION = 3, // sweep reclaimed — AMD_BIAS is live from here
| |||
VZ_AMD_DISTRIBUTION = 4, // displacement confirmed in the bias direction
| |||
VZ_AMD_EXPANSION = 5, // broke the range and never reclaimed: trend day
| |||
VZ_AMD_NO_SETUP = 6, // Asia range too wide to count as accumulation
| |||
VZ_AMD_INVALIDATED = 7 // closed back beyond the sweep extreme
| |||
};
| |||
| |||
// Buffer indices for CopyBuffer(handle, <index>, ...).
| |||
#define VZ_BUF_SESSION_ID 0 // ENUM_VZ_SESSION as a double
| |||
#define VZ_BUF_ASIA_HIGH 1 // running while Asia is open, frozen after
| |||
#define VZ_BUF_ASIA_LOW 2
| |||
#define VZ_BUF_SESSION_HIGH 3 // running extreme of the current session
| |||
#define VZ_BUF_SESSION_LOW 4
| |||
#define VZ_BUF_PREV_DAY_HIGH 5
| |||
#define VZ_BUF_PREV_DAY_LOW 6
| |||
#define VZ_BUF_PREV_DAY_CLOSE 7
| |||
#define VZ_BUF_LONDON_OPEN 8 // EMPTY_VALUE until the open has happened
| |||
#define VZ_BUF_NY_OPEN 9
| |||
#define VZ_BUF_ASIA_RANGE_ATR 10 // Asia range / ATR(D1); EMPTY until Asia closes
| |||
| |||
// ── AMD ─────────────────────────────────────────────────────────────────────
| |||
// AMD_PHASE is what was knowable AT that bar. It is written once and never
| |||
// revised. AMD_PHASE_RETRO is the hindsight labelling and IS revised as
| |||
// evidence arrives — the manipulation leg gets back-filled onto bars that,
| |||
// at the time, looked like nothing.
| |||
//
| |||
// CONSUMERS MUST READ ONLY AMD_PHASE. Reading AMD_PHASE_RETRO from an EA or
| |||
// into an NN feature vector leaks the future into the past and will produce
| |||
// backtests that cannot be reproduced live. RETRO exists for chart review.
| |||
#define VZ_BUF_AMD_PHASE 11 // ENUM_VZ_AMD_PHASE — non-repainting
| |||
#define VZ_BUF_AMD_PHASE_RETRO 12 // ENUM_VZ_AMD_PHASE — REPAINTS BY DESIGN
| |||
#define VZ_BUF_AMD_BIAS 13 // -1 / 0 / +1 expected distribution direction
| |||
#define VZ_BUF_AMD_CONFIDENCE 14 // 0..100, valid once phase >= MANIPULATION
| |||
#define VZ_BUF_AMD_SWEEP_LEVEL 15 // the Asia boundary that was swept
| |||
#define VZ_BUF_AMD_INVALIDATION 16 // sweep extreme; a close beyond it kills the read
| |||
#define VZ_BUF_AMD_MARK_CONF 17 // arrow at the bar manipulation was CONFIRMED
| |||
#define VZ_BUF_AMD_MARK_RETRO 18 // arrow at the sweep extreme bar (hindsight)
| |||
| |||
#define VZ_BUF_COUNT 19
| |||
| |||
// Daylight-saving rule applied on top of the broker's base GMT offset.
| |||
enum ENUM_VZ_DST
| |||
{
| |||
VZ_DST_NONE = 0, // broker offset is fixed year-round
| |||
VZ_DST_EU = 1, // last Sun Mar 01:00 UTC .. last Sun Oct 01:00 UTC
| |||
VZ_DST_US = 2 // 2nd Sun Mar 07:00 UTC .. 1st Sun Nov 06:00 UTC
| |||
};
| |||
| |||
#endif
|