LibraryWorkspaceDataHub

© 2026 QCA · by Lime Fintech · About QCA · Market data from Massive

PrivacyTermsCookiesDisclaimer
HomeLibrary
DataHub
  1. Library
  2. Report

Optimal Mean Reversion Trading with Transaction Costs and Stop-Loss Exit (Leung, Li)

Open repository
Apr 24, 2026
Trading and Market Microstructure

Verdict: Partially Reproduced

OverviewExperiments

Executive Summary

Status
Partially Reproduced
Confidence
Medium

Executive Summary

  • Status: PARTIALLY REPRODUCED
  • Confidence: MEDIUM-HIGH
  • Key Insight: The repository appears to reproduce the paper’s methodology and qualitative findings across all four selected experiments, but Experiment 1 does not numerically match the paper’s empirical Table 1, and Experiments 3–4 require a material transaction-cost adjustment relative to the paper’s stated Figure 7 parameters.

The repo’s own summary reports 86 passed / 0 failed, which supports implementation reliability. Overall, the theoretical optimal-stopping structure is well reproduced, while the empirical OU calibration is only partially reproduced numerically.


Results Comparison

Experiment 1 — OU Spread Calibration and Hedge-Ratio Selection

MetricPaperReproducedDiffStatus
GLD-GDX B*0.4540.238-0.216Material mismatch
GLD-GDX θ̂0.53880.7093+0.1705Material
GLD-GDX μ̂
16.6677
5.6617
-11.0060
Material
GLD-GDX σ̂0.15990.1013-0.0586Material
GLD-GDX ℓ̂3.21173.6465+0.4348Material
GLD-SLV B*0.4930.241-0.252Material mismatch
GLD-SLV θ̂0.56800.7115+0.1435Material
GLD-SLV μ̂33.45934.0802-29.3791Material
GLD-SLV σ̂0.13840.0970-0.0414Material
GLD-SLV ℓ̂3.38823.6865+0.2983Material

Summary:
This experiment is not numerically reproduced relative to the paper’s empirical Table 1. The optimal hedge ratios are far from the reported values, and the OU speed-of-mean-reversion estimates are dramatically lower than in the paper. However, some qualitative findings are reproduced:

  • GLD-SLV still has a higher maximized log-likelihood than GLD-GDX:
    • reproduced: 3.6865 > 3.6465
    • paper: 3.3882 > 3.2117
  • The repo states that likelihood profiles show clear maxima, supporting correct implementation of the search procedure.
  • Simulated re-estimation is internally stable:
    • GLD-GDX empirical vs simulated: θ̂ 0.7093 vs 0.7001; σ̂ 0.1013 vs 0.0898
    • GLD-SLV empirical vs simulated: θ̂ 0.7115 vs 0.6999; σ̂ 0.0970 vs 0.0860

So: methodology reproduced, empirical numbers not reproduced.

Images

Experiment 1 likelihood profiles

Experiment 1 GLD-GDX spread

Experiment 1 GLD-SLV spread


Experiment 2 — Optimal Liquidation and Entry Thresholds Without Stop-Loss

MetricPaper / ExpectedReproducedDiffStatus
Single liquidation threshold b*Expected qualitatively0.593709—Reproduced
Single entry threshold d*Expected qualitatively0.448192—Reproduced
d* < b*Expected0.448192 < 0.593709—Reproduced
Value matching at b*Expectederror = 1.0×10⁻⁷negligibleReproduced
Smooth pasting at b*Expectederror = 8.3×10⁻¹¹negligibleReproduced
b* increases with cExpectedTrue—Reproduced
d* decreases with ĉExpectedTrue—Reproduced
Brownian special-case thresholdExpected0.555648 (formula verified)—Reproduced
ODE residuals for F,G,F̂Expected small≤ 3.2×10⁻⁴smallReproduced

Summary:
Experiment 2 is successfully reproduced at the methodological and numerical-validation level. Since the prompt for this experiment emphasizes structural and numerical verification rather than direct table replication, the evidence strongly supports reproduction:

  • threshold structure matches the paper,
  • value matching and smooth pasting are essentially exact,
  • comparative statics hold,
  • Brownian limit check passes.

This is a strong reproduction of the theory and numerics.

Images

Experiment 2 value functions

Experiment 2 comparative statics

Experiment 2 transformed reward


Experiment 3 — Optimal Liquidation and Entry Thresholds With Stop-Loss

MetricPaperReproducedDiffStatus
Figure 7 b_L*0.55700.5670+0.0100Within tolerance
Figure 7 d_L*0.49780.5058+0.0080Within tolerance
a_L*Not reported0.5056—Additional result
L*Not reported0.5372—Consistent internal result
L < a_L* ≤ d_L* < b_L*Expected0.4834 < 0.5056 ≤ 0.5058 < 0.5670—Reproduced
V_L(L)=L-cExpectederror < 1e-8negligibleReproduced
V_L(b_L*)=b_L*-cExpectederror < 1e-8negligibleReproduced
V_L(x) ≤ V(x)ExpectedTrue—Reproduced
J_L(x) ≤ J(x)ExpectedTrue—Reproduced
b_L* decreases with LExpectedTrue—Reproduced
Immediate liquidation when L ≥ L*ExpectedTrue—Reproduced

