Strategy Tester · Python · Walk-Forward

Backtesting & Optimization — Know What Your Strategy Really Does

We test your strategy the way it would trade live: realistic data and costs, robust optimization, and out-of-sample validation that exposes curve fitting before it costs you money.

Real ticks
MT5 tick data
WFA
Walk-forward analysis
Costs
Spread · commission · slippage
Report
Clear PDF or HTML
Quick answer

Backtesting runs a trading strategy on historical data to estimate how it would have performed; optimization searches for the best parameters. ExpertNevees runs both with realistic spread, commission and slippage, MetaTrader 5 real-tick data or Python simulations, genetic optimization and walk-forward analysis, and reports robustness, drawdown and overfitting risk in a clear report.

What a Professional Backtest Includes

🗂️

Data quality check

Gaps, bad ticks, timezone and rollover issues are checked before any result is trusted.
💸

Realistic costs

Variable spread, commission, swap and slippage assumptions that match your broker.
🔍

Optimization

MT5 genetic algorithm or full grid search, with the number of tested combinations tracked for statistical honesty.
🪟

Walk-forward analysis

Optimize on one window, test on the next, then roll forward, to measure stability on unseen data.
🎲

Monte Carlo and sensitivity

Shuffle trade order, vary parameters and costs to see how fragile the result is.
📄

Decision-ready report

Equity curve, drawdowns, metrics, parameter heatmaps and a plain-language verdict.

Metrics We Report and What They Mean

MetricDefinitionHow to read it
Profit factorGross profit ÷ gross lossAbove 1 means profitable before luck is considered. Meaningful only with enough trades.
Maximum drawdownLargest peak-to-trough fall of equityThe pain you must be able to sit through. Compare with your risk tolerance.
Recovery factorNet profit ÷ maximum drawdownHow well profit compensates for the worst fall.
Sharpe ratioAverage excess return ÷ return volatilityReturn per unit of volatility. Sensitive to the return period used.
ExpectancyAverage profit per tradeMust exceed costs by a safe margin.
Number of tradesSample sizeFew trades means any metric is unreliable.

Computing Core Metrics From a Trade List in Python

Python · pandas / NumPy
import numpy as np
import pandas as pd

def summarize(trade_pnl: pd.Series, start_balance: float = 10_000.0) -> dict:
    """Core performance metrics from per-trade profit/loss in account currency."""
    equity = start_balance + trade_pnl.cumsum()
    peak = equity.cummax()
    drawdown = peak - equity

    wins = trade_pnl[trade_pnl > 0].sum()
    losses = -trade_pnl[trade_pnl < 0].sum()
    net = trade_pnl.sum()
    max_dd = drawdown.max()

    return {
        "trades": int(len(trade_pnl)),
        "net_profit": float(net),
        "profit_factor": float(wins / losses) if losses > 0 else float("inf"),
        "expectancy": float(trade_pnl.mean()),
        "max_drawdown": float(max_dd),
        "recovery_factor": float(net / max_dd) if max_dd > 0 else float("inf"),
        "win_rate": float((trade_pnl > 0).mean()),
    }

How Walk-Forward Analysis Protects You From Curve Fitting

  1. Split history into windows

    For example, a long in-sample period followed by a shorter out-of-sample period.

  2. Optimize in-sample

    Find the best parameters using only the in-sample window.

  3. Test out-of-sample

    Run those parameters on the next, unseen window and record the result.

  4. Roll forward and repeat

    Move both windows ahead and repeat across the whole history.

  5. Judge the combined out-of-sample result

    Only the stitched-together out-of-sample performance reflects what live trading may look like.

Backtest Traps We Look For

Why great-looking results often disappear live
  • ●
    Look-ahead bias: using data that was not yet available at the time of the decision.
  • ●
    Overfitting: parameters tuned so tightly to history that they capture noise. Many tested combinations make a good-looking best result likely by chance.
  • ●
    Unrealistic fills: zero spread, no slippage, or fills at prices that never traded.
  • ●
    Poor data: synthetic ticks generated from bars can hide how a strategy behaves intra-bar. Real tick history is more faithful.
  • ●
    Survivorship and regime bias: a test period that happens to suit the strategy and ignores different market regimes.

Delivery, Support & Guarantee

Confirmed per scope
Delivery
Report + settings files
Output
Yes, all settings shared
Reproducible
MT4 · MT5 · Python
Platforms

Timelines are indicative. The exact price and delivery date are confirmed in writing before work starts, with no hidden costs. Payment: 50% advance, 50% after your approval (USDT or bank wire).

Frequently Asked Questions

How accurate is MetaTrader Strategy Tester?

MT5 with real tick history, realistic spread and commission is a good approximation, but it is never exact: live slippage, requotes and liquidity differ. Treat results as an estimate and confirm with a forward test on demo.

What is the difference between backtesting and optimization?

Backtesting measures a fixed set of rules on history. Optimization searches many parameter sets for the best one, which raises the risk of overfitting if not validated out of sample.

What is walk-forward analysis?

It repeatedly optimizes on one period and tests on the following unseen period, then rolls forward. It measures whether the optimization process generalizes.

Can you backtest a strategy that is not yet an EA?

Yes. We can simulate rules in Python first and build the EA afterwards. See Expert Advisor Development.

How many trades do I need for a reliable result?

More is better. A common rule of thumb is hundreds of trades across different market conditions, but it depends on the strategy’s variance. We report confidence in the sample.

Do you also test AI models?

Yes, with time-ordered validation and leakage checks. See AI Trading System Development.

Official Documentation & Sources

  • MetaQuotes Ltd.Testing Trading Strategies — MetaTrader 5 HelpMetaTrader5.com
    View Docs ↗

Find Out If Your Strategy Is Robust or Just Lucky

Send the EA or the rules. We test it with realistic assumptions and report honestly.