Quant Metrics

  • Bibliothèque
  • Shipra Gupta
    Shipra Gupta
    Je suis Shipra Gupta, trader et développeuse de stratégies quantitatives avec une solide formation en mathématiques, économie et systèmes de trading algorithmique. Au fil des années, j’ai travaillé activement sur les marchés du forex, de l’or, des indices, des matières premières et des
  • Version: 1.0

QuantMetrics – Deflated Sharpe, Monte Carlo & OnTester Criteria

Stop optimising on net profit. QuantMetrics gives your EA the statistics quant funds use to separate skill from luck, in a single #import.

Features

  • Deflated Sharpe Ratio (DSR) – Bailey & López de Prado. Probability your Sharpe is real after accounting for skew, fat tails and the number of optimisation passes.
  • Probabilistic Sharpe Ratio (PSR) – Probability the true Sharpe beats any benchmark, given your sample size.
  • Monte Carlo – Trade-order reshuffling: drawdown at any percentile and probability of ruin.
  • Risk-adjusted ratios – Sharpe, Sortino, Calmar, CAGR, Ulcer Index, Ulcer Performance Index, Kestner K-Ratio, Van Tharp SQN, skewness, kurtosis.
  • 10 OnTester criteria – Recovery, Sharpe, Sortino, Calmar, UPI, K-Ratio, SQN, PSR, DSR, PSR×Calmar, with a minimum trade count.
  • Reads history directly – Filter by magic and symbol. Swaps, commissions and fees are included. Or load your own return array.

Quick start

1. Buy and download the library. MetaTrader installs it to MQL5\Libraries\QuantMetrics.ex5.
2. Paste the import block below at the top of your EA, indicator or script.
3. Call the functions.

double OnTester()
  {
   QM_BuildFromHistory(TesterStatistics(STAT_INITIAL_DEPOSIT),-1,"");
   QM_SetTrials(200);              // optimisation passes you ran
   Print(QM_Report());
   return(QM_Criterion(QM_CRIT_DSR,30));
  }

Import block (copy into your code)

#define QM_OK              0
#define QM_ERR_NODATA      1
#define QM_ERR_PARAM       2
#define QM_ERR_HISTORY     3
#define QM_CRIT_RECOVERY   0
#define QM_CRIT_SHARPE     1
#define QM_CRIT_SORTINO    2
#define QM_CRIT_CALMAR     3
#define QM_CRIT_UPI        4
#define QM_CRIT_KRATIO     5
#define QM_CRIT_SQN        6
#define QM_CRIT_PSR        7
#define QM_CRIT_DSR        8
#define QM_CRIT_PSR_CALMAR 9

#import "QuantMetrics.ex5"
int QM_LastError();
int QM_BuildFromHistory(const double initial_deposit,const long magic,const string symbol);
int QM_LoadReturns(const double &returns[],const double start_equity,const double years);
int QM_Trades();
double QM_NetProfit();
double QM_WinRate();
double QM_ProfitFactor();
double QM_Expectancy();
int QM_MaxConsecLosses();
double QM_MaxDrawdownPct();
double QM_MaxDrawdownMoney();
double QM_RecoveryFactor();
double QM_CAGR();
double QM_Skewness();
double QM_Kurtosis();
double QM_Sharpe(const bool annualize);
double QM_Sortino(const bool annualize);
double QM_Calmar();
double QM_UlcerIndex();
double QM_UlcerPerformance();
double QM_KRatio();
double QM_SQN();
double QM_ProbabilisticSharpe(const double benchmark_sr);
bool QM_SetTrials(const int trials);
double QM_DeflatedSharpe();
bool QM_MonteCarlo(const int sims,const double percentile,const double ruin_dd_pct, const uint seed,double &dd_at_percentile,double &prob_ruin);
double QM_Criterion(const int mode,const int min_trades);
string QM_Report();
#import

Notes

  • Select Custom max in the Strategy Tester to rank passes by your criterion.
  • Monte Carlo work is capped so optimisation stays fast.
  • Example on S&P 500 daily (Donchian 55/20): PSR 0.90 falls to DSR 0.11 after 100 tested variants.

Technical

  • Pure MQL5. No DLL, no WebRequest, no file I/O.
  • Every exported function validates its inputs. QM_LastError() returns the reason for any failed call.
  • Works in the Strategy Tester and live, on any broker, symbol and account currency.

Past performance shown in screenshots is from historical data and does not guarantee future results.



