Sample dossier (illustrative data, not a real result)
LEMMA-0147
GC Mean Reversion Band
GC: Fades short term dislocations back toward a rolling fair value band, sized down once price re enters the range.
A representative dossier showing the shape of a Lemma trade idea. Every figure below is invented for illustration and does not reflect real research output.
Results
96
Trades
0.13
Trades / day
54.2%
Win rate
1.68
Profit factor
1.6 days
Avg hold time
-5.4%
Max drawdown
4
Worst losing streak
+6.3%
Net return
Backtested performance (illustrative)
Testing detail
- Backtest window: Jul 8, 2024 to Jul 8, 2026 (1 hour bars, the full 730 day window Yahoo Finance provides at that granularity).
- Cost model: 5 bps round trip transaction cost (spread and slippage), applied on every position change. No commission modeled separately.
- Sizing convention: Full notional when in a position, flat otherwise. No leverage, no volatility targeting.
- Redundancy check: Not checked against Lemma's other signals in this run, see validation transparency below.
- Trade concentration: Top 5 trades contributed 21 percent of total PnL out of 96 trades.
How to read this research
- Metrics are computed from the same simulated backtested performance shown below, so the headline numbers and the chart always agree with each other.
- Net return is a plain percent over the fixed backtest window for this horizon, not an annualized figure.
- The Risk Officer note below is part of the research, not a footnote. Read it before acting on this idea.
Risk Officer
Cleared the quality gate on profit factor and drawdown; concentration checks came back clean. Redundancy against Lemma's existing signal library was not checked in this run, so treat this as one candidate signal rather than a confirmed diversifier.
Validation transparency
- Data window: Jul 8, 2024 to Jul 8, 2026.
- Mechanical mean reversion rule simulated on the fixed bar size and window for this horizon, with parameters fixed before each backtest. 5 bps round trip transaction cost assumed. 18 parameter variants across the full setup template library for this horizon were backtested, and the strongest performer by profit factor and net return is presented.
- News reviewed: Gold consolidating in a multi month range as rate cut odds stay in flux.; No major central bank meetings scheduled in the final week of the backtest window.
Not checked
- Tested on recent, in sample data only (730 days).
- Limited market regime coverage.
- Multiple candidate setups and parameter variants were backtested; presenting the strongest performer carries some risk of overfitting to this specific window.
- No out of sample test.
- Past performance does not predict future results.
This document is for informational research purposes only. It is not investment advice, a recommendation, or an offer to buy or sell any financial instrument. Results shown are hypothetical and based on historical backtesting, and do not reflect actual trading. Past performance does not guarantee future results.
Script handoff
Approved dossiers export as a standalone Python script that downloads the same instrument at the same bar size and window, and mechanically replicates the rule above. Below is an excerpt, not the full script.
import numpy as np
import pandas as pd
import yfinance as yf
from datetime import datetime, timedelta, timezone
TICKER = "GC=F"
INTERVAL = "1h" # bar size actually backtested
WINDOW_DAYS = 730 # fixed lookback window for this horizon
COST_BPS = 5 # round trip transaction cost assumption, spread and slippage
SESSION_FLATTEN = False # force flat at the last bar of each day
MAX_HOLD_DAYS = 3 # force flat once a position spans more than this many days
def build_signal(df: pd.DataFrame, lookback: int = 40, entry_z: float = 2.0, exit_z: float = 0.5) -> pd.Series:
"""Fades dislocations back toward a rolling mean; holds until the z score reverts."""
prices = df["Close"]
mean = prices.rolling(lookback).mean()
std = prices.rolling(lookback).std()
z = (prices - mean) / std.replace(0, np.nan)
position = pd.Series(0.0, index=prices.index)
in_position = False
for i in range(len(prices)):
zi = z.iloc[i]
if pd.isna(zi):
continue
dislocated = zi <= -entry_z
reverted = zi >= -exit_z
if not in_position and dislocated:
in_position = True
elif in_position and reverted:
in_position = False
position.iloc[i] = 1.0 if in_position else 0.0
return position
# load_data(), apply_holding_rules(), backtest(), and summarize() ship with
# the full script on export. Preview only.
Request early access
Lemma is in early access. We are accepting a limited number of professional users while we refine the platform. All features are free in exchange for your feedback.