
The Gold Reaper MT5 5.1: automatic lots on XAUUSD, Jan–Oct 2026
Historical backtest: +396.90%. Take a closer look at Gold Reaper’s gold scalping and automatic lot sizing.

Historical backtest: +396.90%. Take a closer look at Gold Reaper’s gold scalping and automatic lot sizing.
With the source in your hands, your ideas can go further than the settings panel.
Open your source in MetaEditor and start building. Projects use self-contained code or the standard libraries already included with MT5.
Study, customise and trade on your own accounts. Your EA source gives you the freedom to keep refining your ideas.
One purchase per source project. MQLume does not charge by the number of activations or uses.
Bring your ideas to an AI coding assistant. Use the editable MQL5 project as your starting point, and stay in control of every change.
Ask for a session filter, clearer logging or a different risk rule.
Read the proposed code, check the logic and compile it in MetaEditor.
Compare backtests, then test on a demo account before considering live use.
Use an AI tool of your choice; no AI subscription is included. Review generated code and keep your source private. Better tools support your process, but do not guarantee trading profits.
Overview
The Gold Reaper trades breaks of significant support and resistance on XAUUSD. It uses several confirmation rules and internal strategies across multiple timeframes. Trade frequency ranges from conservative to very active; the automatic mode selects frequency and volume using the account size and chosen drawdown setting.
Trades use Stop Loss and Take Profit protection, with moving stop and target management as a position develops. The strategy is a breakout system rather than a grid or martingale approach.
Attach it to XAUUSD, choose automatic or manual trade frequency, and configure the preferred drawdown and volume settings. Use H1 with a minimum account balance reference of USD 600. These are setup references, not a guaranteed loss limit or account suitability assessment.
Test XAUUSD with the default settings, changing the drawdown input or manually comparing frequency levels. The tester's chart timeframe does not determine the internal strategy timeframes. Fixed StartLots requires a manually chosen trade frequency as well.
Select fixed volume through StartLots or sizing based on the allowed-drawdown configuration. StartLots also acts as the minimum volume under the other sizing methods. Automatic sizing uses the strategy's historical drawdown reference; its setting is not a forecast of future maximum loss.
Daily drawdown protection can close trades and pending orders and suspend trading until the next day. Equity can be used instead of balance for sizing. OnlyUp prevents volume from decreasing after losses, making that choice more aggressive.
EnableNFP_Filter controls the NFP restriction. Separate settings determine whether positions and pending orders are closed before the event and how long entries remain paused afterward. Broker winter and summer GMT offsets can be supplied manually, including during backtests.
The automatic GMT function requires worldtimeserver.com to be permitted in MT5's Expert Advisors WebRequest settings. Use the configuration and input definitions supplied with your edition when setting up this connection.
Explore the parametersTrading setup
Editable MQL5 source for a gold breakout Expert Advisor. Explore nine strategy switches, position sizing, trailing stops and news controls in one source file.
Choose position sizing and account settings to suit your trading configuration.
Explore 50 lines of the project's MQL5 source. Scroll inside the editor to discover more.
int OnInit(void){ if(!ValidateUserOrderComment()) return INIT_PARAMETERS_INCORRECT; g_initialized=false; g_fatalError=false; g_interestRateNewsLatch=false; g_cpiNewsLatch=false; g_tradingSessionsLogged=false; ZeroMemory(g_strategyConfig); ZeroMemory(g_strategyState); ZeroMemory(g_positionConfig); ZeroMemory(g_positionState); ZeroMemory(g_dispatchClock); ZeroMemory(g_brokerTime); ZeroMemory(g_dailyDrawdown); ZeroMemory(g_tradeCaches); ZeroMemory(g_startupValues); ZeroMemory(g_dashboard); ArrayInitialize(g_strategyLots,0.0); ArrayInitialize(g_strategySwingHigh,0.0); ArrayInitialize(g_strategySwingLow,0.0); ArrayInitialize(g_strategyProfit,0.0); ArrayInitialize(g_averageTradeProfit,0.0); ArrayInitialize(g_closedTradeCount,0); for(int i=0;i<9;i++)g_strategyEnabled[i]=(i<3); // Configure synchronous requests before loading any strategy. g_tradeExecutor.SetExpertMagicNumber(0); g_tradeExecutor.SetDeviationInPoints(10); g_tradeExecutor.SetTypeFilling(ORDER_FILLING_FOK); g_tradeExecutor.SetAsyncMode(false); g_tradeExecutor.SetMarginMode(); g_strategyState.calendarRefreshEnabled=true; g_strategyState.lastNfpFetch=0; g_strategyState.previousCapital=0.0; if(!IsInitializedValidityBranchEnabled())return INIT_FAILED; InitializeTickDispatch(BacktestSpeed,g_dispatchClock); if(EnableNFP_Filter) { g_strategyState.nextNfpServer=ReadNextNfpCalendarTime(); Print("Next NFP: "+TimeToString(g_strategyState.nextNfpServer,TIME_DATE|TIME_SECONDS)); } if(EnableIR_Filter) { g_strategyState.nextIrServer=ReadNextCalendarRelease(NEWS_INTEREST_RATE); Print("Next Interest Rate decision: "+TimeToString(g_strategyState.nextIrServer,TIME_DATE|TIME_SECONDS)); } if(EnableCPI_Filter) { g_strategyState.nextCpiServer=ReadNextCalendarRelease(NEWS_CPI); Print("Next CPI: "+TimeToString(g_strategyState.nextCpiServer,TIME_DATE|TIME_SECONDS));Your next build starts here.
Complete source, practical documentation and reference files to help you understand, customise and test your EA.
100% source code means the editable implementation of this product is supplied in full. It is not an EX5-only delivery or a hidden strategy module.
Version 5.6 · Personal-use licencePARAMETERS.pdf explains the current inputs, defaults and usage. Preserve all supplied project subfolders when compiling.
MT5 input preset. Review the settings before use.
A concise welcome, installation and compilation guide, with licence terms and support details.
The compiled EA accompanying the source. Recompile after editing the MQ5.
Complete, editable single-file source. Read the logic, customise it and compile your own EA.
Explore, customise and test your EA across different market conditions. Start with the supplied guide, then build a testing routine around your own settings.
Version v5.6 · 81
Initial settings from the delivered source. Review and test changes before using them.
An optional personal suffix follows @MQLume and required strategy identifiers. Leave blank to keep the standard comment.
Read PARAMETERS.pdf alongside README.txt for the meaning, defaults and operating notes behind the short input labels.
Read the supplied parameter guide for units and interactions before changing these initial values.
| Source input key | Initial value |
|---|---|
- - -lijntje | Display text |
UseVariableValuesUseVariableValues | true |
AdjustLotsizeToVariableValuesAdjustLotsizeToVariableValues | true |
ShowInfoPanelShowInfoPanel | true |
update infopanel during testingUpdateInfoTesting | false |
Adjustment for Infopanel sizeInfoPanelSizeAdjust | 1.0 |
Force Font Size (0=disabled)SetFontSize | 0 |
Read the supplied parameter guide for units and interactions before changing these initial values.
| Source input key | Initial value |
|---|---|
- - -BacktestSpeed_string | Display text |
Backtest SpeedBacktestSpeed | normalBACKTEST_NORMAL |
Read the supplied parameter guide for units and interactions before changing these initial values.
| Source input key | Initial value |
|---|---|
- - -spreadfilter | Display text |
Allow Buy TradesAllowBuyTrades | true |
Allow Sell TradesAllowSellTrades | true |
TradeFrequencyTradeFrequency | Auto (based on balance and risk)FREQUENCY_AUTOMATIC |
Max Allowed SpreadMaxSpread | 500.0 |
UseHL_TrailingSLUseHL_TrailingSL | true |
Friday stop hour (brokertime; close all trades+pending)FridayStopHour | 25 |
delete pending ordersFridayClosePending | true |
close open tradesFridayCloseOpen | true |
setSL_TP_After_EntrysetSL_TP_After_Entry | false |
Use Virtual ExpirationVirtual_expiration | true |
Randomization (entries and exit) in pipsRandomization | 0.0 |
Fake Breakout FilterFakeOutFilter | MediumFAKEOUT_MEDIUM |
Enable Virtual SL/TP (trailing by market close)EnableVirtualSLTP | false |
Seconds before the real SL is pulled up to the virtual SL (0 =SetVSL_to_hardSL_sec_delay | 99 |
Base MagicnumberST1_MagicNumber | 8000 |
Comment for tradesST1_Comment | "@MQLume" |
RemoveCommentSuffixRemoveCommentSuffix | false |
Read the supplied parameter guide for units and interactions before changing these initial values.
| Source input key | Initial value |
|---|---|
NFP_FILTERNFP_FILTER | Display text |
EnableNFP_FilterEnableNFP_Filter | true |
UseMQL5CalendarUseMQL5Calendar | true |
AutoGMTAutoGMT | true |
GMT_OFFSET_Winter (AutoGMT=false or backtesting)Broker_GMT_OFFSET_Winter | 2 |
MT_OFFSET_Summer (AutoGMT=false or backtesting)Broker_GMT_OFFSET_Summer | 3 |
NFP_CloseOpenTradesNFP_CloseOpenTrades | true |
NFP_ClosePendingOrdersNFP_ClosePendingOrders | true |
NFP_MinutesBeforeNFP_MinutesBefore | 100 |
NFP_MinutesAfterNFP_MinutesAfter | 60 |
Read the supplied parameter guide for units and interactions before changing these initial values.
| Source input key | Initial value |
|---|---|
- - -IR_FILTER | Display text |
EnableIR_FilterEnableIR_Filter | false |
IR_CloseOpenTradesIR_CloseOpenTrades | true |
IR_ClosePendingOrdersIR_ClosePendingOrders | true |
IR_MinutesBeforeIR_MinutesBefore | 100 |
IR_MinutesAfterIR_MinutesAfter | 60 |
Read the supplied parameter guide for units and interactions before changing these initial values.
| Source input key | Initial value |
|---|---|
- - -CPI_FILTER | Display text |
EnableCPI_FilterEnableCPI_Filter | false |
CPI_CloseOpenTradesCPI_CloseOpenTrades | true |
CPI_ClosePendingOrdersCPI_ClosePendingOrders | true |
CPI_MinutesBeforeCPI_MinutesBefore | 100 |
CPI_MinutesAfterCPI_MinutesAfter | 60 |
Read the supplied parameter guide for units and interactions before changing these initial values.
| Source input key | Initial value |
|---|---|
- - -propfirmsettings | Display text |
AdjustEntryAdjustEntry | 0.0 |
AdjustSLAdjustSL | 0.0 |
AdjustTPAdjustTP | 0.0 |
AdjustTrailSLAdjustTrailSL | 0.0 |
AdjustTrailTPAdjustTrailTP | 0.0 |
AdjustBreakEvenAdjustBreakEven | 0.0 |
Read the supplied parameter guide for units and interactions before changing these initial values.
| Source input key | Initial value |
|---|---|
- - -LotSizeSettings | Display text |
manually set balance to use (if > 0)ManualBalance | 0.0 |
Lotsize calculation methodRisk | Max Allowed Total DrawdownLOTS_TOTAL_DRAWDOWN |
StartLotsStartLots | 0.01 |
Max Allowed TOTAL DrawdownMaxAllowedDD | 30.0 |
Weighted LotsizeUseWeightedLots | true |
Max Risk Per StratMaxRiskPerStrategy_ | 1.0 |
Set Max DAILY Drawdown (Prop Firms)PropFirmMaxDailyDD | 0.0 |
OnlyUpOnlyUp | true |
Reset Highest Balance for OnlyUpResetHighestBalance | false |
Reset Highest Balance on a withdrawalResetHighestBalanceOnWithdrawal | true |
CheckMarginCheckMargin | true |
Use Equity Instead of BalanceUseEquity | false |
Read the supplied parameter guide for units and interactions before changing these initial values.
| Source input key | Initial value |
|---|---|
- - -ManualStratSelect | Display text |
- - -ManStratWarn | Display text |
Run Strategy 1 (low risk)RunStrat1 | true |
Run Strategy 2 (low risk)RunStrat2 | true |
Run Strategy 3 (low risk)RunStrat3 | true |
Run Strategy 4 (med risk)RunStrat4 | true |
Run Strategy 5 (med risk)RunStrat5 | true |
Run Strategy 6 (med risk)RunStrat6 | true |
Run Strategy 7 (med risk)RunStrat7 | true |
Run Strategy 8 (high risk)RunStrat8 | true |
Run Strategy 9 (high risk)RunStrat9 | true |
An optional personal suffix follows @MQLume and required strategy identifiers. Leave blank to keep the standard comment.
| Source input key | Initial value |
|---|---|
Custom text (up to 18 characters)UserComment |
Support after delivery
While the product is actively maintained, we investigate and fix reproducible defects in the delivered, unmodified code that conflict with the product description.
Missing files, incorrect delivery and original-code compilation failures in the stated environment.
Provide the release, settings, logs and reproduction steps so we can assess and resolve the issue.
Start with the included guide and contact us for help with delivery or reproducible software defects. Trading results are not guaranteed.
You may read, modify and compile the delivered source for your own research and trading accounts. Keep a backup of the original delivery before making changes. You may not resell, redistribute, publish or sublicense the source or compiled files, or offer them as a white-label product, without separate written permission. Source delivery does not transfer copyright or ownership of third-party names.
Source code is a copyable digital product. Once delivered, we do not accept change-of-mind refunds, including because you no longer need the product. Check compatibility, contents and disclosed limits before ordering.
After payment is verified, we deliver the source package and documentation to your order email. Check your inbox and spam folder. Keep your order reference for delivery and support questions. Include your order reference, source release, terminal build, settings, expected behaviour and steps to reproduce. Attach only relevant logs and remove account credentials.
Read the files, environment and terms
Check the source version and purchase terms
Payment is checked with the provider or on the selected blockchain
Fast, automatic delivery after payment confirmation. No waiting for manual dispatch.
Ask us about advanced custom development. Share your requirements through private support or email; we will discuss the scope and quote separately.
100% committed to following up on your delivery and support requests.
Explore free EA source code




Free editable gold breakout project with six independently selectable cores, session filters and flexible position sizing.

Free editable source with compiled EX5: four gold breakout engines with independent profiles, sizing, direction and exits.

Trend-based entries with optional grid additions, side controls and virtual exits.

RSI entries with two ATR filters, configurable sessions and optional grid management.
Learn the difference: MQL4 / MQL5 source uses .mq4 / .mq5; EX4 / EX5 files are compiled programs. Buying an EX4 or EX5 file does not automatically include source code.
Two original, non-trading learning samples for MT4 and MT5. Inspect OnInit and OnDeinit logging without order execution.
Learning samples only. Review and compile them in MetaEditor before use; these samples do not place trades.
Ready for another approach? Choose an EA to run, or source code to explore and customise.


Source code · MQ5 + EX5
Build on a gold price-zone strategy with model filters, recovery orders, basket management and trailing exits.


Free EA · MQ5 + EX5
Trend-based entries with optional grid additions, side controls and virtual exits.
Loading…
Stay close to MQLume, wherever you like to learn.
See our EAs in action. Explore backtests, walkthroughs and practical guides.
Watch on YouTubeMeet other EA users, share ideas and keep up with what’s new.
Join the community Follow official updates