USD/CAD Signal Mix: SMA 50 + ROC 20 (XGBoost, 1h)
Only 19 trades in the test at publish, too few to read much into. The latest daily re-run lost money: −0.13% over 15 trades. At publish it made +4.83% over 19 trades. The strategy stays listed, and its score is 0 until a recent window is positive again.
Out-of-sample result at publish, frozen
+4.83%
| Trades | Win rate | Profit factor | Max drawdown |
|---|---|---|---|
| 19 | 57.9% | 1.37 | 4.08% |
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 23 Nov 2026
−0.13%
| Trades | Win rate | Profit factor | Max drawdown |
|---|---|---|---|
| 15 | 46.7% | 1.01 | 6.27% |
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/CAD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: SMA 50, ROC 20, ATR 10, EMA 50/200 cross. Model: XGBoost. Label horizon 9 bars, confidence threshold 0.60, 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 1.
Run it yourself
Trains this exact code on fresh USDCAD 1h data and deploys it as your own model. Nothing is generated.
Agents:POST /api/v1/fork/325MCP: one_shot(community_id=325)
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:34:17
# Model : XGBoost
# Feature Eng. : SMA 50, ROC 20, ATR 10, EMA 50/200 cross
# 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 : —
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "data/ohlc/USDCAD_1h.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(50) distance & slope ---
_s = close.rolling(50).mean()
df["sma_50_dist"] = close / _s - 1.0
df["sma_50_slope"] = _s.pct_change(3)
# --- Rate of change(20) ---
df["roc_20"] = close.pct_change(20) * 1e4
# --- ATR(10) normalised ---
_tr = pd.concat([high - low, (high - close.shift(1)).abs(), (low - close.shift(1)).abs()], axis=1).max(axis=1)
_atr = _tr.ewm(alpha=1.0/10, adjust=False).mean()
df["atr_10_pct"] = _atr / close
df["atr_10_ratio"] = _atr / (_atr.rolling(40).mean() + 1e-12)
# --- EMA 50/200 crossover ---
_ea = close.ewm(span=50, adjust=False).mean()
_eb = close.ewm(span=200, adjust=False).mean()
df["ema_50_200_diff"] = (_ea - _eb) / close * 1e4
df["ema_50_200_diff_chg"] = df["ema_50_200_diff"].diff(1)
df["ema_50_200_cross_up"] = ((_ea > _eb) & (_ea.shift(1) <= _eb.shift(1))).astype(float)
df["ema_50_200_cross_dn"] = ((_ea < _eb) & (_ea.shift(1) >= _eb.shift(1))).astype(float)
df["close_vs_ema_50"] = close / _ea - 1.0
# 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/CAD Random Mix XGBoost 1h",
"model_type": "XGBClassifier",
"model_params": {
"n_estimators": 250,
"max_depth": 4,
"learning_rate": 0.03,
"subsample": 0.9,
"colsample_bytree": 0.6,
"min_child_weight": 3,
"reg_lambda": 3.0,
"gamma": 0.0,
"objective": "binary:logistic",
"tree_method": "hist",
"random_state": 42,
"n_jobs": 1
},
"signal_threshold": 0.6,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 0,
"max_positions": 1,
"on_opposite": "close_only",
"session_filter": None,
"min_atr": None,
"trend_filter": None,
"target_horizon": 9,
"objective": "Random Mix strategy on USD/CAD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: SMA 50, ROC 20, ATR 10, EMA 50/200 cross. Model: XGBoost. Label horizon 9 bars, confidence threshold 0.60, 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 USDCAD 1h
No other strategy on USDCAD 1h passes the quality bar yet.
All USDCAD strategies and the delayed chart