Loading…

Bootstrap Confidence Reporter

"Average profit per trade was $12" means very little on its own if it came from twenty trades - the true figure could plausibly be anywhere from a solid edge to a loss. This tool takes the honest route: it collects this account's closed-trade net P/L (profit + swap + commission) from order history, filtered by symbol and/or magic number, then draws a large number of bootstrap resamples (sampling with replacement from the same trade list) and computes the mean of each resample. The spread of those resampled means, read at the requested percentiles, is the confidence interval - a genuine measure of how much the point estimate could plausibly move around given only this many trades, rather than a number presented as more certain than the sample size supports. It also reports the fraction of resamples with a positive mean, a rough intuition for "how often would resampling this same history still come out ahead." Notes and limitations Bootstrap resampling assumes trades are reasonably independent draws from one underlying distribution - it does not detect or correct for a strategy whose edge genuinely changed partway through the sample (a regime shift would just get averaged into one wider interval, not flagged). With fewer than roughly 20-30 trades the interval will usually be very wide; that width is the honest answer, not a fault of the method. MathRand()'s 0..32767 range is reduced modulo the sample size for each draw, which introduces a negligible bias at realistic trade counts but is worth naming rather than presenting the resampling as perfectly uniform.

Expert advisor · MT5 · v1.0 · Free

About Bootstrap Confidence Reporter

Bootstrap Confidence Reporter is a script for MetaTrader 5. It has 10 settings, such as Corner, X offset and Y offset. MQL source code included.

Files in the download: BootstrapConfidenceReporter.ex5, BootstrapConfidenceReporter.mq5, BootstrapConfidenceReporter.txt.

Settings

SettingDefaultWhat it does
Corner0Panel corner: 0=top-left 1=top-right 2=bottom-left 3=bottom-right
X offset12Panel offset from the chosen corner, X pixels
Y offset18Panel offset from the chosen corner, Y pixels
Symbol filterOnly trades on this symbol; blank = every symbol in history
Magic filter0Only trades with this magic number; 0 = every magic
Max trades2000Cap on how many most-recent closed trades are pulled from history
Num resamples2000Number of bootstrap resamples to draw
Confidence level0.95Confidence level for the reported interval, e.g. 0.95 = 95%
Write report filetrueAlso write the report to MQL5\Files\
Report file nameBootstrapConfidenceReport.txtOutput file name (only used if InpWriteReportFile)

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria