Limit Order Chaser
A limit order placed a fixed distance from the market and left alone either fills eventually or never fills at all, and "never" is the outcome that costs a missed trade. This EA rests a limit order at a chosen offset and, as the market moves, repositions it to keep chasing that same offset - but only within a capped band measured from where the plan originally started, and only until a deadline. Past either limit, it stops chasing and, once the deadline is reached, cancels the resting order and sends a market order instead so the position is guaranteed to be entered one way or another. Repricing uses OrderModify on the existing ticket rather than deleting and recreating the order: it is one broker round trip instead of two, and it never leaves a moment with no resting order at all, which a delete-then-recreate sequence briefly does. The chase distance is measured from the original reference price at placement, not from the last reprice, so a slow grind in one direction cannot walk the order arbitrarily far from where it was actually meant to sit - once the band is exhausted the EA simply waits for the deadline rather than following the market indefinitely. Notes and limitations - One order per run. The EA places a single pending order, manages it to either a fill or a deadline conversion, and then stops - it does not repeat automatically. - If the terminal or EA stops running while an order is still resting, that order is left on the broker exactly as it is - it is no longer chased or converted at the deadline once the EA is not running to do it. - The deadline's guaranteed market order can still fail after every retry (for example if AutoTrading is off or the connection is down); the EA logs this loudly rather than assuming it succeeded. - Repricing checks the broker's minimum stop and freeze distance before every move and skips a cycle rather than sending a price that would be rejected.
Expert advisor · MT5 · v1.0 · Free
About Limit Order Chaser
Limit Order Chaser is an expert advisor (trading robot) for MetaTrader 5. It places pending buy/sell stop or limit orders and has a news filter. It has 13 settings, such as Direction, Lots and Entry offset pips. MQL source code included.
Files in the download: LimitOrderChaser.ex5, LimitOrderChaser.mq5, LimitOrderChaser.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 |
|---|---|---|
| Direction | CHASER_BUY | Direction to enter |
| Lots | 0.10 | Order size |
| Entry offset pips | 10 | Distance from market for the resting limit, in pips |
| Reprice threshold pips | 5 | Market movement required since the last reprice before moving again |
| Max chase pips | 40 | Maximum drift from the original reference price - beyond this it waits, does not chase further |
| Deadline minutes | 30 | Convert to a market order if still unfilled after this long |
| Stop loss pips | 0 | Stop loss attached on placement, pips (0 = none) |
| Take profit pips | 0 | Take profit attached on placement, pips (0 = none) |
| Start trading | false | Must be true for the EA to actually place or modify orders |
| Magic number | 20261206 | Magic number identifying this order |
| Slippage pips | 3 | Slippage tolerance, in pips (used only for the deadline market order) |
| Max retries | 5 | Attempts per action before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
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: Pending Orders · News Trading · MT5 Expert Advisor · MQL5 Source Code