Browse AI-generated trading strategies shared by the community. Fork, learn, and build on each other's work.
| Score▼ | Strategy | Author | Win Rate▼ | Return▼ | PF▼ | MDD▼ | Trades▼ | Actions | ||
|---|---|---|---|---|---|---|---|---|---|---|
|
🥇
|
EUR/USD Multi-Indicator: RSI 14 (LightGBM, 1h)
Multi-Indicator strategy on EUR/USD 1h: Broad indicator set; gradient-boosted model learns the entry rule. Features: RSI 14, MACD (12,26,9),…
|
E
@elastic-moose-350
|
EURUSD | 1h | 65.7%65.7% | +22.89%+22.89% | 3.923.92 | 2.15%2.15% | 3535 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:34:17
# Model : LightGBM
# Feature Eng. : RSI 14, MACD (12,26,9), BB (20,2.0), Stochastic (14,3), ATR 14, ADX 14, EMA 9/21 cross, Candle structure, Return lags 1-3, Session/time features
# Signal / Entry : Broad indicator set; gradient-boosted model learns the entry rule
# Optimization : Maximize out-of-sample return with a 70/30 holdout
# Risk Mgmt : Stop loss 25 pips, Take profit 50 pips
# Risk Filter : session [7, 20] UTC
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/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(14) with zone flags and slope ---
_d = close.diff()
_g = _d.clip(lower=0).ewm(com=13, min_periods=14, adjust=False).mean()
_l = (-_d.clip(upper=0)).ewm(com=13, min_periods=14, adjust=False).mean()
_rsi = 100.0 - 100.0 / (1.0 + _g / (_l + 1e-10))
df["rsi_14"] = _rsi
df["rsi_14_os"] = (_rsi < 30).astype(float)
df["rsi_14_ob"] = (_rsi > 70).astype(float)
df["rsi_14_slope"] = _rsi.diff(2)
# --- 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)
# --- Bollinger Bands(20,2.0) ---
_mid = close.rolling(20).mean()
_sd = close.rolling(20).std()
df["bb_20_2p0_pctb"] = (close - (_mid - 2.0 * _sd)) / (2 * 2.0 * _sd + 1e-10)
df["bb_20_2p0_width"] = (2 * 2.0 * _sd) / (_mid + 1e-10)
df["bb_20_2p0_width_chg"] = df["bb_20_2p0_width"].pct_change(3)
# --- 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"]
# --- ATR(14) 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/14, adjust=False).mean()
df["atr_14_pct"] = _atr / close
df["atr_14_ratio"] = _atr / (_atr.rolling(56).mean() + 1e-12)
# --- ADX(14) with +DI/-DI ---
_up = high.diff()
_dn = -low.diff()
_pdm = pd.Series(np.where((_up > _dn) & (_up > 0), _up, 0.0), index=df.index)
_ndm = pd.Series(np.where((_dn > _up) & (_dn > 0), _dn, 0.0), index=df.index)
_tr2 = pd.concat([high - low, (high - close.shift(1)).abs(), (low - close.shift(1)).abs()], axis=1).max(axis=1)
_atr2 = _tr2.ewm(alpha=1.0/14, adjust=False).mean()
_pdi = 100.0 * _pdm.ewm(alpha=1.0/14, adjust=False).mean() / (_atr2 + 1e-12)
_ndi = 100.0 * _ndm.ewm(alpha=1.0/14, adjust=False).mean() / (_atr2 + 1e-12)
_dx = 100.0 * (_pdi - _ndi).abs() / (_pdi + _ndi + 1e-12)
df["adx_14"] = _dx.ewm(alpha=1.0/14, adjust=False).mean()
df["di_diff_14"] = _pdi - _ndi
# --- 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
# --- 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)
# --- 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()
# --- Time-of-day / day-of-week (UTC) ---
_h = df.index.hour + df.index.minute / 60.0
df["hour_sin"] = np.sin(2 * np.pi * _h / 24.0)
df["hour_cos"] = np.cos(2 * np.pi * _h / 24.0)
df["dow"] = df.index.dayofweek.astype(float)
df["london_open"] = ((df.index.hour >= 7) & (df.index.hour < 10)).astype(float)
df["ny_open"] = ((df.index.hour >= 13) & (df.index.hour < 16)).astype(float)
# 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 Multi-Indicator LightGBM 1h",
"model_type": "LGBMClassifier",
"model_params": {
"n_estimators": 200,
"num_leaves": 31,
"learning_rate": 0.02,
"subsample": 0.8,
"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.55,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 1,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": [
7,
20
],
"min_atr": None,
"trend_filter": None,
"target_horizon": 3,
"objective": "Multi-Indicator strategy on EUR/USD 1h: Broad indicator set; gradient-boosted model learns the entry rule. Features: RSI 14, MACD (12,26,9), BB (20,2.0), Stochastic (14,3), ATR 14, ADX 14, EMA 9/21 cross, Candle structure, Return lags 1-3, Session/time features. Model: LightGBM. Label horizon 3 bars, confidence threshold 0.55, 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."
}
|
||||||||||
|
🥈
|
EUR/USD Signal Mix: MACD (5,13,3) (XGBoost, 1h)
Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: MACD (5,13,3), Willi…
|
S
@still-lynx-704
|
EURUSD | 1h | 61.7%61.7% | +15.96%+15.96% | 2.842.84 | 1.67%1.67% | 4747 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:03:13
# Model : XGBoost
# Feature Eng. : MACD (5,13,3), Williams %R 14, Keltner (20,2.0), EMA 5/13 cross, BB (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 = "/root/Desktop/QuantifyMe/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):
# --- MACD(5,13,3) ---
_m = close.ewm(span=5, adjust=False).mean() - close.ewm(span=13, adjust=False).mean()
_sig = _m.ewm(span=3, adjust=False).mean()
df["macd_5_13"] = _m / close * 1e4
df["macd_5_13_sig"] = _sig / close * 1e4
df["macd_5_13_hist"] = (_m - _sig) / close * 1e4
df["macd_5_13_hist_chg"] = df["macd_5_13_hist"].diff(1)
# --- Williams %R(14) ---
_hh2 = high.rolling(14).max()
_ll2 = low.rolling(14).min()
df["willr_14"] = -100.0 * (_hh2 - close) / (_hh2 - _ll2 + 1e-10)
# --- 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)
# --- EMA 5/13 crossover ---
_ea = close.ewm(span=5, adjust=False).mean()
_eb = close.ewm(span=13, adjust=False).mean()
df["ema_5_13_diff"] = (_ea - _eb) / close * 1e4
df["ema_5_13_diff_chg"] = df["ema_5_13_diff"].diff(1)
df["ema_5_13_cross_up"] = ((_ea > _eb) & (_ea.shift(1) <= _eb.shift(1))).astype(float)
df["ema_5_13_cross_dn"] = ((_ea < _eb) & (_ea.shift(1) >= _eb.shift(1))).astype(float)
df["close_vs_ema_5"] = close / _ea - 1.0
# --- Bollinger Bands(20,2.0) ---
_mid = close.rolling(20).mean()
_sd = close.rolling(20).std()
df["bb_20_2p0_pctb"] = (close - (_mid - 2.0 * _sd)) / (2 * 2.0 * _sd + 1e-10)
df["bb_20_2p0_width"] = (2 * 2.0 * _sd) / (_mid + 1e-10)
df["bb_20_2p0_width_chg"] = df["bb_20_2p0_width"].pct_change(3)
# 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 XGBoost 1h",
"model_type": "XGBClassifier",
"model_params": {
"n_estimators": 150,
"max_depth": 5,
"learning_rate": 0.08,
"subsample": 0.8,
"colsample_bytree": 0.8,
"min_child_weight": 3,
"reg_lambda": 2.0,
"gamma": 0.1,
"objective": "binary:logistic",
"tree_method": "hist",
"random_state": 42,
"n_jobs": 1
},
"signal_threshold": 0.55,
"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": 2,
"objective": "Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: MACD (5,13,3), Williams %R 14, Keltner (20,2.0), EMA 5/13 cross, BB (20,2.0). Model: XGBoost. Label horizon 2 bars, confidence threshold 0.55, 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."
}
|
||||||||||
|
🥉
|
EUR/USD Vol-Regime: BB (20,2.0) + ATR 10 (XGBoost, 1h)
Vol-Regime strategy on EUR/USD 1h: Squeeze (BB inside Keltner) then expansion; classifier picks the direction of the release. Features: BB (…
|
E
@echo-quanta-127
|
EURUSD | 1h | 62.5%62.5% | +14.16%+14.16% | 3.203.20 | 2.91%2.91% | 1616 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:03:13
# Model : XGBoost
# Feature Eng. : BB (20,2.0), ATR 10, ADX 14, Volatility 10, Return lags 1-5, Keltner (20,1.5), Session/time features
# Signal / Entry : Squeeze (BB inside Keltner) then expansion; classifier picks the direction of the release
# Optimization : Maximize out-of-sample return with a 70/30 holdout
# Risk Mgmt : Stop loss 25 pips, Take profit 50 pips
# Risk Filter : session [12, 21] UTC
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/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):
# --- Bollinger Bands(20,2.0) ---
_mid = close.rolling(20).mean()
_sd = close.rolling(20).std()
df["bb_20_2p0_pctb"] = (close - (_mid - 2.0 * _sd)) / (2 * 2.0 * _sd + 1e-10)
df["bb_20_2p0_width"] = (2 * 2.0 * _sd) / (_mid + 1e-10)
df["bb_20_2p0_width_chg"] = df["bb_20_2p0_width"].pct_change(3)
# --- 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)
# --- ADX(14) with +DI/-DI ---
_up = high.diff()
_dn = -low.diff()
_pdm = pd.Series(np.where((_up > _dn) & (_up > 0), _up, 0.0), index=df.index)
_ndm = pd.Series(np.where((_dn > _up) & (_dn > 0), _dn, 0.0), index=df.index)
_tr2 = pd.concat([high - low, (high - close.shift(1)).abs(), (low - close.shift(1)).abs()], axis=1).max(axis=1)
_atr2 = _tr2.ewm(alpha=1.0/14, adjust=False).mean()
_pdi = 100.0 * _pdm.ewm(alpha=1.0/14, adjust=False).mean() / (_atr2 + 1e-12)
_ndi = 100.0 * _ndm.ewm(alpha=1.0/14, adjust=False).mean() / (_atr2 + 1e-12)
_dx = 100.0 * (_pdi - _ndi).abs() / (_pdi + _ndi + 1e-12)
df["adx_14"] = _dx.ewm(alpha=1.0/14, adjust=False).mean()
df["di_diff_14"] = _pdi - _ndi
# --- Realised volatility(10) ---
_r2 = close.pct_change()
df["vol_10"] = _r2.rolling(10).std() * 1e4
df["vol_10_ratio"] = df["vol_10"] / (_r2.rolling(40).std() * 1e4 + 1e-9)
# --- Return lags 1..5 ---
_r = close.pct_change() * 1e4
for _i in range(1, 6):
df[f"ret_lag_{_i}"] = _r.shift(_i - 1)
df["ret_sum_5"] = _r.rolling(5).sum()
# --- Keltner channel(20,1.5) 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) / (1.5 * _katr + 1e-12)
# --- Time-of-day / day-of-week (UTC) ---
_h = df.index.hour + df.index.minute / 60.0
df["hour_sin"] = np.sin(2 * np.pi * _h / 24.0)
df["hour_cos"] = np.cos(2 * np.pi * _h / 24.0)
df["dow"] = df.index.dayofweek.astype(float)
df["london_open"] = ((df.index.hour >= 7) & (df.index.hour < 10)).astype(float)
df["ny_open"] = ((df.index.hour >= 13) & (df.index.hour < 16)).astype(float)
# 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 Vol-Regime XGBoost 1h",
"model_type": "XGBClassifier",
"model_params": {
"n_estimators": 250,
"max_depth": 3,
"learning_rate": 0.02,
"subsample": 0.7,
"colsample_bytree": 0.7,
"min_child_weight": 5,
"reg_lambda": 1.0,
"gamma": 0.0,
"objective": "binary:logistic",
"tree_method": "hist",
"random_state": 42,
"n_jobs": 1
},
"signal_threshold": 0.58,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 0,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": [
12,
21
],
"min_atr": None,
"trend_filter": None,
"target_horizon": 6,
"objective": "Vol-Regime strategy on EUR/USD 1h: Squeeze (BB inside Keltner) then expansion; classifier picks the direction of the release. Features: BB (20,2.0), ATR 10, ADX 14, Volatility 10, Return lags 1-5, Keltner (20,1.5), Session/time features. Model: XGBoost. Label horizon 6 bars, confidence threshold 0.58, 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."
}
|
||||||||||
|
8.22
|
EUR/USD Signal Mix: Z-score 50 (XGBoost, 1h)
Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: Z-score 50, EMA ribb…
|
D
@delta_one
|
EURUSD | 1h | 71.4%71.4% | +9.27%+9.27% | 3.213.21 | 2.58%2.58% | 1414 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:03:13
# Model : XGBoost
# Feature Eng. : Z-score 50, EMA ribbon 8-55, Volatility 10, Donchian 55
# 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 : session [7, 20] UTC
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/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):
# --- Z-score(50) of close ---
df["zscore_50"] = (close - close.rolling(50).mean()) / (close.rolling(50).std() + 1e-12)
df["zscore_50_chg"] = df["zscore_50"].diff(1)
# --- EMA ribbon alignment (8/13/21/34/55) ---
_es = [close.ewm(span=_n, adjust=False).mean() for _n in (8, 13, 21, 34, 55)]
df["ribbon_align"] = sum(((_es[_i] > _es[_i + 1]).astype(float) * 2 - 1) for _i in range(4))
df["ribbon_spread"] = (_es[0] - _es[-1]) / close * 1e4
# --- Realised volatility(10) ---
_r2 = close.pct_change()
df["vol_10"] = _r2.rolling(10).std() * 1e4
df["vol_10_ratio"] = df["vol_10"] / (_r2.rolling(40).std() * 1e4 + 1e-9)
# --- 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)
# 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 XGBoost 1h",
"model_type": "XGBClassifier",
"model_params": {
"n_estimators": 250,
"max_depth": 3,
"learning_rate": 0.02,
"subsample": 0.8,
"colsample_bytree": 0.7,
"min_child_weight": 1,
"reg_lambda": 1.0,
"gamma": 0.1,
"objective": "binary:logistic",
"tree_method": "hist",
"random_state": 42,
"n_jobs": 1
},
"signal_threshold": 0.55,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 0,
"max_positions": 1,
"on_opposite": "close_only",
"session_filter": [
7,
20
],
"min_atr": None,
"trend_filter": None,
"target_horizon": 1,
"objective": "Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: Z-score 50, EMA ribbon 8-55, Volatility 10, Donchian 55. Model: XGBoost. Label horizon 1 bars, confidence threshold 0.55, 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."
}
|
||||||||||
|
7.93
|
EUR/USD Oscillator Stack: RSI 14 + Stochastic (LightGBM, 1h)
Oscillator Stack strategy on EUR/USD 1h. Confluence of RSI, Stochastic, Williams %R and CCI extremes. Features: RSI 14, Stochastic (5,3), Wi…
|
N
@neural-tiger-347
|
EURUSD | 1h | 53.8%66.0% | +17.58%+15.13% | 2.182.29 | 4.05%4.05% | 6553 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:33:05
# Model : LightGBM
# Feature Eng. : RSI 14, Stochastic (5,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 = "/root/Desktop/QuantifyMe/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):
# --- RSI(14) with zone flags and slope ---
_d = close.diff()
_g = _d.clip(lower=0).ewm(com=13, min_periods=14, adjust=False).mean()
_l = (-_d.clip(upper=0)).ewm(com=13, min_periods=14, adjust=False).mean()
_rsi = 100.0 - 100.0 / (1.0 + _g / (_l + 1e-10))
df["rsi_14"] = _rsi
df["rsi_14_os"] = (_rsi < 30).astype(float)
df["rsi_14_ob"] = (_rsi > 70).astype(float)
df["rsi_14_slope"] = _rsi.diff(2)
# --- Stochastic(5,3) ---
_ll = low.rolling(5).min()
_hh = high.rolling(5).max()
_k = 100.0 * (close - _ll) / (_hh - _ll + 1e-10)
df["stoch_k_5"] = _k
df["stoch_d_5"] = _k.rolling(3).mean()
df["stoch_5_diff"] = df["stoch_k_5"] - df["stoch_d_5"]
# --- 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": 31,
"learning_rate": 0.05,
"subsample": 0.8,
"subsample_freq": 1,
"colsample_bytree": 0.6,
"min_child_samples": 20,
"reg_lambda": 2.0,
"random_state": 42,
"n_jobs": 1,
"verbose": -1
},
"signal_threshold": 0.58,
"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 14, Stochastic (5,3), Williams %R 14, CCI 20, MACD (12,26,9), Candle structure. Model: LightGBM. Label horizon 4 bars, confidence threshold 0.58, 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."
}
|
||||||||||
|
7.70
|
EUR/USD Signal Mix: MACD (5,13,3) (Random Forest, 1h)
Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: Session/time feature…
|
D
@delta_one
|
EURUSD | 1h | 75.0%75.0% | +11.20%+11.20% | 3.673.67 | 4.00%4.00% | 1212 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:34:17
# Model : Random Forest
# Feature Eng. : Session/time features, MACD (5,13,3), CCI 14, 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 : session [7, 20] UTC, trend sma_100
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/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):
# --- Time-of-day / day-of-week (UTC) ---
_h = df.index.hour + df.index.minute / 60.0
df["hour_sin"] = np.sin(2 * np.pi * _h / 24.0)
df["hour_cos"] = np.cos(2 * np.pi * _h / 24.0)
df["dow"] = df.index.dayofweek.astype(float)
df["london_open"] = ((df.index.hour >= 7) & (df.index.hour < 10)).astype(float)
df["ny_open"] = ((df.index.hour >= 13) & (df.index.hour < 16)).astype(float)
# --- MACD(5,13,3) ---
_m = close.ewm(span=5, adjust=False).mean() - close.ewm(span=13, adjust=False).mean()
_sig = _m.ewm(span=3, adjust=False).mean()
df["macd_5_13"] = _m / close * 1e4
df["macd_5_13_sig"] = _sig / close * 1e4
df["macd_5_13_hist"] = (_m - _sig) / close * 1e4
df["macd_5_13_hist_chg"] = df["macd_5_13_hist"].diff(1)
# --- 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)
# --- 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": "EUR/USD Random Mix Random Forest 1h",
"model_type": "RandomForestClassifier",
"model_params": {
"n_estimators": 200,
"max_depth": 5,
"min_samples_leaf": 20,
"max_features": "sqrt",
"random_state": 42,
"n_jobs": 1
},
"signal_threshold": 0.55,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 0,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": [
7,
20
],
"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: Session/time features, MACD (5,13,3), CCI 14, Keltner (20,2.0). Model: Random Forest. Label horizon 2 bars, confidence threshold 0.55, 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."
}
|
||||||||||
|
7.44
|
EUR/USD Vol-Regime: BB (20,2.0) + ATR 10 (Random Forest, 1h)
Vol-Regime strategy on EUR/USD 1h: Squeeze (BB inside Keltner) then expansion; classifier picks the direction of the release. Features: BB (…
|
D
@delta-atlas-858
|
EURUSD | 1h | 70.0%70.0% | +12.81%+12.81% | 2.822.82 | 3.40%3.40% | 2020 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:34:17
# Model : Random Forest
# Feature Eng. : BB (20,2.0), ATR 10, ADX 14, Volatility 20, Return lags 1-3, Keltner (20,1.5), Session/time features
# Signal / Entry : Squeeze (BB inside Keltner) then expansion; classifier picks the direction of the release
# Optimization : Maximize out-of-sample return with a 70/30 holdout
# Risk Mgmt : Stop loss 25 pips, Take profit 50 pips
# Risk Filter : session [7, 20] UTC
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/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):
# --- Bollinger Bands(20,2.0) ---
_mid = close.rolling(20).mean()
_sd = close.rolling(20).std()
df["bb_20_2p0_pctb"] = (close - (_mid - 2.0 * _sd)) / (2 * 2.0 * _sd + 1e-10)
df["bb_20_2p0_width"] = (2 * 2.0 * _sd) / (_mid + 1e-10)
df["bb_20_2p0_width_chg"] = df["bb_20_2p0_width"].pct_change(3)
# --- 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)
# --- ADX(14) with +DI/-DI ---
_up = high.diff()
_dn = -low.diff()
_pdm = pd.Series(np.where((_up > _dn) & (_up > 0), _up, 0.0), index=df.index)
_ndm = pd.Series(np.where((_dn > _up) & (_dn > 0), _dn, 0.0), index=df.index)
_tr2 = pd.concat([high - low, (high - close.shift(1)).abs(), (low - close.shift(1)).abs()], axis=1).max(axis=1)
_atr2 = _tr2.ewm(alpha=1.0/14, adjust=False).mean()
_pdi = 100.0 * _pdm.ewm(alpha=1.0/14, adjust=False).mean() / (_atr2 + 1e-12)
_ndi = 100.0 * _ndm.ewm(alpha=1.0/14, adjust=False).mean() / (_atr2 + 1e-12)
_dx = 100.0 * (_pdi - _ndi).abs() / (_pdi + _ndi + 1e-12)
df["adx_14"] = _dx.ewm(alpha=1.0/14, adjust=False).mean()
df["di_diff_14"] = _pdi - _ndi
# --- 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()
# --- Keltner channel(20,1.5) 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) / (1.5 * _katr + 1e-12)
# --- Time-of-day / day-of-week (UTC) ---
_h = df.index.hour + df.index.minute / 60.0
df["hour_sin"] = np.sin(2 * np.pi * _h / 24.0)
df["hour_cos"] = np.cos(2 * np.pi * _h / 24.0)
df["dow"] = df.index.dayofweek.astype(float)
df["london_open"] = ((df.index.hour >= 7) & (df.index.hour < 10)).astype(float)
df["ny_open"] = ((df.index.hour >= 13) & (df.index.hour < 16)).astype(float)
# 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 Vol-Regime Random Forest 1h",
"model_type": "RandomForestClassifier",
"model_params": {
"n_estimators": 200,
"max_depth": 8,
"min_samples_leaf": 5,
"max_features": "sqrt",
"random_state": 42,
"n_jobs": 1
},
"signal_threshold": 0.55,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 0,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": [
7,
20
],
"min_atr": None,
"trend_filter": None,
"target_horizon": 6,
"objective": "Vol-Regime strategy on EUR/USD 1h: Squeeze (BB inside Keltner) then expansion; classifier picks the direction of the release. Features: BB (20,2.0), ATR 10, ADX 14, Volatility 20, Return lags 1-3, Keltner (20,1.5), Session/time features. Model: Random Forest. Label horizon 6 bars, confidence threshold 0.55, 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."
}
|
||||||||||
|
5.59
|
EUR/USD Signal Mix: BB (10,2.0) (Gradient Boosting, 1h)
Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: BB (10,2.0), EMA 12/…
|
V
@vol_drifter
|
EURUSD | 1h | 72.2%72.2% | +9.18%+9.18% | 2.522.52 | 2.99%2.99% | 1818 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:03:13
# Model : Gradient Boosting
# Feature Eng. : BB (10,2.0), EMA 12/26 cross, ROC 3, Return lags 1-8, Stochastic (5,3)
# 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 = "/root/Desktop/QuantifyMe/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):
# --- 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)
# --- EMA 12/26 crossover ---
_ea = close.ewm(span=12, adjust=False).mean()
_eb = close.ewm(span=26, adjust=False).mean()
df["ema_12_26_diff"] = (_ea - _eb) / close * 1e4
df["ema_12_26_diff_chg"] = df["ema_12_26_diff"].diff(1)
df["ema_12_26_cross_up"] = ((_ea > _eb) & (_ea.shift(1) <= _eb.shift(1))).astype(float)
df["ema_12_26_cross_dn"] = ((_ea < _eb) & (_ea.shift(1) >= _eb.shift(1))).astype(float)
df["close_vs_ema_12"] = close / _ea - 1.0
# --- Rate of change(3) ---
df["roc_3"] = close.pct_change(3) * 1e4
# --- Return lags 1..8 ---
_r = close.pct_change() * 1e4
for _i in range(1, 9):
df[f"ret_lag_{_i}"] = _r.shift(_i - 1)
df["ret_sum_8"] = _r.rolling(8).sum()
# --- Stochastic(5,3) ---
_ll = low.rolling(5).min()
_hh = high.rolling(5).max()
_k = 100.0 * (close - _ll) / (_hh - _ll + 1e-10)
df["stoch_k_5"] = _k
df["stoch_d_5"] = _k.rolling(3).mean()
df["stoch_5_diff"] = df["stoch_k_5"] - df["stoch_d_5"]
# 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 Gradient Boosting 1h",
"model_type": "GradientBoostingClassifier",
"model_params": {
"n_estimators": 150,
"max_depth": 2,
"learning_rate": 0.03,
"subsample": 0.7,
"random_state": 42
},
"signal_threshold": 0.52,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 1,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": None,
"min_atr": None,
"trend_filter": "sma_100",
"target_horizon": 6,
"objective": "Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: BB (10,2.0), EMA 12/26 cross, ROC 3, Return lags 1-8, Stochastic (5,3). Model: Gradient Boosting. Label horizon 6 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."
}
|
||||||||||
|
3.71
|
EUR/USD Signal Mix: Z-score 50 + BB (20,1.5) (LightGBM, 1h)
Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: Z-score 50, BB (20,1…
|
C
@cold-stork-489
|
EURUSD | 1h | 65.0%65.0% | +11.38%+11.38% | 2.612.61 | 5.20%5.20% | 2020 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:34:17
# Model : LightGBM
# Feature Eng. : Z-score 50, BB (20,1.5), Candle structure, ATR 10, Williams %R 21
# 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 : session [7, 20] UTC, trend sma_100
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/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):
# --- Z-score(50) of close ---
df["zscore_50"] = (close - close.rolling(50).mean()) / (close.rolling(50).std() + 1e-12)
df["zscore_50_chg"] = df["zscore_50"].diff(1)
# --- Bollinger Bands(20,1.5) ---
_mid = close.rolling(20).mean()
_sd = close.rolling(20).std()
df["bb_20_1p5_pctb"] = (close - (_mid - 1.5 * _sd)) / (2 * 1.5 * _sd + 1e-10)
df["bb_20_1p5_width"] = (2 * 1.5 * _sd) / (_mid + 1e-10)
df["bb_20_1p5_width_chg"] = df["bb_20_1p5_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(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)
# --- Williams %R(21) ---
_hh2 = high.rolling(21).max()
_ll2 = low.rolling(21).min()
df["willr_21"] = -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": 400,
"num_leaves": 15,
"learning_rate": 0.05,
"subsample": 0.8,
"subsample_freq": 1,
"colsample_bytree": 0.6,
"min_child_samples": 40,
"reg_lambda": 2.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": 1,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": [
7,
20
],
"min_atr": None,
"trend_filter": "sma_100",
"target_horizon": 4,
"objective": "Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: Z-score 50, BB (20,1.5), Candle structure, ATR 10, Williams %R 21. Model: LightGBM. Label horizon 4 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."
}
|
||||||||||
|
2.95
|
EUR/USD Oscillator Stack: RSI 7 (LightGBM, 1h)
Oscillator Stack strategy on EUR/USD 1h: Confluence of RSI, Stochastic, Williams %R and CCI extremes. Features: RSI 7, Stochastic (9,3), Wil…
|
N
@neural-tiger-347
|
EURUSD | 1h | 64.3%64.3% | +7.50%+7.50% | 2.562.56 | 4.18%4.18% | 1414 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:34:17
# Model : LightGBM
# Feature Eng. : RSI 7, Stochastic (9,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 : —, trend sma_50
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/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(9,3) ---
_ll = low.rolling(9).min()
_hh = high.rolling(9).max()
_k = 100.0 * (close - _ll) / (_hh - _ll + 1e-10)
df["stoch_k_9"] = _k
df["stoch_d_9"] = _k.rolling(3).mean()
df["stoch_9_diff"] = df["stoch_k_9"] - df["stoch_d_9"]
# --- 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": 200,
"num_leaves": 15,
"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": 1,
"max_positions": 1,
"on_opposite": "close_only",
"session_filter": None,
"min_atr": None,
"trend_filter": "sma_50",
"target_horizon": 4,
"objective": "Oscillator Stack strategy on EUR/USD 1h: Confluence of RSI, Stochastic, Williams %R and CCI extremes. Features: RSI 7, Stochastic (9,3), Williams %R 14, CCI 20, MACD (12,26,9), Candle structure. Model: LightGBM. Label horizon 4 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."
}
|
||||||||||
|
2.84
|
EUR/USD Oscillator Stack: RSI 7 (LightGBM, 1h)
Oscillator Stack strategy on EUR/USD 1h: Confluence of RSI, Stochastic, Williams %R and CCI extremes. Features: RSI 7, Stochastic (14,3), Wi…
|
C
@candid-owl-125
|
EURUSD | 1h | 57.1%57.1% | +13.50%+13.50% | 1.881.88 | 5.10%5.10% | 6363 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ 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 = "/root/Desktop/QuantifyMe/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."
}
|
||||||||||
|
2.64
|
EUR/USD Multi-Indicator: RSI 14 + MACD (LightGBM, 1h)
Multi-Indicator strategy on EUR/USD 1h. Broad indicator set; the gradient-boosted model learns the entry rule. Features: RSI 14, MACD (12,26…
|
E
@elastic-moose-350
|
EURUSD | 1h | 63.3%65.7% | +5.33%+8.51% | 1.472.05 | 4.13%4.13% | 3035 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:14:19
# Model : LightGBM
# Feature Eng. : RSI 14, MACD (12,26,9), BB (20,2.0), Stochastic (14,3), ATR 14, ADX 14, EMA 9/21 cross, Candle structure, Return lags 1-3, Session/time features
# Signal / Entry : Broad indicator set; gradient-boosted model learns the entry rule
# Optimization : Maximize out-of-sample return with a 70/30 holdout
# Risk Mgmt : Stop loss 25 pips, Take profit 50 pips
# Risk Filter : session [7, 20] UTC
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/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):
# --- RSI(14) with zone flags and slope ---
_d = close.diff()
_g = _d.clip(lower=0).ewm(com=13, min_periods=14, adjust=False).mean()
_l = (-_d.clip(upper=0)).ewm(com=13, min_periods=14, adjust=False).mean()
_rsi = 100.0 - 100.0 / (1.0 + _g / (_l + 1e-10))
df["rsi_14"] = _rsi
df["rsi_14_os"] = (_rsi < 30).astype(float)
df["rsi_14_ob"] = (_rsi > 70).astype(float)
df["rsi_14_slope"] = _rsi.diff(2)
# --- 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)
# --- Bollinger Bands(20,2.0) ---
_mid = close.rolling(20).mean()
_sd = close.rolling(20).std()
df["bb_20_2p0_pctb"] = (close - (_mid - 2.0 * _sd)) / (2 * 2.0 * _sd + 1e-10)
df["bb_20_2p0_width"] = (2 * 2.0 * _sd) / (_mid + 1e-10)
df["bb_20_2p0_width_chg"] = df["bb_20_2p0_width"].pct_change(3)
# --- 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"]
# --- ATR(14) 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/14, adjust=False).mean()
df["atr_14_pct"] = _atr / close
df["atr_14_ratio"] = _atr / (_atr.rolling(56).mean() + 1e-12)
# --- ADX(14) with +DI/-DI ---
_up = high.diff()
_dn = -low.diff()
_pdm = pd.Series(np.where((_up > _dn) & (_up > 0), _up, 0.0), index=df.index)
_ndm = pd.Series(np.where((_dn > _up) & (_dn > 0), _dn, 0.0), index=df.index)
_tr2 = pd.concat([high - low, (high - close.shift(1)).abs(), (low - close.shift(1)).abs()], axis=1).max(axis=1)
_atr2 = _tr2.ewm(alpha=1.0/14, adjust=False).mean()
_pdi = 100.0 * _pdm.ewm(alpha=1.0/14, adjust=False).mean() / (_atr2 + 1e-12)
_ndi = 100.0 * _ndm.ewm(alpha=1.0/14, adjust=False).mean() / (_atr2 + 1e-12)
_dx = 100.0 * (_pdi - _ndi).abs() / (_pdi + _ndi + 1e-12)
df["adx_14"] = _dx.ewm(alpha=1.0/14, adjust=False).mean()
df["di_diff_14"] = _pdi - _ndi
# --- 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
# --- 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)
# --- 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()
# --- Time-of-day / day-of-week (UTC) ---
_h = df.index.hour + df.index.minute / 60.0
df["hour_sin"] = np.sin(2 * np.pi * _h / 24.0)
df["hour_cos"] = np.cos(2 * np.pi * _h / 24.0)
df["dow"] = df.index.dayofweek.astype(float)
df["london_open"] = ((df.index.hour >= 7) & (df.index.hour < 10)).astype(float)
df["ny_open"] = ((df.index.hour >= 13) & (df.index.hour < 16)).astype(float)
# 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 Multi-Indicator LightGBM 1h",
"model_type": "LGBMClassifier",
"model_params": {
"n_estimators": 300,
"num_leaves": 15,
"learning_rate": 0.05,
"subsample": 0.7,
"subsample_freq": 1,
"colsample_bytree": 0.8,
"min_child_samples": 40,
"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": "close_only",
"session_filter": [
7,
20
],
"min_atr": None,
"trend_filter": None,
"target_horizon": 1,
"objective": "Multi-Indicator strategy on EUR/USD 1h: Broad indicator set; gradient-boosted model learns the entry rule. Features: RSI 14, MACD (12,26,9), BB (20,2.0), Stochastic (14,3), ATR 14, ADX 14, EMA 9/21 cross, Candle structure, Return lags 1-3, Session/time features. Model: LightGBM. Label horizon 1 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."
}
|
||||||||||
|
2.42
|
EUR/USD Signal Mix: SMA 50 + Stochastic (5,3) (LightGBM, 1h)
Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: SMA 50, Stochastic (…
|
A
@alpha-viper-151
|
EURUSD | 1h | 70.0%70.0% | +6.93%+6.93% | 2.082.08 | 4.17%4.17% | 2020 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:34:17
# Model : LightGBM
# Feature Eng. : SMA 50, Stochastic (5,3), BB (20,1.5), ADX 20, Session/time features
# 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 = "/root/Desktop/QuantifyMe/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):
# --- 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)
# --- Stochastic(5,3) ---
_ll = low.rolling(5).min()
_hh = high.rolling(5).max()
_k = 100.0 * (close - _ll) / (_hh - _ll + 1e-10)
df["stoch_k_5"] = _k
df["stoch_d_5"] = _k.rolling(3).mean()
df["stoch_5_diff"] = df["stoch_k_5"] - df["stoch_d_5"]
# --- Bollinger Bands(20,1.5) ---
_mid = close.rolling(20).mean()
_sd = close.rolling(20).std()
df["bb_20_1p5_pctb"] = (close - (_mid - 1.5 * _sd)) / (2 * 1.5 * _sd + 1e-10)
df["bb_20_1p5_width"] = (2 * 1.5 * _sd) / (_mid + 1e-10)
df["bb_20_1p5_width_chg"] = df["bb_20_1p5_width"].pct_change(3)
# --- ADX(20) with +DI/-DI ---
_up = high.diff()
_dn = -low.diff()
_pdm = pd.Series(np.where((_up > _dn) & (_up > 0), _up, 0.0), index=df.index)
_ndm = pd.Series(np.where((_dn > _up) & (_dn > 0), _dn, 0.0), index=df.index)
_tr2 = pd.concat([high - low, (high - close.shift(1)).abs(), (low - close.shift(1)).abs()], axis=1).max(axis=1)
_atr2 = _tr2.ewm(alpha=1.0/20, adjust=False).mean()
_pdi = 100.0 * _pdm.ewm(alpha=1.0/20, adjust=False).mean() / (_atr2 + 1e-12)
_ndi = 100.0 * _ndm.ewm(alpha=1.0/20, adjust=False).mean() / (_atr2 + 1e-12)
_dx = 100.0 * (_pdi - _ndi).abs() / (_pdi + _ndi + 1e-12)
df["adx_20"] = _dx.ewm(alpha=1.0/20, adjust=False).mean()
df["di_diff_20"] = _pdi - _ndi
# --- Time-of-day / day-of-week (UTC) ---
_h = df.index.hour + df.index.minute / 60.0
df["hour_sin"] = np.sin(2 * np.pi * _h / 24.0)
df["hour_cos"] = np.cos(2 * np.pi * _h / 24.0)
df["dow"] = df.index.dayofweek.astype(float)
df["london_open"] = ((df.index.hour >= 7) & (df.index.hour < 10)).astype(float)
df["ny_open"] = ((df.index.hour >= 13) & (df.index.hour < 16)).astype(float)
# 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": 15,
"learning_rate": 0.05,
"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.58,
"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": "sma_100",
"target_horizon": 6,
"objective": "Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: SMA 50, Stochastic (5,3), BB (20,1.5), ADX 20, Session/time features. Model: LightGBM. Label horizon 6 bars, confidence threshold 0.58, 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."
}
|
||||||||||
|
2.11
|
EUR/USD Oscillator Stack: RSI 7 (RandomForest, 1h)
Oscillator Stack strategy on EUR/USD 1h. Confluence of RSI, Stochastic, Williams %R and CCI extremes. Features: RSI 7, Stochastic (14,3), Wi…
|
A
@alpha-viper-151
|
EURUSD | 1h | 45.5%55.6% | +2.88%+8.12% | 1.642.38 | 2.51%2.51% | 119 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:14:19
# Model : Random Forest
# 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 : —, trend sma_50
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/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):
# --- 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 Random Forest 1h",
"model_type": "RandomForestClassifier",
"model_params": {
"n_estimators": 300,
"max_depth": 8,
"min_samples_leaf": 20,
"max_features": "sqrt",
"random_state": 42,
"n_jobs": 1
},
"signal_threshold": 0.58,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 1,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": None,
"min_atr": None,
"trend_filter": "sma_50",
"target_horizon": 3,
"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: Random Forest. Label horizon 3 bars, confidence threshold 0.58, 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."
}
|
||||||||||
|
1.94
|
EUR/USD Signal Mix: EMA 9/21 cross + ROC 10 (LightGBM, 1h)
Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: EMA 9/21 cross, ROC …
|
V
@vega-puma-338
|
EURUSD | 1h | 69.6%69.6% | +6.09%+6.09% | 1.621.62 | 3.54%3.54% | 2323 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:03:05
# Model : LightGBM
# Feature Eng. : EMA 9/21 cross, ROC 10, CCI 20, ADX 20, Williams %R 21
# 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 : session [7, 20] UTC
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/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):
# --- 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
# --- Rate of change(10) ---
df["roc_10"] = close.pct_change(10) * 1e4
# --- 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)
# --- ADX(20) with +DI/-DI ---
_up = high.diff()
_dn = -low.diff()
_pdm = pd.Series(np.where((_up > _dn) & (_up > 0), _up, 0.0), index=df.index)
_ndm = pd.Series(np.where((_dn > _up) & (_dn > 0), _dn, 0.0), index=df.index)
_tr2 = pd.concat([high - low, (high - close.shift(1)).abs(), (low - close.shift(1)).abs()], axis=1).max(axis=1)
_atr2 = _tr2.ewm(alpha=1.0/20, adjust=False).mean()
_pdi = 100.0 * _pdm.ewm(alpha=1.0/20, adjust=False).mean() / (_atr2 + 1e-12)
_ndi = 100.0 * _ndm.ewm(alpha=1.0/20, adjust=False).mean() / (_atr2 + 1e-12)
_dx = 100.0 * (_pdi - _ndi).abs() / (_pdi + _ndi + 1e-12)
df["adx_20"] = _dx.ewm(alpha=1.0/20, adjust=False).mean()
df["di_diff_20"] = _pdi - _ndi
# --- Williams %R(21) ---
_hh2 = high.rolling(21).max()
_ll2 = low.rolling(21).min()
df["willr_21"] = -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.03,
"subsample": 0.8,
"subsample_freq": 1,
"colsample_bytree": 0.8,
"min_child_samples": 30,
"reg_lambda": 1.0,
"random_state": 42,
"n_jobs": 1,
"verbose": -1
},
"signal_threshold": 0.55,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 0,
"max_positions": 1,
"on_opposite": "close_only",
"session_filter": [
7,
20
],
"min_atr": None,
"trend_filter": None,
"target_horizon": 3,
"objective": "Random Mix strategy on EUR/USD 1h: API-default style: randomly composed indicator set, model learns the rule. Features: EMA 9/21 cross, ROC 10, CCI 20, ADX 20, Williams %R 21. Model: LightGBM. Label horizon 3 bars, confidence threshold 0.55, 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."
}
|
||||||||||