Gold Strata M5
- Experts
-
Morito Chinen
BB Quant Lab
Algorithmic trading research and EA development focused on quantitative systems for MetaTrader 5.
Developer of Relief Wave XAUUSD. - Versão: 1.7
- Ativações: 20
Two market structures, one unified risk framework.
Gold Strata M5 is a MetaTrader 5 Expert Advisor designed for XAUUSD / GOLD and operates using M5 as its internal signal timeframe. In bullish market conditions, it identifies breakouts followed by valid retests. In bearish conditions, it looks for failed pullbacks within established downtrends. The Long and Short strategies are not simple mirror images; each uses its own independent entry conditions.
All entry decisions are based exclusively on completed candles. Every position is opened with a Stop Loss and Take Profit, while trade volume is calculated using the estimated loss in the account currency.
Trading method
-
Instruments: XAUUSD / GOLD and Gold symbols with broker prefixes or suffixes
-
Internal signal timeframe: M5
-
Trading directions: Buy / Sell
-
Order type: Market orders
-
Strategy classification: Short- to medium-term trend following
-
Expected holding time: Several hours to several days
-
Signal basis: Completed candles only
-
Recommended account type: Hedging
-
Trading hours: No time-of-day restriction during permitted trading days
Although the EA evaluates entries on M5, it is not a pure scalping system designed to close trades within a few minutes. Long positions may remain open for up to approximately 60 hours, while Short positions may remain open for up to approximately 24 hours. The strategy is therefore classified as trend following with short-term swing-trading characteristics.
Long strategy
The Long strategy targets the first valid retest after a breakout within an established uptrend.
-
A completed M5 candle closes above the highest price of the previous 6 candles.
-
The breakout candle must meet the required minimum body-strength condition.
-
The breakout level is recorded, and the EA waits for a retest for up to 24 M5 candles.
-
Price must return near the breakout level while a completed candle continues to hold above that level.
-
A Buy order is opened only when the D1, H1 and W1 trend conditions are aligned upward.
-
Long signals are permitted on Tuesday, Thursday and Friday.
The Long Stop Loss is set at 9 times the M5 average True Range. Take Profit is set at 5 times the initial Stop Loss distance. A Long position becomes eligible for time-based closure after 720 M5 candles.
Short strategy
The Short strategy is not an inverted version of the Long strategy. It identifies failed pullbacks within an established downtrend and enters when bearish movement resumes.
-
The completed D1 close must be below EMA20, and the EMA20 slope must be negative.
-
Market conditions where D1 is stretched more than 2 ATR below EMA20 are excluded.
-
The completed H1 close must be below EMA50, EMA20 must be below EMA50, and the EMA20 slope must be negative.
-
On M5, price must first rebound by at least 0.5 ATR. A weak bearish candle must then close below the previous M5 candle’s low.
-
Short signals are permitted from Monday through Thursday.
The Short Stop Loss uses the farther of the following two levels: the highest price of the previous 4 candles plus 0.25 ATR, or 6 ATR above the entry price. Take Profit is set at 3 times the initial Stop Loss distance. A Short position becomes eligible for time-based closure after 288 M5 candles.
Position management
On Hedging accounts, each valid signal may open an independent position with its own Stop Loss and Take Profit. The EA does not use a fixed maximum number of positions. Instead, it calculates the combined initial Stop Loss risk of all open positions in the account currency and blocks new orders when the PortfolioRiskPct limit would be exceeded.
Multiple positions in the same direction may exist when independent signals occur. However, the EA never increases trade volume because an existing position is losing.
On Netting accounts, positions on the same symbol are combined. To preserve independent Stop Loss and Take Profit management, the EA limits simultaneous exposure to one position on the symbol. A Hedging account is recommended for operation that most closely matches the original research conditions.
Money management
The default settings are:
-
Target initial Stop Loss risk per trade: 0.20%
-
Maximum combined initial Stop Loss risk of open positions: 10.0%
-
Equity reserved as Free Margin: 5.0%
-
Fixed Lot: Disabled
-
Broker minimum lot: Permitted only when it remains within the risk limit
OrderCalcProfit is used to estimate the potential Stop Loss amount and convert it into the current account currency. The same risk-calculation method applies to accounts denominated in JPY, USD, EUR and other currencies.
PortfolioRiskPct is not a drawdown stop. It limits the estimated combined loss between each position’s opening price and its initial Stop Loss at the time of order submission. Actual losses and drawdown may exceed the configured value because of gaps, slippage, execution prices, commissions and swaps.
Trading methods not used
-
No Martingale
-
No Grid
-
No averaging down on losing positions
-
No lot multiplication after losses
-
No positions without a Stop Loss
-
No external DLL
-
No WebRequest
-
No external indicators
Broker compatibility
The EA obtains the following information directly from the chart symbol:
-
Minimum lot, maximum lot and volume step
-
Directional volume limits for the symbol
-
Tick Size and Digits
-
Stop Level
-
Supported trading directions and filling modes
-
Required margin and available Free Margin
-
Account currency
The symbol name is not hard-coded to XAUUSD. The EA operates on the current chart symbol and can therefore be used with names such as GOLD or XAUUSDm. However, price feeds, spreads, contract sizes, commissions, swaps, server time and historical data differ between brokers. Results may therefore vary even when the same period and settings are used.
Main input parameters
-
EnableLong: Enables or disables the Long strategy
-
EnableShort: Enables or disables the Short strategy
-
RiskPerTradePct: Target Stop Loss risk per trade
-
PortfolioRiskPct: Maximum combined initial Stop Loss risk of open positions
-
AllowMinLotIfSafe: Allows the minimum broker lot only when it remains within the risk limit
-
FixedLot: Fixed trade volume; set to 0 for automatic risk calculation
-
FreeMarginReservePct: Percentage of Equity reserved as Free Margin after a new order
-
MaxSpreadPrice: Maximum spread in Gold price units
-
MaxDeviationPrice: Maximum permitted deviation in Gold price units
-
MagicNumber: EA identification number
-
ShowDashboard: Displays operating information on the chart
Recommended test settings
-
Platform: MetaTrader 5
-
Symbol: XAUUSD / GOLD provided by the intended broker
-
Period: M5
-
Model: Every tick based on real ticks
-
Account mode: Hedging
-
Deposit, leverage and account currency: Match the intended live account
Before using the EA on a live account, run a backtest using real ticks from the intended broker. The EA should also be tested on a demo account to verify order volume, Stop Loss, Take Profit and spread conditions.
Risk notice
Backtest results are based on historical data in the MetaTrader 5 Strategy Tester and do not guarantee future profits or identical trading results. Leveraged Gold CFD trading involves a risk of losing the invested capital. Use the EA only after understanding its settings and the conditions of the trading account.