Plus de l'auteur
AMD Po3
Shipra Gupta
AMD Po3 for MetaTrader 5 Accumulation, manipulation, distribution: mapped for you. AMD Po3 is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator maps the reaction zones that matter right now: the nearest areas above and
KN Smart TP SL Signals — Croisement EMA + TP/SL Intelligents KN Smart TP SL Signals est un indicateur de croisement EMA clair pour MetaTrader 5 qui transforme chaque croisement confirmé en une configuration de trading visuelle complète : Entry → Stop Loss → TP1 → TP2 → TP3 Aucun calcul manuel des niveaux n'est nécessaire. Logique principale L'EMA rapide croise au-dessus de l'EMA lente → Achat L'EMA rapide croise en dessous de l'EMA lente → Vente Les signaux sont confirmés sur des chandeliers cl
IFVG Sniper Entry Engine — Description pour le MQL5 Marketplace IFVG Sniper Entry Engine est un indicateur MT5 de précision conçu autour de l'un des modèles d'entrée les plus spécifiques et à haute probabilité des Smart Money Concepts : l'Inverse Fair Value Gap (IFVG). Il suit silencieusement chaque Fair Value Gap brut formé sur le graphique, surveille chacun d'eux pour détecter une inversion (mitigation), et au moment où un IFVG qualifié est confirmé, il déclenche un signal d'ACHAT (BUY) ou de
Coppock Curve MultiFilter for MetaTrader 5 The classic Coppock curve with modern filters. Coppock Curve MultiFilter is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator plots its oscillator in a separate subwindow with
FREE
Tension Flow Trend — Ruban HMA Dynamique avec Backtest Historique du RR Tension Flow Trend est un indicateur de suivi de tendance avancé pour MetaTrader 5 qui combine un ruban de tendance de moyenne mobile de Hull (HMA), une analyse de momentum Z-Score, et un moteur de backtesting visuel du Rappor Risque:Récompense (Risk:Reward) intégré sur un seul graphique. Conçu pour identifier les opportunités de continuation de tendance à haute probabilité, l'indicateur filtre le bruit du marché en exigeant
FREE
Adaptive RSI Supertrend for MetaTrader 5 Trend and RSI momentum in one view. Adaptive RSI Supertrend is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the trend: bull co
FREE
Trend Target Ribbon [BOSWaves] Trend Target Ribbon [BOSWaves] est un indicateur avancé et multifonctionnel de suivi de tendance et de gestion du risque conçu pour MetaTrader 5 (MQL5). Il combine une Arnaud Legoux Moving Average (ALMA) lissée avec des filtres de confirmation basés sur la volatilité et la pente afin de cartographier les tendances du marché, les ribbons dynamiques colorés et les projections automatisées de trades à plusieurs niveaux de Risk-to-Reward ($R$). Fonctionnalités principa
FREE
Structure-Anchored VWAP [WAT] Structure-Anchored VWAP [WAT] est un indicateur VWAP pour MetaTrader 5 basé sur la structure du marché. Il ancre le VWAP sur des swings et des points structurels significatifs plutôt que de dépendre uniquement de réinitialisations fixes de session. Il combine Structure du Marché + VWAP Ancré + Bandes d'Écart + Signaux de Retest + Gestion des Trades basée sur l'ATR dans un seul cadre visuel. Fonctionnalités principales 3 modes d'ancrage — Swing, Structure et Fast
FREE
Liquidity Intelligence System — Description pour le MQL5 Marketplace Liquidity Intelligence System est un indicateur MT5 de qualité institutionnelle qui cartographie les pools de liquidité du Smart Money, détecte les configurations de chasse et retournement (sweep-and-reverse), et génère des signaux de trading à haute confluence grâce à 16 modèles de signaux testables indépendamment — le tout au sein d'un seul indicateur épuré. Comment Ça Fonctionne Le moteur construit en continu une carte de la
Precision Sniper Trader Precision Sniper Trader est un indicateur professionnel de suivi de tendance et de confirmation de momentum, conçu pour les traders qui recherchent une exécution propre sur leurs graphiques, des entrées à haute probabilité et une gestion structurée des transactions sur les marchés du Forex, de l'Or, des Indices et des Crypto-monnaies. Conçu avec une approche de style "sniper", l'indicateur combine l'analyse de tendance EMA, la confirmation de momentum, des objectifs dynam
FREE
TrendIQ Pro for MetaTrader 5 Adaptive volatility trend with a trend cloud. TrendIQ Pro is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the trend: bull colour for long
INDICATEUR SQUEEZE MOMENTUM BREAKOUT MT5 Système de Trading Professionnel de Compression de Volatilité & de Cassure de Momentum pour MetaTrader 5 Squeeze Momentum Breakout est un indicateur de cassure (breakout) de qualité professionnelle pour MT5, conçu pour détecter les mouvements de marché explosifs après des périodes de consolidation à faible volatilité. Conçu pour les scalpers, les traders intraday et les traders de momentum, cet indicateur combine la compression de la volatilité, la confir
FREE
INDICATEUR VOLUME BREAKOUT PRO MT5 Système de Trading Professionnel d'Expansion de Volume & de Cassure pour MetaTrader 5 Volume Breakout Pro est un indicateur de cassure (breakout) de niveau institutionnel développé spécifiquement pour la plateforme MetaTrader 5. Conçu pour les scalpers, les day traders et les traders de cassure de momentum, le système se concentre sur l'identification des mouvements de prix explosifs alimentés par une expansion anormale du volume et un déséquilibre de la liquid
FREE
Meridian Flow — Indicateur Smart Money Structure pour MT5 Meridian Flow est un indicateur MetaTrader 5 conçu pour les traders utilisant les Smart Money Concepts (SMC) et la méthodologie ICT Price Action . Il détecte automatiquement les événements BOS (Break of Structure) et CHoCH (Change of Character) sur n'importe quel instrument et timeframe, puis trace une carte complète du risque — Entry, Stop Loss, TP1, TP2 et TP3 — pour chaque signal, y compris les signaux historiques. Les signaux apparai
Adaptive Trend System for MetaTrader 5 A trend line that adapts to volatility. Adaptive Trend System is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the trend: bull co
Market Path Forecast for MetaTrader 5 Projected price paths from swing statistics. Market Path Forecast is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator detects confirmed swing highs and lows and tracks how price b
FREE
RSI Signal Entries for MetaTrader 5 RSI extremes plus candle confirmation. RSI Signal Entries is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator plots its oscillator in a separate subwindow with clear extreme zones.
FREE
Trident Swing Projector for MetaTrader 5 Quarter-swing projections from ABC structures. Trident Swing Projector is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator detects confirmed swing highs and lows and tracks how
Z-Score Range Boxes Breakout for MetaTrader 5 Statistical extremes boxed, breakouts flagged. Z-Score Range Boxes Breakout is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator tracks the range or channel price is tradin
Precision Sniper Pro for MetaTrader 5 Four pillars: EMA, RSI, MACD and ADX. Precision Sniper Pro is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator watches for its signal condition and waits for the candle to close b
FREE
Stealth Trail Supertrend for MetaTrader 5 A supertrend that adapts its own multiplier. Stealth Trail Supertrend is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the tre
Fibonacci Path Profile for MetaTrader 5 How price moved after similar retracements. Fibonacci Path Profile is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator detects confirmed swing highs and lows and tracks how pric
Strong Fade Signals for MetaTrader 5 Fade the overextended move, with a score. Strong Fade Signals is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator watches for its signal condition and waits for the candle to close
FREE
Fan Principle Signals for MetaTrader 5 The classic fan principle, as clear signals. Fan Principle Signals is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator detects confirmed swing highs and lows and tracks how price
McGinley Dynamic Fusion for MetaTrader 5 McGinley Dynamic crossovers with ATR levels. McGinley Dynamic Fusion is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the trend
Liquidity Entry Signals for MetaTrader 5 Entries where liquidity gets taken. Liquidity Entry Signals is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator maps the reaction zones that matter right now: the nearest areas
Cardwell Range Pro for MetaTrader 5 RSI ranges that change with the market regime. Cardwell Range Pro is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator plots its oscillator in a separate subwindow with clear extreme
Adaptive RSI Supertrend for MetaTrader 5 Trend and RSI momentum in one view. Adaptive RSI Supertrend is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the trend: bull co
Market Structure Target Tracker for MetaTrader 5 Swings, BOS, CHoCH and ATR targets. Market Structure Target Tracker is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator detects confirmed swing highs and lows and track
Smart TrendFlow Pro for MetaTrader 5 Channel breaks with a volatility heatmap. Smart TrendFlow Pro is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator tracks the range or channel price is trading in and highlights per
Filtrer:
Aucun avis
Répondre à l'avis