Skip to the page

USD/JPY Signal Mix: Williams %R 14 + BB (LightGBM, 1h)

USDJPY 1h, published 6 Sep 2026 by @alpha-viper-151. Community id 193.

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

Out-of-sample result at publish, frozen

+19.54%

TradesWin rateProfit factorMax drawdown
5350.9%2.075.26%

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

−2.79%

TradesWin rateProfit factorMax drawdown
7851.3%0.9211.68%

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 @alpha-viper-151

Signal Mix strategy on USD/JPY 1h. A compact, machine-selected indicator set; the classifier learns the entry rule directly from the features. Features: Williams %R 14, BB (10,2.0), Candle structure, ATR 20, Keltner (20,2.0). Model: LightGBM; label horizon 3 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. 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 USDJPY 1h data and deploys it as your own model. Nothing is generated.

Agents: POST /api/v1/fork/193MCP: one_shot(community_id=193)
strategy.py
# ╔══════════════════════════════════════════════════════════════╗
# ║                  STRATEGY REQUEST LOG                       ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated        : 2026-09-06 15:33:05
# Model            : LightGBM
# Feature Eng.     : Williams %R 14, BB (10,2.0), Candle structure, ATR 20, Keltner (20,2.0)
# 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/USDJPY_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):
    # --- Williams %R(14) ---
    _hh2 = high.rolling(14).max()
    _ll2 = low.rolling(14).min()
    df["willr_14"] = -100.0 * (_hh2 - close) / (_hh2 - _ll2 + 1e-10)
    # --- Bollinger Bands(10,2.0) ---
    _mid = close.rolling(10).mean()
    _sd = close.rolling(10).std()
    df["bb_10_2p0_pctb"] = (close - (_mid - 2.0 * _sd)) / (2 * 2.0 * _sd + 1e-10)
    df["bb_10_2p0_width"] = (2 * 2.0 * _sd) / (_mid + 1e-10)
    df["bb_10_2p0_width_chg"] = df["bb_10_2p0_width"].pct_change(3)
    # --- 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)
    # --- 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)
    # --- Keltner channel(20,2.0) position ---
    _kmid = close.ewm(span=20, adjust=False).mean()
    _ktr = pd.concat([high - low, (high - close.shift(1)).abs(), (low - close.shift(1)).abs()], axis=1).max(axis=1)
    _katr = _ktr.ewm(alpha=1.0/20, adjust=False).mean()
    df["kelt_20_pos"] = (close - _kmid) / (2.0 * _katr + 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/JPY Random Mix LightGBM 1h",
        "model_type": "LGBMClassifier",
        "model_params": {
                "n_estimators": 400,
                "num_leaves": 15,
                "learning_rate": 0.05,
                "subsample": 0.7,
                "subsample_freq": 1,
                "colsample_bytree": 0.6,
                "min_child_samples": 30,
                "reg_lambda": 1.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": 3,
        "objective": "Random Mix strategy on USD/JPY 1h: API-default style: randomly composed indicator set, model learns the rule. Features: Williams %R 14, BB (10,2.0), Candle structure, ATR 20, Keltner (20,2.0). Model: LightGBM. Label horizon 3 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 USDJPY 1h

No other strategy on USDJPY 1h passes the quality bar yet.

All USDJPY strategies and the delayed chart
QuantifyMe
DocsAgentsCommunityPricing
Sign in