Twelve Candle Session
- Experts
-
Yafi Maulana Hakim
Ciao, sono Yafi — Trader algoritmico e sviluppatore di sistemi di trading.
Creo Expert Advisor, indicatori personalizzati e strumenti di gestione con logica chiara, controllo reale del rischio e performance stabile. - Versione: 1.30
- Attivazioni: 10
12Candle – Automated H1 Momentum Expert Advisor for Gold (XAUUSD)
12Candle is a rule-based Expert Advisor designed for trading Gold (XAUUSD) on the H1 timeframe. Instead of relying on complex lagging indicators, the EA measures short-term directional pressure by counting bullish and bearish candles over a configurable lookback window and manages trades using a disciplined, time-based exit mechanism during active market sessions.
Key Advantages & Features
-
Pure Price-Action Momentum Logic: Scans the last 12 completed H1 candles (adjustable) to detect strong bullish or bearish candle dominance before entering a position.
-
Disciplined Time-Based Exits: Automatically closes open trades after a predefined number of H1 candles (default: 4 bars, averaging ~4 hours per trade), helping limit prolonged exposure to sudden market reversals.
-
No Grid, Martingale, or Averaging: Trades with a single fixed lot size per signal without multiplying lot sizes after losses.
-
Session Time Filtering: Restricts new trade entries to high-liquidity trading hours (configured by default to cover the London and New York session overlap) while supporting cross-midnight time windows.
-
Optional SL/TP & Trend Filter: Supports optional fixed Stop Loss and Take Profit levels in pips alongside an extra lookback open-price confirmation filter.
-
Built-In Broker Safety Protections: Automatically verifies account free margin, aligns order volume with your broker's minimum lot step ( SYMBOL_VOLUME_MIN ), and isolates trades using a dedicated Magic Number.
Strategy Tester & Setup Reference
-
Primary Symbol & Timeframe: XAUUSD on H1
-
Tested Broker Environment: OANDA Global Markets
-
Backtest Period: January 1, 2023 – November 26, 2026 (99% tick history quality, 23,083 H1 bars)
-
Backtest Summary (0.01 Fixed Lot, Profit in Pips Mode): 1,388 total trades, 51.22% win rate, 1.32 Profit Factor, 3.21 Sharpe Ratio, 4.96 Recovery Factor, and 15.81% maximal equity drawdown. (Historical backtest results reflect past market conditions and do not ensure identical future performance.)
-
Timezone Setup Note: Time filters are referenced to WIB (UTC+7). Adjust InpServerToWIB_Hours to match your broker's server timezone offset relative to UTC+7 (for example, set to 5 for a UTC+2 server).
Input Parameters
Lot & Risk Settings
-
InpLotSize (default: 0.01 ) — Fixed trading volume (in lots) used for each new market order.
-
InpAutoAdjustMinLot (default: true ) — Automatically adjusts the order volume to the broker's minimum allowed lot size if InpLotSize is below the symbol's minimum requirement.
-
InpStopLossPips (default: 0 ) — Optional hard Stop Loss distance in pips ( 0 disables fixed pip Stop Loss and relies on the candle-count exit).
-
InpTakeProfitPips (default: 0 ) — Optional hard Take Profit distance in pips ( 0 disables fixed pip Take Profit and relies on the candle-count exit).
-
InpMagicNumber (default: 20261127 ) — Unique identifier assigned to orders opened by this EA so it manages only its own positions.
Signal Rules (H1)
-
InpLookbackCandles (default: 12 ) — Number of completed H1 candles evaluated to measure directional momentum.
-
InpMinBullBearCandles (default: 8 ) — Minimum number of bullish (for Buy) or bearish (for Sell) candles required within the lookback window to trigger a trade signal.
-
InpHoldCandles (default: 4 ) — Number of H1 candles a position remains open before being closed automatically.
-
InpCompareWithOpen12 (default: false ) — Enables an additional price confirmation filter that compares the current price with the open price of the candle at the start of the lookback window.
Time Settings (WIB / UTC+7)
-
InpServerToWIB_Hours (default: 5 ) — Hour offset added to your broker's server time to convert it to WIB (UTC+7).
-
InpStartHourWIB (default: 16 ) — Start hour (0–23, in WIB) when the EA begins scanning for new entry signals.
-
InpStartMinWIB (default: 0 ) — Start minute (0–59, in WIB) of the active trading window.
-
InpEndHourWIB (default: 1 ) — End hour (0–23, in WIB) after which the EA stops opening new trades (supports overnight sessions such as 16:00 to 01:00 WIB).
-
InpEndMinWIB (default: 0 ) — End minute (0–59, in WIB) of the active trading window.
