Patient Entry Cost Comparator
"Wait for a better price before entering" is common trading advice, but it is rarely measured. Waiting can just as easily let the market run away from a good entry as it can offer a better one, and without a running record most traders only remember the times it worked. This EA uses a plain fast/slow moving-average cross as its entry signal, deliberately simple because the point of the submission is the patience bookkeeping around the signal, not the signal itself. The moment a fresh cross appears, the price at that instant is captured as the "immediate" reference price and a short wait begins. If price improves by a configurable pip distance before the wait expires, the order is sent immediately at that improved price. If the wait expires first, the order is sent at whatever the market price is by then - patience is never allowed to become "wait indefinitely for a price that may never come." Every entry, whichever way it resolved, is logged to a CSV row recording the signal price, the actual entry price, how long the wait ran, whether it timed out, and the pip difference in the trade's favour or against it compared with having entered immediately at the signal - plus a running average across every logged entry, so the honest answer to "does this patience actually help on this symbol and timeframe" accumulates in the file rather than staying a feeling. Notes and limitations Only one position is held at a time under this EA's magic number - a new signal is ignored while a position from this EA is already open, so the comparator's bookkeeping never has to attribute a result across overlapping trades. The moving-average cross is a deliberately plain signal, not a tuned strategy. Trade quality from the signal itself should not be read into the comparator's pips-saved figure - that figure answers "did waiting help on this particular entry", not "was this a good trade." The "pips saved" figure is measured against the signal-moment price only. It says nothing about spread, slippage on the eventual OrderSend, or the stop-loss/take-profit outcome of the trade itself - a patient entry can show a favourable pips-saved figure and still lose on its stop. This EA trades real minimal-lot positions with a fixed stop-loss and take-profit - it carries real market risk like any other automated strategy, and the CSV log does not replace normal trade review.
Expert advisor · MT4 · v1.0 · Free
About Patient Entry Cost Comparator
Patient Entry Cost Comparator is an expert advisor (trading robot) for MetaTrader 4 based on Moving Average. It increases the lot size after a losing trade (martingale). It has 10 settings, such as Fast ma period, Slow ma period and Ma method. MQL source code included.
Files in the download: PatientEntryComparator.ex4, PatientEntryComparator.mq4, PatientEntryComparator.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 |
|---|---|---|
| Fast ma period | 8 | Fast moving average period |
| Slow ma period | 21 | Slow moving average period |
| Ma method | MODE_EMA | Moving average method |
| Improvement pips | 2.0 | Price improvement, pips, that ends the wait early |
| Max wait seconds | 45 | Maximum time to wait for improvement before entering at market anyway |
| Stop loss pips | 20.0 | Stop-loss distance, pips |
| Take profit pips | 30.0 | Take-profit distance, pips |
| Slippage points | 30 | Slippage tolerance for the entry order, points |
| Magic number | 24105700 | Magic number that tells this EA's orders apart |
| Log file name | PatientEntryComparator.csv | File written under MQL4\Files\ |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 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: Buy/Sell Arrows · Martingale · Moving Average · MT4 Expert Advisor · MQL4 Source Code