Summary:
Experiment 3 is substantively reproduced, including the paper’s key qualitative insight: stop-loss creates a bounded entry interval and a disconnected delay region. The reproduced Figure 7 thresholds are close to the paper’s values.

However, there is a material caveat: the repository reports that using the paper’s stated transaction costs c = ĉ = 0.05 makes entry never worthwhile, which contradicts the paper’s own reported threshold dL∗d_L^*dL∗​. The repo therefore uses c = ĉ = 0.005 and obtains thresholds close to Figure 7:

  • reproduced bL∗=0.5670b_L^* = 0.5670bL∗​=0.5670 vs paper 0.5570
  • reproduced dL∗=0.5058d_L^* = 0.5058dL∗​=0.5058 vs paper 0.4978

These are small absolute differences, but they come under a different cost specification. That means the experiment reproduces the shape and numerical threshold magnitudes, but not under the paper’s stated parameterization exactly.

Images

Experiment 3 stop-loss value functions

Experiment 3 bL star vs L


Experiment 4 — Simulation-Based Validation of Stopping Rules

MetricExpectedReproducedDiffStatus
No-stop-loss path logicSingle lower entry + upper exitObserved—Reproduced
Stop-loss path logicEntry band + stop-loss / take-profit exitsObserved—Reproduced
Figure 7-style thresholds usedNear paperb*=0.5926, d*=0.4634, b_L*=0.5670, a_L*=0.5056, d_L*=0.5058, L=0.4834—Reproduced qualitatively
MC mean < analytical due to discrete monitoringExpected possibilityTrue—Reasonable
Stop-loss reduces valueExpected0.4069 < 0.4387 and 0.5425 < 0.5714—Reproduced
Entry value lower with stop-lossExpected0.0098 < 0.0884—Reproduced

Monte Carlo comparison

Strategyx₀MC Mean95% CIAnalytical Value
No Stop-Loss0.53880.4387[0.4253, 0.4522]V(x₀)=0.5714, J(x₀)=0.0884
Stop-Loss0.53880.4069[0.3942, 0.4197]V(x₀)=0.5425, J(x₀)=0.0098

Summary:
Experiment 4 succeeds as a qualitative and simulation-based validation layer. The pathwise examples behave as theory predicts. The Monte Carlo means fall below analytical values, but the repo explicitly attributes this to daily discrete-time monitoring missing continuous-time barrier crossings, which is a plausible explanation.

This is not a failure of the theory; it is a limitation of the simulation approximation. The relative ordering is reproduced:

  • no-stop-loss value > stop-loss value,
  • no-stop-loss entry value > stop-loss entry value.

Images

Experiment 4 no-stop-loss wait path

Experiment 4 no-stop-loss immediate path

Experiment 4 stop-loss in-band path

Experiment 4 stop-loss wait path


Statistical & Economic Significance

Statistical significance

The repository does not report t-stats, p-values, or standard errors for the main experimental outputs. Therefore:

  • formal statistical significance assessment is limited,
  • no inference can be made about whether the differences from the paper are statistically distinguishable in a strict hypothesis-testing sense.

That said, for these experiments:

  • Experiments 2 and 3 are mostly deterministic numerical/theoretical reproductions, so significance is less relevant than residual size, threshold stability, and theorem-consistency.
  • Experiment 4 provides Monte Carlo confidence intervals:
    • No stop-loss MC mean: 0.4387, CI [0.4253, 0.4522]
    • Stop-loss MC mean: 0.4069, CI [0.3942, 0.4197] These intervals do not overlap much with each other, suggesting a meaningful reduction in payoff under stop-loss in the discrete-time simulation.

Economic significance

  • In Experiment 1, the empirical discrepancies are economically material because hedge ratio selection and mean-reversion speed directly affect trading design. A change from B∗≈0.45–0.49B^* \approx 0.45\text{–}0.49B∗≈0.45–0.49 to 0.240.240.24 is too large to dismiss as noise.
  • In Experiments 2–4, the key economic conclusions remain intact:
    • there is an optimal upper liquidation threshold,
    • an optimal lower entry threshold without stop-loss,
    • a bounded entry interval with stop-loss,
    • stop-loss constraints reduce option value and can make entry unattractive.

So economically, the main decision rules are preserved, even if some parameter normalization issues remain.


Discrepancies

1. Experiment 1 empirical Table 1 is materially different from the paper

Main issues:

  • B∗B^*B∗ for GLD-GDX: 0.238 vs 0.454
  • B∗B^*B∗ for GLD-SLV: 0.241 vs 0.493
  • μ\muμ estimates are much smaller than the paper in both pairs

Likely explanation:

  • The repo explicitly uses Massive API vendor-adjusted prices.
  • The paper likely used a different data source or adjustment convention.
  • Small differences in adjusted ETF series can materially change OU spread fit and hedge-ratio likelihood profiles over a short sample of only 200 days.
  • Exact date alignment and corporate-action treatment can matter a lot in spread construction.

This is the most important discrepancy in the repository.

