Pullback EA xau
- Experts
- Version: 2.0
EA description (short, clear, market-ready)
EA_XAU_Fibo_M15_FINAL_TTP_MODERN_v2_00 is a rule-based XAUUSD (gold) pullback EA for the M15 chart that specifically targets pullbacks to a defined Fibonacci zone (0.500–0.667, optionally close to 0.618) – but only if the parent trend filter on H1 confirms a clear direction.
The EA combines structure (swing range + Fib retracement) with trend bias (EMA20/50, RSI and optional MACD) and uses modern, broker-safe execution and risk management: stop/freeze level security, filling fallback (RETURN→IOC→FOK), real SL risk sizing with hard caps and optional USD hard loss cap per trade. By default, trades are only evaluated on new M15 bars.
Strategy logic
1) Market and setup recognition (M15)
Determines a relevant swing high/low range using swing bars.
Calculates the Fibonacci retracement zone from this:
Default: 0.500 to 0.667
Optional: additional proximity to 0.618 (with tolerance in points)
2) Direction specification (H1 bias)
Trade direction is only approved if H1 bias is met:
EMA20/EMA50 trend alignment
RSI thresholds (bull ≥ 52 / bear ≤ 48)
Optional MACD confirmation (Main > 0 / < 0)
3) Volatility filter (ATR)
ATR(M15) must be within a minimum range (e.g. MinATRPoints) to avoid ‘dead’ phases.
SL/TP are based on ATR multipliers.
Order, risk and money management
Real risk sizing (based on actual SL distance)
Lot size is calculated so that the risk (as a percentage of equity) matches the actual SL distance.
Hard cap: risk is never increased above InpMaxRiskPct.
Lot hard cap: maximum lot size limited (e.g. 0.13).
Optional: USD hard loss cap
When activated, the maximum loss budget per trade is limited in USD (e.g. 20 USD).
Broker-safe execution
Stop/freeze level safe: SL/TP are adjusted to minimum distances if necessary.
Filling fallback: RETURN → IOC → FOK to compensate for broker restrictions.
Trade management after entry
Break-even (BE+)
From a defined profit percentage (e.g. 0.25%), SL is moved to entry + offset (BE+).
Trailing after BE
Optional trailing only after BE trigger:
ATR trailing or
M30 Wick trailing (with ATR buffer, minimum buffer, optional trend candle filter)
Runner mode
TP can be deactivated (TP=0) to enable a runner trade.
Safety & limits
MaxTradesPerDay limits daily activity.
Re-entry cooldown after exit (bar-based) to avoid re-overtrading.
Portfolio gates/master gates (global variables):
MASTER_RISK_STATUS
MASTER_CLUSTER_METAL_LOCK
MASTER_PORTFOLIO_FULL
Target group/use
The EA is intended for traders who want to trade structured pullbacks in the direction of the trend, with professional execution security and clear portfolio protection mechanisms – especially for live trading (VPS/prop firm environment).
EA_XAU_Fibo_M15_FINAL_TTP_MODERN_v2_00 is a rule-based XAUUSD (gold) pullback EA for the M15 chart that specifically targets pullbacks to a defined Fibonacci zone (0.500–0.667, optionally close to 0.618) – but only if the parent trend filter on H1 confirms a clear direction.
The EA combines structure (swing range + Fib retracement) with trend bias (EMA20/50, RSI and optional MACD) and uses modern, broker-safe execution and risk management: stop/freeze level security, filling fallback (RETURN→IOC→FOK), real SL risk sizing with hard caps and optional USD hard loss cap per trade. By default, trades are only evaluated on new M15 bars.
Strategy logic
1) Market and setup recognition (M15)
Determines a relevant swing high/low range using swing bars.
Calculates the Fibonacci retracement zone from this:
Default: 0.500 to 0.667
Optional: additional proximity to 0.618 (with tolerance in points)
2) Direction specification (H1 bias)
Trade direction is only approved if H1 bias is met:
EMA20/EMA50 trend alignment
RSI thresholds (bull ≥ 52 / bear ≤ 48)
Optional MACD confirmation (Main > 0 / < 0)
3) Volatility filter (ATR)
ATR(M15) must be within a minimum range (e.g. MinATRPoints) to avoid ‘dead’ phases.
SL/TP are based on ATR multipliers.
Order, risk and money management
Real risk sizing (based on actual SL distance)
Lot size is calculated so that the risk (as a percentage of equity) matches the actual SL distance.
Hard cap: risk is never increased above InpMaxRiskPct.
Lot hard cap: maximum lot size limited (e.g. 0.13).
Optional: USD hard loss cap
When activated, the maximum loss budget per trade is limited in USD (e.g. 20 USD).
Broker-safe execution
Stop/freeze level safe: SL/TP are adjusted to minimum distances if necessary.
Filling fallback: RETURN → IOC → FOK to compensate for broker restrictions.
Trade management after entry
Break-even (BE+)
From a defined profit percentage (e.g. 0.25%), SL is moved to entry + offset (BE+).
Trailing after BE
Optional trailing only after BE trigger:
ATR trailing or
M30 Wick trailing (with ATR buffer, minimum buffer, optional trend candle filter)
Runner mode
TP can be deactivated (TP=0) to enable a runner trade.
Safety & limits
MaxTradesPerDay limits daily activity.
Re-entry cooldown after exit (bar-based) to avoid re-overtrading.
Portfolio gates/master gates (global variables):
MASTER_RISK_STATUS
MASTER_CLUSTER_METAL_LOCK
MASTER_PORTFOLIO_FULL
Target group/use
The EA is intended for traders who want to trade structured pullbacks in the direction of the trend, with professional execution security and clear portfolio protection mechanisms – especially for live trading (VPS/prop firm environment).
