Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Twitter !
Rejoignez notre page de fans
Un script intéressant ?
Poster un lien vers celui-ci -
laisser les autres l'évaluer
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
Scripts

Edge Drift Detector - script pour MetaTrader 5

Real author
Publié par:
Cristian David Castillo Arrieta
Cristian David Castillo Arrieta
Professionnel en Finance et Commerce International avec une spécialisation en Gestion Financière. Développeur autodidacte en MQL5 et Python, spécialisé dans le trading algorithmique, la construction de portefeuilles multi-actifs et la gestion quantitative des risques.
Vues:
142
Note:
(1)
Publié:
\MQL5\Script\
EdgeDrift.mq5 (52.59 KB) afficher
MQL5 Freelance Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance

Edgedrift


A live Expert Advisor can stay in profit long after its edge has gone. The Edge Drift Detector answers one question with a statistical test: do the live closing deals still come from the same distribution as the backtest, or has the average result per deal fallen toward zero?

The script reads two CSV files and prints a full report in the Experts tab:

A live Expert Advisor can stay in profit long after its edge has gone. The Edge Drift Detector answers one question with a statistical test: do the live closing deals still come from the same distribution as the backtest, or has the average result per deal fallen toward zero?

The script reads two CSV files and prints a full report in the Experts tab:

  • CUSUM edge-loss detector: an alarm threshold calibrated by bootstrap from the backtest deals, with a false-alarm rate you choose over a planned monitoring horizon.
  • Drift start: the deal and date after which the drift most likely began.
  • Two-horizon check: bootstrap tail probabilities for the last 20 and the last 100 deals.
  • Expectancy decomposition: the change in expectancy split into win-rate, win-size, and loss-size effects.
  • Symbol mix check: a warning when the live account trades a different mix of instruments than the baseline, since per-lot results of different symbols are not comparable.
  • Detection delay: the median number of deals needed to confirm a complete loss of edge for this strategy.
  • Edge Health Score (A+ to F) and a CONTINUE, WATCH, REDUCE, or SUSPEND verdict with written recommendations.

Input. No code changes are needed. Backtest the Expert Advisor, right-click the Backtest results, choose Report, and save it as HTML in the common Files folder. Then run EdgeDrift.mq5 on the live account with the Expert Advisor's magic number. The script finds the newest ReportTester*.html file by itself and reads the live deals from the account history. On the first run, before any report exists, it prints these steps and analyzes built-in demonstration data. Two alternatives are available: a CSV baseline or live file, and a baseline taken from the same account before a chosen date. DriftExport.mq5 is an optional helper that writes the live deals to CSV when the account runs on another terminal.

Files. Both scripts go to MQL5\Scripts\EdgeDrift. The attached MQL5.zip already has this structure.

Parameters. InpBaseSource selects a tester report, a CSV file, or the account history. InpLiveSource selects the account history or a CSV file. InpMagic, InpSymbol, and InpLiveFrom filter the deals. InpMaxMixGap sets the symbol mix difference that triggers a warning. InpHorizon sets the planned monitoring horizon in deals. InpAlpha sets the false-alarm probability over that horizon. InpShortWindow and InpLongWindow set the two windows. InpBootstrap and InpSeed control the resampling, which is reproducible. InpPerLot normalizes every result to one lot. The score weights, the healthy tail level, and the grade boundaries are all inputs.

Buy GBPJPY Every Monday. That's the Whole Strategy. Buy GBPJPY Every Monday. That's the Whole Strategy.

A free, fully open EA: buy GBPJPY every Monday at 11:00 server time (04:00 New York), close at 23:00. Stays profitable in backtest with the entry anywhere from 09:00 to 13:00. Attach to GBPJPY M1.

Market session indicator lines for scalpers Market session indicator lines for scalpers

Quickly view each and every individual market's open and close times. Very important for short term scalping. I own the copyright, if anyone modifies or uses this it must stay free. Comments and feedback welcome.

Repaint Inspector Repaint Inspector

Measures whether an indicator repaints instead of trusting the claim. It re-reads the buffers of any custom indicator on bars that have already closed and counts every value that changes, appears or disappears, with the furthest shift back at which that still happens. Verdict per buffer on a chart panel, every event written to CSV.

ATS Liquidity City - liquidity pools and sweeps, drawn as a neon city ATS Liquidity City - liquidity pools and sweeps, drawn as a neon city

Shows where stops are likely resting and which ones were just taken. Liquidity pools = confirmed swing highs and lows that price has not traded through yet, equal highs/lows (a bigger pool) and yesterday's high and low. When a bar trades beyond a pool it is marked as swept, and as "grabbed & rejected" if the same bar closes back inside. Non-repainting: a swing is used only after N closed bars on each side. The panel is a neon city drawn on a CCanvas: the price is a flying car, sell stops are towers below it, buy stops floating platforms above it, yesterday's levels golden billboards, a searchlight sweeps the sky and a ticker runs today's catch. Two buffers give the nearest active pool above and below for use in an Expert Advisor. Indicator only: it never trades.