Skip to the page

EUR/USD Signal Mix: EMA 9/21 + Stochastic (LightGBM, 1h)

EURUSD 1h, published 6 Sep 2026 by @elastic-moose-350. Community id 174.

Only 16 trades in the test at publish, too few to read much into. The latest daily re-run lost money: −6.30% over 14 trades. At publish it made +8.50% 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.50%

TradesWin rateProfit factorMax drawdown
1668.8%8.120.66%

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

−6.30%

TradesWin rateProfit factorMax drawdown
1428.6%0.446.40%

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 @elastic-moose-350

Signal Mix strategy on EUR/USD 1h. A compact, machine-selected indicator set; the classifier learns the entry rule directly from the features. Features: EMA 9/21 cross, Stochastic (14,3), Donchian 55, Williams %R 14. Model: LightGBM; label horizon 2 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. 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 1.

Run it yourself

Trains this exact code on fresh EURUSD 1h data and deploys it as your own model. Nothing is generated.

Agents: POST /api/v1/fork/174MCP: one_shot(community_id=174)
strategy.py
# ╔══════════════════════════════════════════════════════════════╗
# ║                  STRATEGY REQUEST LOG                       ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated        : 2026-09-06 15:33:05
# Model            : LightGBM
# Feature Eng.     : EMA 9/21 cross, Stochastic (14,3), Donchian 55, Williams %R 14
# 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/EURUSD_1h.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 = 25.0
TAKE_PROFIT = 50.0
AUX_FEEDS = []

# SECTION 1 — FEATURE ENGINEERING
def feature_engineering(df, close, open_, high, low):
    # --- EMA 9/21 crossover ---
    _ea = close.ewm(span=9, adjust=False).mean()
    _eb = close.ewm(span=21, adjust=False).mean()
    df["ema_9_21_diff"] = (_ea - _eb) / close * 1e4
    df["ema_9_21_diff_chg"] = df["ema_9_21_diff"].diff(1)
    df["ema_9_21_cross_up"] = ((_ea > _eb) & (_ea.shift(1) <= _eb.shift(1))).astype(float)
    df["ema_9_21_cross_dn"] = ((_ea < _eb) & (_ea.shift(1) >= _eb.shift(1))).astype(float)
    df["close_vs_ema_9"] = close / _ea - 1.0
    # --- Stochastic(14,3) ---
    _ll = low.rolling(14).min()
    _hh = high.rolling(14).max()
    _k = 100.0 * (close - _ll) / (_hh - _ll + 1e-10)
    df["stoch_k_14"] = _k
    df["stoch_d_14"] = _k.rolling(3).mean()
    df["stoch_14_diff"] = df["stoch_k_14"] - df["stoch_d_14"]
    # --- Donchian channel(55) position & breakout ---
    _dh = high.rolling(55).max().shift(1)
    _dl = low.rolling(55).min().shift(1)
    df["donch_55_pos"] = (close - _dl) / (_dh - _dl + 1e-10)
    df["donch_55_break_up"] = (close > _dh).astype(float)
    df["donch_55_break_dn"] = (close < _dl).astype(float)
    # --- Williams %R(14) ---
    _hh2 = high.rolling(14).max()
    _ll2 = low.rolling(14).min()
    df["willr_14"] = -100.0 * (_hh2 - close) / (_hh2 - _ll2 + 1e-10)

    # 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": "EUR/USD Random Mix LightGBM 1h",
        "model_type": "LGBMClassifier",
        "model_params": {
                "n_estimators": 200,
                "num_leaves": 31,
                "learning_rate": 0.02,
                "subsample": 0.7,
                "subsample_freq": 1,
                "colsample_bytree": 0.8,
                "min_child_samples": 20,
                "reg_lambda": 1.0,
                "random_state": 42,
                "n_jobs": 1,
                "verbose": -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": "sma_100",
        "target_horizon": 2,
        "objective": "Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: EMA 9/21 cross, Stochastic (14,3), Donchian 55, Williams %R 14. Model: LightGBM. Label horizon 2 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 EURUSD 1h

All EURUSD strategies and the delayed chart
QuantifyMe
DocsAgentsCommunityPricing
Sign in