Action Macro Recorder
Managing a trade well after entry is usually a fixed routine: take half off, move the stop to breakeven, trail the rest. Doing that routine by hand every time is slow and inconsistent under pressure. This panel lets you build the routine once as a macro, then fire the whole thing with one click on whichever ticket you have selected. A macro is a list of relative, ticket-agnostic steps, not a literal replay of the exact prices seen while recording. "Move to breakeven plus two pips, then trail fifteen pips" makes sense against any ticket recorded today or next week; a hardcoded price would not. Six macro slots are available so different setups can each keep their own routine. Press Pick nearest ticket to select the newest open trade on the chart's symbol matching the magic filter (there is no reliable native ticket-picker widget, so the panel offers the common single-trade case directly). Press Play on selected to run every step of the active slot's macro against that ticket in order, stopping early and reporting plainly if the ticket closes partway through. Notes and limitations - Ticket selection is "nearest open trade on this symbol matching the magic filter", not a free-text ticket number entry - there is no reliable ticket-picker chart control available on either platform. - A macro step that fails (broker rejection, stop too close to market) is reported and playback continues with the remaining steps unless the ticket itself has closed, in which case the rest of the sequence is skipped and reported. - Breakeven and trail steps respect the symbol's stop and freeze level, widening the requested distance rather than sending a stop the broker would reject outright. - Macro slots are held in memory only for the current chart session; they are not saved to disk and reset on EA restart or template reload, on both platforms.
Expert advisor · MT5 · v1.0 · Free
About Action Macro Recorder
Action Macro Recorder is an expert advisor (trading robot) for MetaTrader 5. It moves the stop loss behind price (trailing stop / break-even) and has a news filter. It has 7 settings, such as Magic number, Slippage pips and Max retries. MQL source code included.
Files in the download: ActionMacroRecorder.ex5, ActionMacroRecorder.mq5, ActionMacroRecorder.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Magic number | 20260390 | Magic number filter - macros act only on tickets with this magic (0 = any) |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per trade action before giving up |
| Retry wait ms | 400 | Pause between attempts, milliseconds |
| Corner | 1 | Panel corner: 0=top-left 1=top-right 2=bottom-left 3=bottom-right |
| X offset | 12 | Panel offset from the chosen corner, X pixels |
| Y offset | 18 | Panel offset from the chosen corner, Y pixels |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Experts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Trailing Stop & Break-even · News Trading · MT5 Expert Advisor · MQL5 Source Code