Loading…

Reviewed Batch Executor

Reviewing a list of intended trades before they happen is normal practice for anyone managing more than a handful of positions, but few free tools separate "what would this do" from "do it" cleanly. This EA reads a CSV batch file with one line per action - OPEN, CLOSE, MODIFY, or CLOSEALL - validates every line against live broker constraints (lot step/min/max, MODE_STOPLEVEL), and by default only previews: nothing is sent, and a result file records exactly what each line would have done or why it would have been rejected. A batch only goes live when two independent things are both true: a separate confirm file exists in MQL4\Files\ (or MQL5\Files\ on the native MQL5 build), and InpForcePreview is set to false. Deleting the confirm file (or leaving InpForcePreview at its default) forces every run back to preview, so a batch cannot go live by accident just because the file changed - a second, deliberate action is required. CLOSE and MODIFY additionally refuse to touch any ticket that does not carry this EA's own magic number, so a batch file cannot be used to accidentally manage another EA's or a manual trade's position. The EA re-runs the whole batch automatically whenever the file's content changes (detected by a byte checksum, not a modification-time API), and writes one row per line to the result file - line number, action, symbol, status (OK/FAIL or PREVIEW-OK/PREVIEW-REJECT), and a plain-text reason - so a reviewer can see precisely what happened to every single line, not just a pass/fail summary. Notes and limitations - This is not a scripting language - the four actions (OPEN, CLOSE, MODIFY, CLOSEALL) are the entire vocabulary. No conditional logic, loops, or expressions inside the batch file. - Change detection is a byte checksum over the file, not a modification-time API - editing the file and saving with identical content will not trigger a re-run, which is expected and safe. - CLOSEALL closes every own-magic position on the given symbol; if some individual closes fail (requote, off quotes) the row is marked FAIL with a partial count, but any legs that did close stay closed - it is not transactional. - A pending-order type (limit/stop) is not created by OPEN; only market entries are supported in this version. - The result file is rewritten (not appended) on every pass, so only the most recent pass's results are kept.

Expert advisor · MT4 · v1.0 · Free

About Reviewed Batch Executor

Reviewed Batch Executor is an expert advisor (trading robot) for MetaTrader 4. It has a news filter. It has 7 settings, such as Batch file, Result file and Confirm file. MQL source code included.

Files in the download: ReviewedBatchExecutor.ex4, ReviewedBatchExecutor.mq4, ReviewedBatchExecutor.txt.

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Batch filebatch_orders.csvBatch file to read, in MQL4\Files\
Result filebatch_result.csvPer-line result file written after each pass
Confirm filebatch_confirm.txtMust exist for a live (non-preview) pass to run
Force previewtruetrue = always preview only, regardless of the confirm file
Magic number47800Magic number stamped on OPENs; also the only magic MODIFY/CLOSE may touch
Slippage points30Slippage allowed on market actions
Poll seconds3Seconds between checks of the batch file for changes

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: News Trading · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria