Repository navigation
Development Guide
FXNews intentionally keeps its implementation in FXNews.mq5. Prefer focused function-level changes unless a larger refactor has a clear maintenance benefit. Preserve #property strict, chart-window indicator behavior, and the timer-driven scan path unless the product design changes deliberately.
- Edit
FXNews.mq5or the relevant wiki page. - Compile. On macOS run
./tools/build-macos.sh; elsewhere compileFXNews.mq5in MetaEditor. - Run
tools/census.py(dead-code and placeholder census) and, on macOS,./tools/selftest-macos.sh(headless self-test); both must exit 0. - Attach the indicator to a chart in a demo or other non-production terminal.
- Run the focused checks described in Testing and Validation.
- Keep generated MetaTrader artifacts out of Git.
tools/build-macos.sh drives MetaEditor through the Wine bundle that ships inside the MetaQuotes macOS build of MetaTrader 5. It resolves the compiler and prefix, converts macOS paths to the prefix's Z: drive mapping, decodes MetaEditor's UTF-16LE log, aborts after BUILD_TIMEOUT seconds (default 300) if MetaEditor hangs, and exits non-zero on any error or warning, so it is usable as a commit gate. --install copies the compiled FXNews.ex5 into the terminal's MQL5/Indicators/FXNews/ folder after a clean build. Exit codes: 0 clean, 1 errors or warnings, 2 environment problem, 3 no result line, 4 timeout. It is macOS-only and assumes the standard install locations:
wine64 /Applications/MetaTrader 5.app/Contents/SharedSupport/wine/bin/wine64
compiler ~/Library/Application Support/net.metaquotes.wine.metatrader5/
drive_c/Program Files/MetaTrader 5/MetaEditor64.exe
Beyond that there is no repository-local install, migration, Docker, or deployment command. The gates are the available validation path: tools/census.py and tools/contracts.py are plain Python 3.14 and run on any platform, tools/build-macos.sh compiles through MetaEditor and is the only syntax and type validation, and tools/selftest-macos.sh drives the terminal. Linting, type checking and formatting are enforced by the gates CI workflow rather than by a repository-local command. Release validation and distribution are manual; the sequence is in Release Checklist.
The MQL5 compiler warns only about a variable that is never touched at all. Anything that is written — including by an initialiser — counts as used. Verified by probe: an initialised-but-unread local, a struct copied into a local and never read, a struct field assigned but never read, a tautological comparison, and an unreachable statement after return all compile with zero warnings. Three real defects fixed in 1.4 lived in exactly that gap. Do not treat a clean build as dead-code clearance; run the census in Testing and Validation.
Review the input declarations, InitializeRuntimeSettings(), and ValidateInputs(). Defaults affect every symbol/timeframe profile and the historical-validation baseline. Update Configuration when user-visible settings change.
Review SymbolsToScan, TimeframesToScan, ParseSymbols(), ParseTimeframes(), ParseTimeframeToken(), TimeframeMinutes(), and FindBrokerSymbolMatch(). Keep parsing, labels, duplicate detection, broker suffix/prefix handling, and historical aggregation aligned.
Start with the relevant evaluator, then ComposeSignalScore() for weights and caps. The composer, ComputeBreakoutStructure(), BlendImpulseScore(), ComposeRegimeScore() and BlendExecutionScore() are pure and shared with the historical modes: change them once and both paths follow. Every component carries an availability flag; a new term must leave the blend and its normaliser when unmeasured, never sit at a neutral constant. Keep compact tags, human-readable reasons and caps on the same thresholds. Material changes require the self-test, a --validation run and live observation.
Review dashboard constants plus UpdateDashboard(), CollectDashboardSignals(), SortDashboardSignalsTopN(), the row formatters, FitDashboardText(), WrapLabelText() and CleanupDashboardObjects(). Every row must fit the 63-character label budget; put detail in the tooltip. Test different chart widths, row limits, diagnostics, blocked-signal mode, and the recent-signal list.
Review EnableSoundAlert, EnablePushNotification, alert state, cooldowns, and SendOptionalAlert(). Alerts must remain opt-in. Test deliberately in a non-production terminal and check for duplicate or repeated notifications.
Review RunHistoricalBacktestSet(), ProcessHistoricalProfile(), BuildHistoricalBoundaryFeatures(), ScoreHistoricalBoundary(), EvaluateHistoricalOutcome(), candidate construction, the objective function, and the report builders. Anything bar data cannot measure stays unavailable; do not approximate a live reading with a constant. Autotune recommendations must remain advisory; results depend on broker history quality and must not be presented as proof of future performance.
- Use source code as the authority when documentation differs.
- Never let a component that could not be evaluated read as confirmation. A neutral placeholder value must not be able to satisfy a threshold that means "confirmed": carry an explicit availability flag and gate the tag and the wording on it.
- No placeholder or filler text in anything the user sees. A format slot with a constant in it is a defect, not a label.
- Keep score wording factual: the percentage is an event-quality ranking, not a win probability or trade recommendation.
- Avoid unbounded work in
OnTimer()andScanAll(). - Validate
CopyRatesandCopyTicksresults before accessing returned arrays. - Keep chart-object names scoped through the indicator's per-chart prefix.
- Do not commit
*.ex5, logs, tester output, profiles, caches, or temporary files. - Update the wiki when behavior, settings, safety boundaries, validation, or operating procedures change.
- Complete the Release Checklist before publishing a production revision.