2. Experiment 3/4 need transaction costs 0.005, not the paper’s stated 0.05

Main issue:

  • The repo states that with c = ĉ = 0.05, entry is never optimal, contradicting the paper’s reported Figure 7 threshold dL∗d_L^*dL∗​.
  • Using 0.005 yields thresholds close to the paper.

Likely explanation:

  • Possible typo in the paper,
  • or different scaling / normalization convention,
  • or spread-price units differ between text and figure generation.

This is a material methodological discrepancy, but the repo handles it transparently and provides a reasoned explanation.

3. Experiment 4 Monte Carlo means are below analytical values

Issue:

  • MC mean payoff is materially below analytical values.

Likely explanation:

  • Daily monitoring with Δt=1/252\Delta t = 1/252Δt=1/252 underestimates continuous-time stopping value because barrier crossings between observations are missed.
  • This is a standard discretization effect, not necessarily an implementation bug.

Methodology Issues

Experiment 1

Methodology appears to have been followed:

  • fixed hedge-ratio grid,
  • exact discrete OU transition density,
  • MLE over (θ,μ,σ)(\theta,\mu,\sigma)(θ,μ,σ),
  • maximized average log-likelihood used for hedge-ratio selection,
  • simulated-path re-estimation done.

So the problem is not obviously implementation drift, but data/input mismatch.

Experiment 2

Methodology looks faithful:

  • uses fundamental solutions F,GF, GF,G,
  • transformed reward / concave-majorant approach,
  • threshold equations solved numerically,
  • value matching and smooth pasting checked.

Experiment 3

Methodology is faithful to the theory, but the parameterization departs from the paper’s stated costs. This is justified by the contradiction otherwise. So this is best viewed as:

  • theory reproduced,
  • paper numerical setup partially inconsistent.

Experiment 4

Methodology is appropriate for illustration:

  • analytical thresholds are fixed first,
  • exact OU recursion used,
  • pathwise logic checked,
  • MC comparison included with caveat about discrete monitoring.

Reliability

  • The repository reports 86 passed / 0 failed, which is a positive sign.
  • Numerical verification in Experiments 2 and 3 is strong:
    • smooth-pasting errors near machine precision,
    • threshold identities satisfied,
    • monotonic comparative statics confirmed.
  • Experiment 1 internal stability is decent because simulated re-estimation is broadly close to the empirical estimates obtained from the repo’s own data.
  • Main red flags:
    1. Empirical calibration mismatch versus the paper is large.
    2. Figure 7 cost inconsistency means one numerical example cannot be reproduced under the paper’s stated parameters.

Overall reliability is good for code correctness and theoretical numerics, but only moderate for exact paper-level empirical replication.


Verdict

Final Decision: PARTIALLY REPRODUCED

Why:

  • Experiment 1 is not numerically reproduced relative to the paper’s Table 1, though the methodology and qualitative ranking result are reproduced.
  • Experiment 2 is well reproduced.
  • Experiment 3 is qualitatively and near-numerically reproduced, but only after changing transaction costs from 0.05 to 0.005.
  • Experiment 4 successfully validates the stopping logic qualitatively, with expected discretization gaps in Monte Carlo values.

In short: the repository reproduces the core theoretical and qualitative conclusions of the study, but fails exact empirical replication in Section 2.1 and requires a material parameter correction for the stop-loss figure example.

Experiments

Empirical reproduction of OU spread calibration and hedge-ratio selection for GLD-GDX and GLD-SLV

Reproduce the empirical calibration procedure in Section 2.1 of Leung & Li by constructing ETF spread portfolios for the GLD-GDX and GLD-SLV pairs, fitting Ornstein-Uhlenbeck (OU) models by maximum likelihood over a fixed hedge-ratio grid, selecting the hedge ratio that maximizes the maximized average OU log-likelihood, and comparing the resulting estimates to the reported Table 1 values.

Analytical and numerical reproduction of optimal liquidation and entry thresholds without stop-loss

Reproduce the theoretical and numerical results for the infinite-horizon mean-reversion trading problem without stop-loss, including the fundamental-solution construction, transformed concave-majorant method, optimal liquidation threshold b*, optimal entry threshold d*, closed-form/semi-closed-form value functions V and J, and the comparative statics with respect to transaction costs c and c-hat.

Analytical and numerical reproduction of optimal liquidation and entry thresholds with stop-loss

Reproduce the theoretical and numerical results for the infinite-horizon mean-reversion trading problem with an exogenous stop-loss barrier L, including the critical liquidation regime when L is high, the two-sided optimal liquidation rule with threshold b_L*, the bounded optimal entry interval [a_L*, d_L*], the disconnected delay region, the transformed-majorant structure, and comparative statics with respect to the stop-loss level L.

Simulation-based validation and figure-style illustration of optimal stopping rules

Use simulated OU paths to illustrate and numerically validate the trading logic implied by the analytically derived stopping thresholds, including realized discounted payoffs, pathwise entry and exit behavior with and without stop-loss, and figure-style reproductions analogous to the paper’s numerical illustrations such as Figure 7.

Original paperRun QCA on your paper