Skip to the page

EUR/USD Oscillator Stack: RSI 7 (LightGBM, 1h)

EURUSD 1h, published 9 Sep 2026 by @candid-owl-125. Community id 286.

The latest daily re-run lost money: −17.86% over 60 trades. At publish it made +13.50% over 63 trades. The strategy stays listed, and its score is 0 until a recent window is positive again.

Out-of-sample result at publish, frozen

+13.50%

TradesWin rateProfit factorMax drawdown
6357.1%1.885.10%

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

−17.86%

TradesWin rateProfit factorMax drawdown
6035.0%0.5019.97%

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 @candid-owl-125

Oscillator Stack strategy on EUR/USD 1h: Confluence of RSI, Stochastic, Williams %R and CCI extremes. Features: RSI 7, Stochastic (14,3), Williams %R 14, CCI 20, MACD (12,26,9), Candle structure. 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 3.

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/286MCP: one_shot(community_id=286)
strategy.py
# ╔══════════════════════════════════════════════════════════════╗
# ║                  STRATEGY REQUEST LOG                       ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated        : 2026-09-09 01:03:13
# Model            : LightGBM
# Feature Eng.     : RSI 7, Stochastic (14,3), Williams %R 14, CCI 20, MACD (12,26,9), Candle structure
# Signal / Entry   : Confluence of RSI, Stochastic, Williams %R and CCI extremes
# 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/EURUSD_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):
    # --- RSI(7) with zone flags and slope ---
    _d = close.diff()
    _g = _d.clip(lower=0).ewm(com=6, min_periods=7, adjust=False).mean()
    _l = (-_d.clip(upper=0)).ewm(com=6, min_periods=7, adjust=False).mean()
    _rsi = 100.0 - 100.0 / (1.0 + _g / (_l + 1e-10))
    df["rsi_7"] = _rsi
    df["rsi_7_os"] = (_rsi < 30).astype(float)
    df["rsi_7_ob"] = (_rsi > 70).astype(float)
    df["rsi_7_slope"] = _rsi.diff(2)
    # --- 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"]
    # --- Williams %R(14) ---
    _hh2 = high.rolling(14).max()
    _ll2 = low.rolling(14).min()
    df["willr_14"] = -100.0 * (_hh2 - close) / (_hh2 - _ll2 + 1e-10)
    # --- CCI(20) ---
    _tp = (high + low + close) / 3.0
    _tpm = _tp.rolling(20).mean()
    _md = (_tp - _tpm).abs().rolling(20).mean()
    df["cci_20"] = (_tp - _tpm) / (0.015 * _md + 1e-12)
    # --- MACD(12,26,9) ---
    _m = close.ewm(span=12, adjust=False).mean() - close.ewm(span=26, adjust=False).mean()
    _sig = _m.ewm(span=9, adjust=False).mean()
    df["macd_12_26"] = _m / close * 1e4
    df["macd_12_26_sig"] = _sig / close * 1e4
    df["macd_12_26_hist"] = (_m - _sig) / close * 1e4
    df["macd_12_26_hist_chg"] = df["macd_12_26_hist"].diff(1)
    # --- Candle structure ---
    _rng = (high - low) + 1e-12
    df["body"] = (close - open_) / _rng
    df["upper_wick"] = (high - np.maximum(close, open_)) / _rng
    df["lower_wick"] = (np.minimum(close, open_) - low) / _rng
    df["range_pct"] = _rng / close
    df["range_rel"] = _rng / (_rng.rolling(20).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": "EUR/USD Oscillator Stack LightGBM 1h",
        "model_type": "LGBMClassifier",
        "model_params": {
                "n_estimators": 300,
                "num_leaves": 23,
                "learning_rate": 0.02,
                "subsample": 0.8,
                "subsample_freq": 1,
                "colsample_bytree": 0.6,
                "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": 0,
        "max_positions": 1,
        "on_opposite": "reverse",
        "session_filter": None,
        "min_atr": None,
        "trend_filter": None,
        "target_horizon": 4,
        "objective": "Oscillator Stack strategy on EUR/USD 1h: Confluence of RSI, Stochastic, Williams %R and CCI extremes. Features: RSI 7, Stochastic (14,3), Williams %R 14, CCI 20, MACD (12,26,9), Candle structure. 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 EURUSD 1h

All EURUSD strategies and the delayed chart
QuantifyMe
DocsAgentsCommunityPricing
Sign in