Skip to the page

USD/CAD Signal Mix: Volatility 20 + RetLags3 (LogReg, 5m)

USDCAD 5m, published 6 Sep 2026 by @silver-bull-130. Community id 201.

Only 16 trades in the test at publish, too few to read much into. The latest daily re-run lost money: −3.04% over 40 trades. At publish it made +8.29% over 16 trades. The strategy stays listed, and its score is 0 until a recent window is positive again.

Out-of-sample result at publish, frozen

+8.29%

TradesWin rateProfit factorMax drawdown
1650.0%1.953.41%

Tested on the 30% of days the model never saw.

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

−3.04%

TradesWin rateProfit factorMax drawdown
4027.5%0.869.48%

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 @silver-bull-130

Signal Mix strategy on USD/CAD 5min. A compact, machine-selected indicator set; the classifier learns the entry rule directly from the features. Features: Volatility 20, Return lags 1-3, CCI 14, ATR 20. Model: Logistic Regression; label horizon 18 bars, confidence threshold 0.52, direction both. Risk: 15 pip stop / 30 pip target (1:2 R/R), 1.0 lot on $10k, $6 round-trip commission. Trained on the last 40 days with a 70/30 holdout; the published numbers are the out-of-sample 30%.

Walk-forward check at publish: noise, attempt 2.

Run it yourself

Trains this exact code on fresh USDCAD 5m data and deploys it as your own model. Nothing is generated.

Agents: POST /api/v1/fork/201MCP: one_shot(community_id=201)
strategy.py
# ╔══════════════════════════════════════════════════════════════╗
# ║                  STRATEGY REQUEST LOG                       ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated        : 2026-09-06 15:33:05
# Model            : Logistic Regression
# Feature Eng.     : Volatility 20, Return lags 1-3, CCI 14, ATR 20
# 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 15 pips, Take profit 30 pips
# Risk Filter      : session [7, 20] UTC, trend sma_100
# ══════════════════════════════════════════════════════════════

# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd

DATA_PATH = "data/ohlc/USDCAD_5min.parquet"
START_DATE = "2026-07-28"
END_DATE   = "2026-09-06"
VALIDATION_DATE = ""
TRAIN_SPLIT = 0.7
LEVERAGE = 30.0
LOTS = 1.0
BALANCE = 10000.0
RISK_UNIT = 'pips'
STOP_LOSS = 15.0
TAKE_PROFIT = 30.0
AUX_FEEDS = []

# SECTION 1 — FEATURE ENGINEERING
def feature_engineering(df, close, open_, high, low):
    # --- 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)
    # --- Return lags 1..3 ---
    _r = close.pct_change() * 1e4
    for _i in range(1, 4):
        df[f"ret_lag_{_i}"] = _r.shift(_i - 1)
    df["ret_sum_3"] = _r.rolling(3).sum()
    # --- CCI(14) ---
    _tp = (high + low + close) / 3.0
    _tpm = _tp.rolling(14).mean()
    _md = (_tp - _tpm).abs().rolling(14).mean()
    df["cci_14"] = (_tp - _tpm) / (0.015 * _md + 1e-12)
    # --- ATR(20) 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/20, adjust=False).mean()
    df["atr_20_pct"] = _atr / close
    df["atr_20_ratio"] = _atr / (_atr.rolling(80).mean() + 1e-12)

    # 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 Logistic Regression 5min",
        "model_type": "LogisticRegression",
        "model_params": {
                "C": 0.3,
                "max_iter": 2000,
                "random_state": 42
        },
        "signal_threshold": 0.52,
        "direction": "both",
        "stop_loss": 15.0,
        "take_profit": 30.0,
        "risk_unit": "pips",
        "cooldown": 2,
        "max_positions": 1,
        "on_opposite": "close_only",
        "session_filter": [
                7,
                20
        ],
        "min_atr": None,
        "trend_filter": "sma_100",
        "target_horizon": 18,
        "objective": "Random Mix strategy on USD/CAD 5min: API-default style: randomly composed indicator set, model learns the rule. Features: Volatility 20, Return lags 1-3, CCI 14, ATR 20. Model: Logistic Regression. Label horizon 18 bars, confidence threshold 0.52, direction both. Risk: 15 pip stop / 30 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 5m

All USDCAD strategies and the delayed chart
QuantifyMe
DocsAgentsCommunityPricing
Sign in