Risk Taker
- Эксперты
- Версия: 3.0
- Активации: 5
Risk Taker is an automated gold trading robot for MetaTrader 5. It follows the main trend, waits for a pullback, and enters only after the move resumes. One trade idea is managed with a protective stop and three profit targets.
At a glance
- Market: Gold (tested on XM GOLD#)
- Chart: M15; the robot also reads H1 and H4 internally
- Direction: Both buy and sell
- Entry style: Trend-following pullback, confirmed on completed candles
- Exit plan: Three targets at 1R, 2R and 5R; break-even requested after the first target
- Planned risk: 5% of equity per complete trade group by default, adjustable
- Exposure: One trade group at a time
- No grid, martingale or averaging into losing trades
How Risk Taker works
First, the H4 chart establishes the direction using EMA 50/200 and an ADX trend-strength filter. Next, the H1 chart looks for a pullback and requires price to close back in the trend direction. Finally, a completed M15 candle provides EMA and RSI confirmation before a stop entry is placed. If the setup expires, the spread is too wide, or the required stop and lot size do not fit broker rules, the robot skips the entry.
The protective stop is based on recent price structure and market volatility. A hedging account uses up to three separate positions, each with a different target. The code also has a netting mode using one position and partial exits; the historical results shown here were produced on a hedging account. After target 1 closes, the robot requests break-even protection for the remaining exposure when broker rules allow it. Friday entries stop at 18:00, and Friday exposure closure starts at 22:00, both in broker/server time.
Risk and trade management
The default 5% is the planned risk for the entire trade group, divided across its target parts. It is not 5% for each part. Lot sizes are calculated from the stop distance and rounded down to the broker's permitted volume step. Five percent is a high-risk setting. Price gaps, slippage and transaction costs can make the actual loss larger than planned. You can lower TotalRiskPercent, but the published test figures will no longer represent your changed settings.
Historical Strategy Tester result
The highest-profit recorded window for this exact compiled 5% edition was 29 September 2025 to 29 September 2026 (end date excluded). MT5 Strategy Tester, XMGlobal-MT5 5, GOLD#, M15 chart, H4/H1 data read internally, USD 10,000 initial deposit, 1:1000 leverage, every tick based on real ticks, 200 ms execution delay:
- Net profit: USD 8,170.54
- Profit factor: 1.73
- Maximum equity drawdown: USD 4,123.68 (33.00%)
- 36 entry groups / 108 individual trades
Results were not positive in every period. The same settings lost USD 993.44 from 1 January to 29 September 2025 and USD 1,114.57 in 2024, with each separate test reset to a USD 10,000 deposit. These are backtests, not live account results. The featured tester journal reported missing or discarded real-tick minutes despite the summary showing “100% real ticks.” Reported commission, swap and fees were zero; actual costs and execution can change results. Historical performance does not predict future performance.
Getting started
1. Open your broker's gold symbol on an M15 chart in MetaTrader 5. GOLD# was used in the featured test; other symbols and brokers require their own test.
2. Download the Market demo and test it in Strategy Tester with your broker's spread, contract size and trading hours.
3. Check the risk setting and broker/server time. Consider a lower risk setting if 5% per group is too large for your account.
4. Enable live account orders only when you intend to trade. EnableTrading defaults to false outside Strategy Tester; set it to true and enable Algo Trading in MT5 after reviewing the inputs. The default setting still allows Strategy Tester runs.
5. Keep MT5 running while the robot manages trades; use a VPS if you need uninterrupted operation.
Input parameters
Core controls
- EnableTrading: Authorizes new account orders outside Strategy Tester; false by default.
- TradingEnabled: General switch for new entries in all environments.
- TotalRiskPercent: Planned equity risk for one complete trade group; default 5.00.
- PositionsPerEntry: Number of target parts; default 3.
- MaximumTradeGroups: Maximum simultaneous groups; default 1.
- TP1Multiplier / TP2Multiplier / TP3Multiplier: Target distances measured in units of initial risk; defaults 1R / 2R / 5R.
- BreakEvenOffsetPoints: Optional offset for the break-even stop after TP1.
- MaximumSpreadRiskPercent: Blocks entries when spread is too large relative to the planned stop risk.
Entry filters and timing
- TrendTimeframe / SetupTimeframe / EntryTimeframe: Trend, pullback and entry periods; defaults H4 / H1 / M15.
- RequireH1Resumption: Requires an H1 close back beyond the fast EMA in the trend direction.
- UseTrendStrengthFilter / TrendADXPeriod / MinimumTrendADX: H4 strength filter; defaults enabled / 14 / 20.
- TrendFastEMA / TrendSlowEMA: H4 trend EMA periods; defaults 50 / 200.
- PullbackFastEMA / PullbackSlowEMA: H1 pullback EMA periods; defaults 20 / 50.
- EntryFastEMA / EntrySlowEMA: M15 confirmation EMA periods; defaults 20 / 50.
- RSIPeriod / ATRPeriod: RSI and volatility periods; defaults 14 / 14.
- PullbackNearATR / PullbackInvalidATR: Pullback proximity and invalidation distances relative to volatility.
- EntryBufferATR / StopBufferATR: Entry and stop buffers relative to volatility.
- SwingLookback: Bars examined for the protective swing; default 5.
- SetupExpiryH1Bars / PendingExpiryM15Bars: Age limits for setup and pending order; defaults 4 / 2.
- MinimumStopATR / MaximumStopATR: Acceptable stop-distance range relative to volatility; defaults 0.50 / 2.00.
- CooldownM15Bars: M15 bars to wait after a group finishes; default 4.
Protection and advanced controls
- AvoidWeekendGap / FridayEntryCutoffHour / FridayFlatHour: Friday controls in broker time; defaults enabled / 18 / 22.
- LockRunnerAfterTP2 / RunnerLockedR: Optional extra stop adjustment after TP2; disabled in the tested configuration.
- MaximumDeviationPoints: Requested maximum execution deviation; default 20 points.
- MagicNumber: Separates this robot's orders from those of other robots.
- RunLabel / ExportDiagnostics: Test label and optional diagnostic export controls.
Please test the demo and read the drawdown figure before buying or trading. Gold trading on margin can result in substantial losses.
