Quant Metrics

  • librerie
  • Shipra Gupta
    Shipra Gupta
    Sono Shipra Gupta, trader e sviluppatrice di strategie quantitative con una solida formazione in matematica, economia e sistemi di trading algoritmico. Nel corso degli anni ho lavorato ampiamente nei mercati forex, oro, indici, materie prime e criptovalute, concentrandomi sulla costruzione di
  • Versione: 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.



Altri dall’autore
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 — Incrocio EMA + TP/SL Smart KN Smart TP SL Signals è un indicatore pulito di incrocio EMA per MetaTrader 5 che trasforma ogni incrocio confermato in un setup operativo visivo completo: Entry → Stop Loss → TP1 → TP2 → TP3 Non è necessario calcolare manualmente i livelli. Logica principale La Fast EMA incrocia sopra la Slow EMA → Acquisto La Fast EMA incrocia sotto la Slow EMA → Vendita I segnali vengono confermati sulle candele chiuse , evitando segnali generati dalla can
IFVG Sniper Entry Engine — Descrizione per il Marketplace MQL5 IFVG Sniper Entry Engine è un indicatore MT5 di precisione sviluppato attorno a uno dei modelli di ingresso più specifici e ad alta probabilità di Smart Money Concepts: l'Inverse Fair Value Gap (IFVG). Monitora silenziosamente ogni Fair Value Gap grezzo formato sul grafico, controlla ciascuno di essi per verificarne l'inversione (mitigazione) e, nel momento in cui viene confermato un IFVG valido, emette un segnale di ACQUISTO (BUY) o
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 — Nastro HMA Dinamico con Backtest Storico RR Tension Flow Trend è un indicatore di trend-following avanzato per MetaTrader 5 che combina un nastro di tendenza basato sulla Media Mobile di Hull (HMA), un'analisi del momentum Z-Score e un motore di backtesting visivo del rapporto Rischio:Rendimento (Risk:Reward) integrato in un unico overlay sul grafico. Progettato per identificare opportunità di continuazione del trend ad alta probabilità, l'indicatore filtra il rumore del mer
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] , MetaTrader 5 (MQL5) için geliştirilmiş gelişmiş ve çok yönlü bir trend takip ve risk yönetimi göstergesidir. Pürüzsüzleştirilmiş Arnaud Legoux Moving Average (ALMA) çekirdeğini volatilite ve eğim tabanlı doğrulama filtreleriyle birleştirerek piyasa trendlerini, renk kodlu dinamik ribbon'ları ve otomatik çok seviyeli Risk-to-Reward ($R$) işlem projeksiyonlarını gösterir. Temel Özellikler 1. ALMA Trend Ribbon ve Eğim Filtreleme ALMA S
FREE
Structure-Anchored VWAP [WAT] Structure-Anchored VWAP [WAT] è un indicatore VWAP per MetaTrader 5 basato sulla struttura del mercato. Ancora il VWAP a swing e punti strutturali significativi invece di affidarsi esclusivamente a reset fissi della sessione. Combina Struttura di Mercato + Anchored VWAP + Bande di Deviazione + Segnali di Retest + Gestione del Trade basata su ATR in un unico framework visivo. Caratteristiche principali 3 modalità di ancoraggio — Swing, Structure e Fast Rilevament
FREE
Liquidity Intelligence System — Descrizione per il Marketplace MQL5 Liquidity Intelligence System è un indicatore MT5 di livello istituzionale che mappa i pool di liquidità dello Smart Money, rileva le configurazioni di caccia alla liquidità e inversione (sweep-and-reverse) e genera segnali di trading ad alta confluenza attraverso 16 modelli di segnale testabili in modo indipendente, il tutto all'interno di un unico indicatore pulito. Come Funziona Il motore costruisce continuamente una mappa de
Precision Sniper Trader Precision Sniper Trader è un indicatore professionale di trend-following e conferma del momentum, progettato per i trader che desiderano un'esecuzione pulita sui grafici, ingressi ad alta probabilità e una gestione strutturata delle operazioni nei mercati Forex, Oro, Indici e Criptovalute. Sviluppato con un approccio in stile "sniper" (cecchino), l'indicatore combina l'analisi del trend basata su EMA, la conferma del momentum, target dinamici basati sull'ATR e un filtragg
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
INDICATORE SQUEEZE MOMENTUM BREAKOUT MT5 Sistema di Trading Professionale di Compressione della Volatilità e Breakout del Momentum per MetaTrader 5 Squeeze Momentum Breakout è un indicatore di breakout di livello professionale per MT5 progettato per rilevare movimenti di mercato esplosivi dopo periodi di consolidamento a bassa volatilità. Sviluppato per scalper, trader intraday e momentum trader, l'indicatore combina la compressione della volatilità, la conferma del momentum, il filtraggio dei v
FREE
INDICATORE VOLUME BREAKOUT PRO MT5 Sistema di Trading Professionale di Espansione del Volume e Breakout per MetaTrader 5 Volume Breakout Pro è un indicatore di breakout di livello istituzionale sviluppato specificamente per la piattaforma MetaTrader 5. Progettato per scalper, day trader e momentum trader, il sistema si concentra sull'identificazione di movimenti di prezzo esplosivi guidati da un'espansione anomala del volume e da uno squilibrio di liquidità. L'indicatore combina: Logica dell'Osc
FREE
Meridian Flow — Indicatore Smart Money Structure per MT5 Meridian Flow è un indicatore per MetaTrader 5 progettato per i trader che utilizzano Smart Money Concepts (SMC) e la metodologia ICT Price Action . Rileva automaticamente gli eventi BOS (Break of Structure) e CHoCH (Change of Character) su qualsiasi strumento e timeframe, quindi traccia una mappa completa del rischio — Entry, Stop Loss, TP1, TP2 e TP3 — per ogni segnale, inclusi quelli storici. I segnali vengono generati esclusivamente s
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
Filtro:
Nessuna recensione
Rispondi alla recensione