Loading…

Dry Run Order Preview

The safest way to validate an EA's entry logic is to run the real code path and stop one line before the call that actually risks money. This tool does exactly that: click Preview Buy or Preview Sell and it computes lot size (fixed, or risk-percent using the symbol's own tick value and tick size scaled by the intended lot size - never a hardcoded contract size), the stop and target price, and checks the result against the broker's minimum stop and freeze distances, exactly as a live entry function would. It then prints the trade call it would have made, draws the three price levels on the chart, and stops there. This exists because the two most common ways an EA misbehaves live - silent broker rejection from a stop set too close, and a lot size that comes out wrong from a sizing formula - are both invisible until an order has already been sent. Previewing surfaces both before either one costs anything. Notes and limitations - Never sends, modifies or closes a trade under any input combination on either platform. It is a read-and-display tool only. - The previewed lot size and prices are computed from current market data at the moment of the click; they will differ from what a live entry sees a moment later as price moves. - Slippage in the printed call is a fixed illustrative 3 pips, not an input - this tool previews sizing and distance validation, not execution behaviour.

Expert advisor · MT4 · v1.0 · Free

About Dry Run Order Preview

Dry Run Order Preview is an expert advisor (trading robot) for MetaTrader 4. It can size trades from your balance and risk percent. It has 6 settings, such as Use risk sizing, Risk percent and Fixed lots. MQL source code included.

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

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

Settings

SettingDefaultWhat it does
Use risk sizingtruePreview risk-percent sizing instead of a fixed lot
Risk percent1.0Percent of equity risked, used only when risk sizing is on
Fixed lots0.10Lot size previewed when risk sizing is off
Stop loss pips50Stop loss distance, in pips
Take profit pips100Take profit distance, in pips (0 = none)
Magic number20260821Magic number the preview shows in the would-be OrderSend call

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: Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria