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 | ||
|---|---|---|---|---|---|---|---|---|---|---|
|
1.62
|
USD/CAD Signal Mix: RetLags5 + ROC 10 (LightGBM, 15m)
Signal Mix strategy on USD/CAD 15min. A compact, machine-selected indicator set; the classifier learns the entry rule directly from the feat…
|
A
@alpha-viper-151
|
USDCAD | 15min | 33.3%40.9% | +8.24%+8.98% | 1.811.81 | 3.91%3.91% | 2422 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:33:05
# Model : LightGBM
# Feature Eng. : Candle structure, Return lags 1-5, ROC 10, RSI 7
# 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, 17] UTC, trend ema_50
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/data/ohlc/USDCAD_15min.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):
# --- 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..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()
# --- Rate of change(10) ---
df["roc_10"] = close.pct_change(10) * 1e4
# --- 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)
# 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 LightGBM 15min",
"model_type": "LGBMClassifier",
"model_params": {
"n_estimators": 400,
"num_leaves": 15,
"learning_rate": 0.05,
"subsample": 0.8,
"subsample_freq": 1,
"colsample_bytree": 0.8,
"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,
17
],
"min_atr": None,
"trend_filter": "ema_50",
"target_horizon": 4,
"objective": "Random Mix strategy on USD/CAD 15min: API-default style: randomly composed indicator set, model learns the rule. Features: Candle structure, Return lags 1-5, ROC 10, RSI 7. 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."
}
|
||||||||||
|
1.58
|
USD/CAD Trend Pullback: EMA 20/50 + SMA 200 (LightGBM, 15m)
Trend Pullback strategy on USD/CAD 15min. Buy dips / sell rallies inside an established trend when the fast RSI resets. Features: EMA 20/50 …
|
D
@delta_one
|
USDCAD | 15min | 37.5%40.0% | +3.72%+8.61% | 1.462.09 | 3.39%3.39% | 1615 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:33:05
# Model : LightGBM
# Feature Eng. : EMA 20/50 cross, SMA 200, RSI 7, ATR 14, Keltner (20,2.0), EMA ribbon 8-55, Session/time features
# Signal / Entry : Buy dips / sell rallies inside an established trend when the fast RSI resets
# 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 ema_100
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/data/ohlc/USDCAD_15min.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 20/50 crossover ---
_ea = close.ewm(span=20, adjust=False).mean()
_eb = close.ewm(span=50, adjust=False).mean()
df["ema_20_50_diff"] = (_ea - _eb) / close * 1e4
df["ema_20_50_diff_chg"] = df["ema_20_50_diff"].diff(1)
df["ema_20_50_cross_up"] = ((_ea > _eb) & (_ea.shift(1) <= _eb.shift(1))).astype(float)
df["ema_20_50_cross_dn"] = ((_ea < _eb) & (_ea.shift(1) >= _eb.shift(1))).astype(float)
df["close_vs_ema_20"] = close / _ea - 1.0
# --- SMA(200) distance & slope ---
_s = close.rolling(200).mean()
df["sma_200_dist"] = close / _s - 1.0
df["sma_200_slope"] = _s.pct_change(3)
# --- 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)
# --- 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)
# --- 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 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
# --- 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": "USD/CAD Trend Pullback LightGBM 15min",
"model_type": "LGBMClassifier",
"model_params": {
"n_estimators": 300,
"num_leaves": 15,
"learning_rate": 0.05,
"subsample": 0.7,
"subsample_freq": 1,
"colsample_bytree": 0.6,
"min_child_samples": 20,
"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": 2,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": [
7,
20
],
"min_atr": None,
"trend_filter": "ema_100",
"target_horizon": 5,
"objective": "Trend Pullback strategy on USD/CAD 15min: Buy dips / sell rallies inside an established trend when the fast RSI resets. Features: EMA 20/50 cross, SMA 200, RSI 7, ATR 14, Keltner (20,2.0), EMA ribbon 8-55, Session/time features. Model: LightGBM. Label horizon 5 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."
}
|
||||||||||
|
1.45
|
USD/JPY Vol-Regime: BB (20,2.0) (Random Forest, 15m)
Vol-Regime strategy on USD/JPY 15min: Squeeze (BB inside Keltner) then expansion; classifier picks the direction of the release. Features: B…
|
E
@elastic-moose-350
|
USDJPY | 15min | 45.8%45.8% | +12.32%+12.32% | 1.671.67 | 6.51%6.51% | 2424 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:03:05
# Model : Random Forest
# 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/USDJPY_15min.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": "USD/JPY Vol-Regime Random Forest 15min",
"model_type": "RandomForestClassifier",
"model_params": {
"n_estimators": 200,
"max_depth": 5,
"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": [
12,
21
],
"min_atr": None,
"trend_filter": None,
"target_horizon": 2,
"objective": "Vol-Regime strategy on USD/JPY 15min: 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: 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."
}
|
||||||||||
|
1.45
|
GBP/USD Breakout: Donchian 55 + ATR 14 (RandomForest, 15m)
Breakout strategy on GBP/USD 15min. Trade Donchian channel breakouts confirmed by volatility expansion. Features: Donchian 55, ATR 14, Volat…
|
V
@vega-puma-338
|
GBPUSD | 15min | 65.0%71.8% | +5.63%+6.30% | 1.361.36 | 6.20%6.20% | 4039 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:14:19
# Model : Random Forest
# Feature Eng. : Donchian 55, ATR 14, Volatility 20, ROC 5, BB (20,2.0), Session/time features
# Signal / Entry : Trade Donchian channel breakouts confirmed by volatility expansion
# 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/GBPUSD_15min.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):
# --- 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)
# --- 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)
# --- 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)
# --- Rate of change(5) ---
df["roc_5"] = close.pct_change(5) * 1e4
# --- 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)
# --- 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": "GBP/USD Breakout Random Forest 15min",
"model_type": "RandomForestClassifier",
"model_params": {
"n_estimators": 400,
"max_depth": 6,
"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": None,
"min_atr": None,
"trend_filter": None,
"target_horizon": 4,
"objective": "Breakout strategy on GBP/USD 15min: Trade Donchian channel breakouts confirmed by volatility expansion. Features: Donchian 55, ATR 14, Volatility 20, ROC 5, BB (20,2.0), Session/time features. Model: Random Forest. Label horizon 4 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."
}
|
||||||||||
|
1.38
|
EUR/USD Signal Mix: RSI 7 + EMA ribbon 8-55 (XGBoost, 15m)
Signal Mix strategy on EUR/USD 15min. A compact, machine-selected indicator set; the classifier learns the entry rule directly from the feat…
|
C
@cold-stork-489
|
EURUSD | 15min | 62.1%62.1% | +12.58%+6.60% | 1.951.36 | 2.91%2.91% | 6666 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:33:05
# Model : XGBoost
# Feature Eng. : RSI 7, EMA ribbon 8-55, BB (50,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_15min.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)
# --- 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
# --- Bollinger Bands(50,2.0) ---
_mid = close.rolling(50).mean()
_sd = close.rolling(50).std()
df["bb_50_2p0_pctb"] = (close - (_mid - 2.0 * _sd)) / (2 * 2.0 * _sd + 1e-10)
df["bb_50_2p0_width"] = (2 * 2.0 * _sd) / (_mid + 1e-10)
df["bb_50_2p0_width_chg"] = df["bb_50_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 15min",
"model_type": "XGBClassifier",
"model_params": {
"n_estimators": 150,
"max_depth": 4,
"learning_rate": 0.03,
"subsample": 0.7,
"colsample_bytree": 0.7,
"min_child_weight": 3,
"reg_lambda": 1.0,
"gamma": 0.0,
"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": 9,
"objective": "Random Mix strategy on EUR/USD 15min: API-default style: randomly composed indicator set, model learns the rule. Features: RSI 7, EMA ribbon 8-55, BB (50,2.0). Model: XGBoost. Label horizon 9 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."
}
|
||||||||||
|
1.26
|
GBP/USD Mean-Reversion: RSI 14 + BB (GradBoost, 15m)
Mean-Reversion strategy on GBP/USD 15min. Fade RSI/Bollinger extremes back toward the mean; the classifier decides direction. Features: RSI …
|
S
@still-lynx-704
|
GBPUSD | 15min | 73.7%69.0% | +8.80%+8.80% | 1.921.71 | 3.01%3.01% | 1929 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:33:05
# Model : Gradient Boosting
# Feature Eng. : RSI 14, BB (14,2.0), Z-score 20, Stochastic (14,3), Candle structure, Session/time features
# Signal / Entry : Fade RSI/Bollinger extremes back toward the mean; classifier decides direction
# Optimization : Maximize out-of-sample return with a 70/30 holdout
# Risk Mgmt : Stop loss 25 pips, Take profit 50 pips
# Risk Filter : session [8, 16] UTC
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/data/ohlc/GBPUSD_15min.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)
# --- Bollinger Bands(14,2.0) ---
_mid = close.rolling(14).mean()
_sd = close.rolling(14).std()
df["bb_14_2p0_pctb"] = (close - (_mid - 2.0 * _sd)) / (2 * 2.0 * _sd + 1e-10)
df["bb_14_2p0_width"] = (2 * 2.0 * _sd) / (_mid + 1e-10)
df["bb_14_2p0_width_chg"] = df["bb_14_2p0_width"].pct_change(3)
# --- Z-score(20) of close ---
df["zscore_20"] = (close - close.rolling(20).mean()) / (close.rolling(20).std() + 1e-12)
df["zscore_20_chg"] = df["zscore_20"].diff(1)
# --- 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"]
# --- 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)
# --- 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": "GBP/USD Mean-Reversion Gradient Boosting 15min",
"model_type": "GradientBoostingClassifier",
"model_params": {
"n_estimators": 200,
"max_depth": 3,
"learning_rate": 0.03,
"subsample": 0.7,
"random_state": 42
},
"signal_threshold": 0.6,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 0,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": [
8,
16
],
"min_atr": None,
"trend_filter": None,
"target_horizon": 3,
"objective": "Mean-Reversion strategy on GBP/USD 15min: Fade RSI/Bollinger extremes back toward the mean; classifier decides direction. Features: RSI 14, BB (14,2.0), Z-score 20, Stochastic (14,3), Candle structure, Session/time features. Model: Gradient Boosting. Label horizon 3 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."
}
|
||||||||||
|
1.24
|
USD/JPY Signal Mix: Stochastic + EMA 50/200 (GradBoost, 15m)
Signal Mix strategy on USD/JPY 15min. A compact, machine-selected indicator set; the classifier learns the entry rule directly from the feat…
|
D
@delta_one
|
USDJPY | 15min | 50.0%42.9% | +10.29%+11.69% | 2.381.76 | 3.91%3.91% | 1821 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:14:19
# Model : Gradient Boosting
# Feature Eng. : Stochastic (21,5), EMA 50/200 cross, Candle structure
# 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 ema_50
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/data/ohlc/USDJPY_15min.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):
# --- Stochastic(21,5) ---
_ll = low.rolling(21).min()
_hh = high.rolling(21).max()
_k = 100.0 * (close - _ll) / (_hh - _ll + 1e-10)
df["stoch_k_21"] = _k
df["stoch_d_21"] = _k.rolling(5).mean()
df["stoch_21_diff"] = df["stoch_k_21"] - df["stoch_d_21"]
# --- EMA 50/200 crossover ---
_ea = close.ewm(span=50, adjust=False).mean()
_eb = close.ewm(span=200, adjust=False).mean()
df["ema_50_200_diff"] = (_ea - _eb) / close * 1e4
df["ema_50_200_diff_chg"] = df["ema_50_200_diff"].diff(1)
df["ema_50_200_cross_up"] = ((_ea > _eb) & (_ea.shift(1) <= _eb.shift(1))).astype(float)
df["ema_50_200_cross_dn"] = ((_ea < _eb) & (_ea.shift(1) >= _eb.shift(1))).astype(float)
df["close_vs_ema_50"] = 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)
# 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 Gradient Boosting 15min",
"model_type": "GradientBoostingClassifier",
"model_params": {
"n_estimators": 150,
"max_depth": 3,
"learning_rate": 0.1,
"subsample": 0.8,
"random_state": 42
},
"signal_threshold": 0.55,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 1,
"max_positions": 1,
"on_opposite": "close_only",
"session_filter": [
7,
20
],
"min_atr": None,
"trend_filter": "ema_50",
"target_horizon": 4,
"objective": "Random Mix strategy on USD/JPY 15min: API-default style: randomly composed indicator set, model learns the rule. Features: Stochastic (21,5), EMA 50/200 cross, Candle structure. Model: Gradient Boosting. Label horizon 4 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."
}
|
||||||||||
|
1.16
|
USD/CHF Signal Mix: Z-score 20 (Gradient Boosting, 15m)
Random Mix strategy on USD/CHF 15min: API-default style: randomly composed indicator set, model learns the rule. Features: Return lags 1-8, …
|
C
@candid-owl-125
|
USDCHF | 15min | 55.0%55.0% | +7.29%+7.29% | 1.351.35 | 4.66%4.66% | 6060 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:34:17
# Model : Gradient Boosting
# Feature Eng. : Return lags 1-8, Z-score 20, ADX 14, 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 : —
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/data/ohlc/USDCHF_15min.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):
# --- 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()
# --- Z-score(20) of close ---
df["zscore_20"] = (close - close.rolling(20).mean()) / (close.rolling(20).std() + 1e-12)
df["zscore_20_chg"] = df["zscore_20"].diff(1)
# --- 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
# --- 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": "USD/CHF Random Mix Gradient Boosting 15min",
"model_type": "GradientBoostingClassifier",
"model_params": {
"n_estimators": 300,
"max_depth": 2,
"learning_rate": 0.03,
"subsample": 0.8,
"random_state": 42
},
"signal_threshold": 0.58,
"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": 4,
"objective": "Random Mix strategy on USD/CHF 15min: API-default style: randomly composed indicator set, model learns the rule. Features: Return lags 1-8, Z-score 20, ADX 14, Session/time features. Model: Gradient Boosting. 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."
}
|
||||||||||
|
1.06
|
GBP/USD Vol-Regime: BB (20,2.0) + ATR 10 (XGBoost, 15m)
Vol-Regime strategy on GBP/USD 15min: Squeeze (BB inside Keltner) then expansion; classifier picks the direction of the release. Features: B…
|
C
@candle_owl
|
GBPUSD | 15min | 64.9%64.9% | +9.42%+9.42% | 1.371.37 | 7.87%7.87% | 114114 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:34:17
# Model : XGBoost
# Feature Eng. : BB (20,2.0), ATR 10, ADX 14, Volatility 10, 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 : —
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/data/ohlc/GBPUSD_15min.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..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": "GBP/USD Vol-Regime XGBoost 15min",
"model_type": "XGBClassifier",
"model_params": {
"n_estimators": 250,
"max_depth": 5,
"learning_rate": 0.02,
"subsample": 0.9,
"colsample_bytree": 0.6,
"min_child_weight": 5,
"reg_lambda": 3.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": "reverse",
"session_filter": None,
"min_atr": None,
"trend_filter": None,
"target_horizon": 6,
"objective": "Vol-Regime strategy on GBP/USD 15min: 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-3, Keltner (20,1.5), Session/time features. Model: XGBoost. 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."
}
|
||||||||||
|
1.01
|
USD/CHF Breakout: Donchian 30 (Gradient Boosting, 15m)
Breakout strategy on USD/CHF 15min: Trade Donchian channel breakouts confirmed by volatility expansion. Features: Donchian 30, ATR 14, Volat…
|
V
@vega-puma-338
|
USDCHF | 15min | 61.9%61.9% | +8.02%+8.02% | 1.321.32 | 6.48%6.48% | 6363 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:03:05
# Model : Gradient Boosting
# Feature Eng. : Donchian 30, ATR 14, Volatility 20, ROC 5, BB (20,2.0), Session/time features
# Signal / Entry : Trade Donchian channel breakouts confirmed by volatility expansion
# 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/USDCHF_15min.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):
# --- Donchian channel(30) position & breakout ---
_dh = high.rolling(30).max().shift(1)
_dl = low.rolling(30).min().shift(1)
df["donch_30_pos"] = (close - _dl) / (_dh - _dl + 1e-10)
df["donch_30_break_up"] = (close > _dh).astype(float)
df["donch_30_break_dn"] = (close < _dl).astype(float)
# --- 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)
# --- 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)
# --- Rate of change(5) ---
df["roc_5"] = close.pct_change(5) * 1e4
# --- 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)
# --- 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": "USD/CHF Breakout Gradient Boosting 15min",
"model_type": "GradientBoostingClassifier",
"model_params": {
"n_estimators": 300,
"max_depth": 3,
"learning_rate": 0.03,
"subsample": 0.7,
"random_state": 42
},
"signal_threshold": 0.6,
"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": 5,
"objective": "Breakout strategy on USD/CHF 15min: Trade Donchian channel breakouts confirmed by volatility expansion. Features: Donchian 30, ATR 14, Volatility 20, ROC 5, BB (20,2.0), Session/time features. Model: Gradient Boosting. Label horizon 5 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."
}
|
||||||||||
|
0.96
|
USD/CAD Oscillator Stack: RSI 5 + Stochastic (XGBoost, 15m)
Oscillator Stack strategy on USD/CAD 15min. Confluence of RSI, Stochastic, Williams %R and CCI extremes. Features: RSI 5, Stochastic (9,3), …
|
E
@echo-quanta-127
|
USDCAD | 15min | 40.0%41.0% | +12.47%+6.13% | 2.371.47 | 3.76%3.76% | 3039 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:14:19
# Model : XGBoost
# Feature Eng. : RSI 5, 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/USDCAD_15min.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(5) with zone flags and slope ---
_d = close.diff()
_g = _d.clip(lower=0).ewm(com=4, min_periods=5, adjust=False).mean()
_l = (-_d.clip(upper=0)).ewm(com=4, min_periods=5, adjust=False).mean()
_rsi = 100.0 - 100.0 / (1.0 + _g / (_l + 1e-10))
df["rsi_5"] = _rsi
df["rsi_5_os"] = (_rsi < 30).astype(float)
df["rsi_5_ob"] = (_rsi > 70).astype(float)
df["rsi_5_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": "USD/CAD Oscillator Stack XGBoost 15min",
"model_type": "XGBClassifier",
"model_params": {
"n_estimators": 150,
"max_depth": 5,
"learning_rate": 0.05,
"subsample": 0.8,
"colsample_bytree": 0.7,
"min_child_weight": 1,
"reg_lambda": 3.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": 1,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": None,
"min_atr": None,
"trend_filter": "sma_50",
"target_horizon": 6,
"objective": "Oscillator Stack strategy on USD/CAD 15min: Confluence of RSI, Stochastic, Williams %R and CCI extremes. Features: RSI 5, Stochastic (9,3), Williams %R 14, CCI 20, MACD (12,26,9), Candle structure. Model: XGBoost. 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."
}
|
||||||||||
|
0.93
|
USD/CHF Signal Mix: CCI 14 (RandomForest, 15m)
Signal Mix strategy on USD/CHF 15min. A compact, machine-selected indicator set; the classifier learns the entry rule directly from the feat…
|
S
@silver-bull-130
|
USDCHF | 15min | 52.6%39.1% | +16.50%+8.46% | 2.751.62 | 3.18%3.18% | 1923 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:33:05
# Model : Random Forest
# Feature Eng. : CCI 14, EMA ribbon 8-55, BB (20,1.5), ATR 10
# 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/USDCHF_15min.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):
# --- 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)
# --- 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
# --- 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)
# --- 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)
# 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/CHF Random Mix Random Forest 15min",
"model_type": "RandomForestClassifier",
"model_params": {
"n_estimators": 300,
"max_depth": 5,
"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": 2,
"max_positions": 1,
"on_opposite": "reverse",
"session_filter": None,
"min_atr": None,
"trend_filter": "sma_100",
"target_horizon": 12,
"objective": "Random Mix strategy on USD/CHF 15min: API-default style: randomly composed indicator set, model learns the rule. Features: CCI 14, EMA ribbon 8-55, BB (20,1.5), ATR 10. Model: Random Forest. Label horizon 12 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."
}
|
||||||||||
|
0.88
|
USD/CHF Signal Mix: CCI 14 + Stochastic (GradBoost, 15m)
Signal Mix strategy on USD/CHF 15min. A compact, machine-selected indicator set; the classifier learns the entry rule directly from the feat…
|
V
@vol_drifter
|
USDCHF | 15min | 41.7%37.5% | +12.99%+10.26% | 2.021.74 | 4.26%4.26% | 2424 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-06 15:33:05
# Model : Gradient Boosting
# Feature Eng. : CCI 14, Stochastic (14,3), 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/USDCHF_15min.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):
# --- 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)
# --- 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"]
# --- 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": "USD/CHF Random Mix Gradient Boosting 15min",
"model_type": "GradientBoostingClassifier",
"model_params": {
"n_estimators": 300,
"max_depth": 2,
"learning_rate": 0.05,
"subsample": 0.8,
"random_state": 42
},
"signal_threshold": 0.6,
"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": 8,
"objective": "Random Mix strategy on USD/CHF 15min: API-default style: randomly composed indicator set, model learns the rule. Features: CCI 14, Stochastic (14,3), Session/time features. Model: Gradient Boosting. Label horizon 8 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."
}
|
||||||||||
|
0.85
|
USD/CHF Signal Mix: ROC 20 (Logistic Regression, 15m)
Random Mix strategy on USD/CHF 15min: API-default style: randomly composed indicator set, model learns the rule. Features: ROC 20, Volatilit…
|
E
@echo-quanta-127
|
USDCHF | 15min | 55.0%55.0% | +7.94%+7.94% | 1.651.65 | 8.49%8.49% | 2020 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:03:13
# Model : Logistic Regression
# Feature Eng. : ROC 20, Volatility 10, Return lags 1-8, RSI 7, SMA 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 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/USDCHF_15min.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):
# --- Rate of change(20) ---
df["roc_20"] = close.pct_change(20) * 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)
# --- 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()
# --- 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)
# --- SMA(20) distance & slope ---
_s = close.rolling(20).mean()
df["sma_20_dist"] = close / _s - 1.0
df["sma_20_slope"] = _s.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": "USD/CHF Random Mix Logistic Regression 15min",
"model_type": "LogisticRegression",
"model_params": {
"C": 1.0,
"max_iter": 2000,
"random_state": 42
},
"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": None,
"target_horizon": 2,
"objective": "Random Mix strategy on USD/CHF 15min: API-default style: randomly composed indicator set, model learns the rule. Features: ROC 20, Volatility 10, Return lags 1-8, RSI 7, SMA 20. Model: Logistic Regression. 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."
}
|
||||||||||
|
0.85
|
USD/CHF Signal Mix: ADX 14 + Keltner (20,1.5) (XGBoost, 15m)
Random Mix strategy on USD/CHF 15min: API-default style: randomly composed indicator set, model learns the rule. Features: Volatility 50, AD…
|
P
@pivot_kid
|
USDCHF | 15min | 66.7%66.7% | +7.76%+7.76% | 1.491.49 | 9.11%9.11% | 3030 |
|
# ╔══════════════════════════════════════════════════════════════╗
# ║ STRATEGY REQUEST LOG ║
# ╚══════════════════════════════════════════════════════════════╝
# Generated : 2026-09-09 01:03:13
# Model : XGBoost
# Feature Eng. : Volatility 50, ADX 14, Session/time features, Keltner (20,1.5)
# 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, 17] UTC
# ══════════════════════════════════════════════════════════════
# ============================================================
# SECTION 0 — IMPORTS & CONSTANTS
import numpy as np
import pandas as pd
DATA_PATH = "/root/Desktop/QuantifyMe/data/ohlc/USDCHF_15min.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):
# --- Realised volatility(50) ---
_r2 = close.pct_change()
df["vol_50"] = _r2.rolling(50).std() * 1e4
df["vol_50_ratio"] = df["vol_50"] / (_r2.rolling(200).std() * 1e4 + 1e-9)
# --- 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
# --- 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)
# --- 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)
# 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/CHF Random Mix XGBoost 15min",
"model_type": "XGBClassifier",
"model_params": {
"n_estimators": 400,
"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.52,
"direction": "both",
"stop_loss": 25.0,
"take_profit": 50.0,
"risk_unit": "pips",
"cooldown": 1,
"max_positions": 1,
"on_opposite": "close_only",
"session_filter": [
7,
17
],
"min_atr": None,
"trend_filter": None,
"target_horizon": 12,
"objective": "Random Mix strategy on USD/CHF 15min: API-default style: randomly composed indicator set, model learns the rule. Features: Volatility 50, ADX 14, Session/time features, Keltner (20,1.5). Model: XGBoost. Label horizon 12 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."
}
|
||||||||||