Skip to content

[codex] Add MQL4 TimeShield facade#114

Merged
NewYaroslav merged 4 commits into
mainfrom
feat/mql4-time-shield
Jul 2, 2026
Merged

[codex] Add MQL4 TimeShield facade#114
NewYaroslav merged 4 commits into
mainfrom
feat/mql4-time-shield

Conversation

@NewYaroslav

@NewYaroslav NewYaroslav commented Jul 2, 2026

Copy link
Copy Markdown
Owner

What Changed

  • Added MQL4/Include/TimeShield.mqh as the single public MQL4 header.
  • Exposed common time constants, timestamp helpers, monotonic milliseconds, second-of-day conversion, and time-of-day parsing through the TimeShield class.
  • Used a class/static-method API for MQL4 because MQL4 does not support namespaces.
  • Marked MQL source extensions as text for Git diffs.
  • Documented MQL4 include usage in the README.

Why

OptionX legacy MQL4 code needs the same public #include <TimeShield.mqh> entry point that MQL5 already uses, without keeping a local legacy time helper in the connector package.

Validation

  • cmake -S . -B tmp/agent-work/build-mql4 -G "MinGW Makefiles" -DTIME_SHIELD_CPP_BUILD_TESTS=ON -DTIME_SHIELD_CPP_BUILD_EXAMPLES=OFF
  • cmake --build tmp/agent-work/build-mql4 --parallel 36
  • ctest --test-dir tmp/agent-work/build-mql4 --output-on-failure
  • Result: 50/50 C++ tests passed.
  • Byte check: no UTF-16/NUL MQL source files found.

Not Run

  • MetaTrader/MQL4 compiler validation was not run locally.

Add a minimal MQL4 include package with time constants, timestamp helpers, second-of-day conversion, and time-of-day parsing under the time_shield namespace. Document MetaTrader usage and mark MQL sources as text for diffs.
Replace the MQL4 namespace-style headers with a static TimeShield class facade, matching MQL4 language constraints while preserving the TimeShield.mqh entry point.
Move the MQL4 static TimeShield API into the public TimeShield.mqh header and remove the duplicate time_shield.mqh entry point.
Replace the mojibake-prone source archive comment with an ASCII English comment while keeping the archive and MQL text attributes unchanged.
@NewYaroslav NewYaroslav marked this pull request as ready for review July 2, 2026 18:04
@NewYaroslav NewYaroslav merged commit d5bb4aa into main Jul 2, 2026
10 checks passed
@NewYaroslav NewYaroslav deleted the feat/mql4-time-shield branch July 2, 2026 18:04
NewYaroslav added a commit to NewYaroslav/optionx_cpp that referenced this pull request Jul 2, 2026
Update the TimeShield submodule to the main-branch merge commit for NewYaroslav/time-shield-cpp#114.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant