01
Engineering problem
The Python decision system should not call the broker directly. A terminal-side application is needed to validate command freshness and structure, apply local controls, prevent duplicate processing, manage order actions, and report what actually happened in MetaTrader.
02
System response
SignalFileTrader uses a file-mediated command interface between Python and MT4. It processes eligible commands, applies terminal and order checks, handles entry and management actions, records the command lifecycle, and sends status/result information back to the connected decision application.
03
Engineering scope
- CSV-based entry-signal ingestion with freshness, timestamp, duplicate, score, confidence, ATR, spread, cooldown, daily-loss, and position-limit checks.
- Fixed-lot and risk-percent sizing with ATR stops, fixed-pip fallback, hard minimum-stop protection, slippage buffer, commission-aware audit, symbol risk cap, and drawdown-based risk reduction.
- Local M1/M5 execution-quality confirmation using structure, ATR shock, breakout, momentum, body/wick/close-edge behavior, sweep logic, and optional entry-moment triggers.
- Order placement, SL/TP handling, trailing, break-even, partial close, staged de-risking, reverse workflows, and queued retry behavior.
- External PM commands for EXIT, REDUCE, ADD, EXIT_AND_REVERSE, history, and snapshot operations.
- Protected ADD/pyramiding paths with profit-funded sizing, lock-before-ADD, common-SL protection, margin and basket-risk guards, approval lanes, and emergency controls.
- Runtime panels for PM Core, live-confirmation, ADD, REDUCE, risk, bridge scan, compact monitoring, and command diagnostics.
- Heartbeat, position, history, audit, lineage, trade-operation, pause, kill-switch, and AutoTuner OHLC bridge outputs.
04
Architecture and responsibility layers
External analytics and policy
Python research, ranking, and portfolio systems decide what should be proposed and write structured entry or PM command files.
MT4 execution endpoint
SignalFileTrader parses commands, validates local market/terminal state, calculates risk, submits or manages orders, and controls retries.
Broker operation layer
MetaTrader applies broker-specific order, stop, lot, margin, spread, slippage, and trade-operation constraints.
Feedback and observability
The EA exports heartbeat, positions, history, completion state, audits, lineage, OHLC responses, and trade-operation diagnostics back to Python/operator tooling.
05
Operating workflow
- Receive a structured entry row in TradePicker_Entries.csv or a management row in TradePicker_Commands.csv.
- Parse symbol, direction/action, timestamp, score, confidence, identifiers, and optional metadata.
- Validate age, timestamp quality, duplicate state, spread, cooldown, daily loss, maximum positions, confidence, score, and ATR readiness.
- Optionally apply local M1/M5 chart confirmation as a final execution-quality gate.
- Calculate lot size, SL, TP, slippage allowance, commission-aware risk, and broker constraints.
- Submit the trade operation or queue a retry for eligible transient failures.
- Manage open positions with trailing, break-even, partial close, reverse, ADD, REDUCE, and protection rules.
- Write processed-entry state, heartbeat, positions, history, risk audit, lineage, trade logs, and operation diagnostics.
- Respond to pause/kill-switch controls and expose runtime state through MT4 panels and journals.
06
Data and command interfaces
| Interface | Direction | Purpose |
|---|---|---|
| TradePicker_Entries.csv | Python → MT4 | Carries entry proposals and associated score/confidence metadata. |
| TradePicker_Commands.csv | Python → MT4 | Carries EXIT, REDUCE, ADD, reverse, history, and bridge-management commands. |
| PM_AddRequests / PM_AddApprovals / PM_AddReadiness | MT4 ↔ Python | Supports approval-oriented ADD coordination and readiness diagnostics. |
| PM_Positions.csv / PM_ClosedTrades.csv | MT4 → Python | Exports open-position snapshots and closed-trade history for external monitoring and policy review. |
| MT4_Bridge_Status.csv and audit/log files | MT4 → monitoring/audit | Reports heartbeat, risk calculation, profile/signal lineage, trade lifecycle, retries, and operation errors. |
| AutoTuner OHLC request/response/status files | Python ↔ MT4 | Provides on-demand or optional continuous local-time candle data to external tuning workflows. |
| STAGE25_PAUSE / STAGE25_KILL_SWITCH | External control → MT4 | Provides operational interlocks independent of the main signal and command lanes. |
07A
System outputs
- Broker entry, SL/TP, and position-management operations
- Processed-entry and PM command state
- Open-position and closed-history snapshots
- Bridge heartbeat and terminal status
- Entry-risk audit and signal/profile lineage
- Trade lifecycle and queued-operation diagnostics
- OHLC bridge responses and readiness state
07B
Safety and control layers
- Signal age, future timestamp skew, timestamp parsing, duplicate IDs, score, confidence, spread, cooldown, daily-loss, and position-limit gates operate before entry.
- ATR availability, minimum stop distance, min-lot overshoot, slippage, commission, symbol risk, margin, basket risk, and drawdown controls constrain sizing and execution.
- ADD, REDUCE, EXIT, and reverse commands have age, repeat, cooldown, rate, pending-state, and urgency handling.
- External pause and kill-switch files provide independent operational interlocks.
08
Validation evidence
- The supplied public-demo validation report records source-identity checks, forbidden-API scanning, private-include/compiled-artifact scanning, delimiter checks, expected MQL4 event handlers, and package manifest/SHA-256 generation.
- MetaEditor compilation was not performed in the repository-preparation environment because the proprietary compiler was unavailable; local compile and disabled-AutoTrading chart review remain required acceptance checks.
- The public demo does not connect to private Python services, broker accounts, production CSV protocols, or proprietary risk/confirmation logic.
09
Public and private boundaries
Published evidence
Execution-agent responsibilities, command handoff, terminal-side validation, order and position actions, acknowledgement/result states, runtime panels, and selected diagnostic captures.
Protected implementation
Complete source, private command schemas and samples, broker and account settings, production logs, credentials, deployment details, and sensitive local risk controls.
10
Interpretation and limitations
- SignalFileTrader executes commands; it is not the strategy-research or multi-asset decision engine.
- Broker-specific execution, symbol rules, slippage, spreads, terminal state, and deployment conditions require independent testing.
- Public screenshots and documentation do not establish unattended production readiness or trading performance.
11
Additional interface evidence
Repository-backup evidence
These captures come directly from the supplied GitHub backup and are displayed openly on this page.
Source details
Source: SignalFileTrader-PRO-for-MetaTrader/docs/screenshots/main-panel-light.pngSource details
Source: SignalFileTrader-PRO-for-MetaTrader/docs/screenshots/pm-core-cfg.pngSource details
Source: SignalFileTrader-PRO-for-MetaTrader/docs/screenshots/pm-lc-cfg.pngSource details
Source: SignalFileTrader-PRO-for-MetaTrader/docs/screenshots/pm-add-cfg.pngSource details
Source: SignalFileTrader-PRO-for-MetaTrader/docs/screenshots/pm-reduce-panel.pngSource details
Source: SignalFileTrader-PRO-for-MetaTrader/docs/screenshots/journal-add-commands.pngSource details
Source: SignalFileTrader-PRO-for-MetaTrader/docs/screenshots/journal-reduce-commands.pngSource details
Source: SignalFileTrader-PRO-for-MetaTrader/docs/screenshots/risk-micro-panel.pngSource details
Source: SignalFileTrader-PRO-for-MetaTrader/images/public-demo.pngPreviously documented portfolio evidence
