USD/CHF Signal Mix: SMA 20 (LightGBM, 15m)
The latest daily re-run lost money: −7.24% over 39 trades. At publish it made +9.59% over 36 trades. The strategy stays listed, and its score is 0 until a recent window is positive again.
Out-of-sample result at publish, frozen
+9.59%
| Trades | Win rate | Profit factor | Max drawdown |
|---|---|---|---|
| 36 | 50.0% | 1.76 | 3.16% |
A strategy can be published only when this test made money, so this number was chosen to be positive. The daily re-run is the fairer read.
Daily re-run 24 Nov 2026
−7.24%
| Trades | Win rate | Profit factor | Max drawdown |
|---|---|---|---|
| 39 | 33.3% | 0.74 | 14.67% |
This exact code trained again on the last 40 days, the last 30% held out. A loss shows here and never removes the page.
Description as published by @cold-stork-489
Random Mix strategy on USD/CHF 15min: API-default style: randomly composed indicator set, model learns the rule. Features: SMA 20, Stochastic (21,5), Session/time features, Volatility 20, MACD (5,13,3). Model: LightGBM. Label horizon 4 bars, confidence threshold 0.52, direction both. Risk: 25 pip stop / 50 pip target (1:2 R/R), 1.0 lot on $10k, $6 round-trip commission.
Walk-forward check at publish: noise, attempt 4.
Run it yourself
Trains this exact code on fresh USDCHF 15m data and deploys it as your own model. Nothing is generated.
Agents:POST /api/v1/fork/287MCP: one_shot(community_id=287)
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:03:13
# Model : LightGBM
# Feature Eng. : SMA 20, Stochastic (21,5), Session/time features, Volatility 20, MACD (5,13,3)
# Signal / Entry : API-default style: randomly composed indicator set, model learns the rule
# Optimization : Maximize out-of-sample return with a 70/30 holdout
# Risk Mgmt : Stop loss 25 pips, Take profit 50 pips
# Risk Filter : —, trend sma_100
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "data/ohlc/USDCHF_15min.parquet"
START_DATE = "2026-07-31"
END_DATE = "2026-09-09"
VALIDATION_DATE = ""
TRAIN_SPLIT = 0.7
LEVERAGE = 30.0
LOTS = 1.0
BALANCE = 10000.0
RISK_UNIT = 'pips'
STOP_LOSS = 25.0
TAKE_PROFIT = 50.0
AUX_FEEDS = []
# SECTION 1 — FEATURE ENGINEERING
def feature_engineering(df, close, open_, high, low):
# --- SMA(20) distance & slope ---
_s = close.rolling(20).mean()
df["sma_20_dist"] = close / _s - 1.0
df["sma_20_slope"] = _s.pct_change(3)
# --- Stochastic(21,5) ---
_ll = low.rolling(21).min()
_hh = high.rolling(21).max()
_k = 100.0 * (close - _ll) / (_hh - _ll + 1e-10)
df["stoch_k_21"] = _k
df["stoch_d_21"] = _k.rolling(5).mean()
df["stoch_21_diff"] = df["stoch_k_21"] - df["stoch_d_21"]
# --- Time-of-day / day-of-week (UTC) ---
_h = df.index.hour + df.index.minute / 60.0
df["hour_sin"] = np.sin(2 * np.pi * _h / 24.0)
df["hour_cos"] = np.cos(2 * np.pi * _h / 24.0)
df["dow"] = df.index.dayofweek.astype(float)
df["london_open"] = ((df.index.hour >= 7) & (df.index.hour < 10)).astype(float)
df["ny_open"] = ((df.index.hour >= 13) & (df.index.hour < 16)).astype(float)
# --- Realised volatility(20) ---
_r2 = close.pct_change()
df["vol_20"] = _r2.rolling(20).std() * 1e4
df["vol_20_ratio"] = df["vol_20"] / (_r2.rolling(80).std() * 1e4 + 1e-9)
# --- MACD(5,13,3) ---
_m = close.ewm(span=5, adjust=False).mean() - close.ewm(span=13, adjust=False).mean()
_sig = _m.ewm(span=3, adjust=False).mean()
df["macd_5_13"] = _m / close * 1e4
df["macd_5_13_sig"] = _sig / close * 1e4
df["macd_5_13_hist"] = (_m - _sig) / close * 1e4
df["macd_5_13_hist_chg"] = df["macd_5_13_hist"].diff(1)
# Fill indicator warm-up gaps without looking ahead
df = df.ffill().fillna(0.0)
return df
# SECTION 2 — STRATEGY CONFIG
def strategy_config():
return {
"title": "USD/CHF Random Mix LightGBM 15min",
"model_type": "LGBMClassifier",
"model_params": {
"n_estimators": 400,
"num_leaves": 31,
"learning_rate": 0.05,
"subsample": 0.8,
"subsample_freq": 1,
"colsample_bytree": 0.8,
"min_child_samples": 30,
"reg_lambda": 2.0,
"random_state": 42,
"n_jobs": 1,
"verbose": -1
},
"signal_threshold": 0.52,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 2,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": None,
"min_atr": None,
"trend_filter": "sma_100",
"target_horizon": 4,
"objective": "Random Mix strategy on USD/CHF 15min: API-default style: randomly composed indicator set, model learns the rule. Features: SMA 20, Stochastic (21,5), Session/time features, Volatility 20, MACD (5,13,3). Model: LightGBM. Label horizon 4 bars, confidence threshold 0.52, direction both. Risk: 25 pip stop / 50 pip target (1:2 R/R), 1.0 lot on $10k, $6 round-trip commission.",
"notes": "Generated by the QuantifyMe strategy forge. SL/TP are in pips and match the dashboard defaults, so pasting this code into the Code tab reproduces the published backtest on the same window."
}
More on USDCHF 15m
- USD/CHF Breakout: Donchian 30 (Gradient Boosting, 15m)+8.02% over 63 trades
- USD/CHF Mean-Reversion: RSI 14 + BB (LightGBM, 15m)+10.54% over 45 trades
- USD/CHF Mean-Reversion: RSI 21 (Random Forest, 15m)+17.28% over 37 trades
- USD/CHF Signal Mix: Z-score 20 (Gradient Boosting, 15m)+7.29% over 60 trades
- USD/CHF Signal Mix: EMA 5/13 cross (Random Forest, 15m)+12.41% over 100 trades
- USD/CHF Signal Mix: Stochastic (5,3) + SMA 20 (XGBoost, 15m)+14.00% over 43 trades