Make the strategy your own.
With the source in your hands, your ideas can go further than the settings panel.
No extra dependencies to install
Open your source in MetaEditor and start building. Projects use self-contained code or the standard libraries already included with MT5.
Unlimited personal use
Study, customise and trade on your own accounts. Your EA source gives you the freedom to keep refining your ideas.
Pay once. No activation or usage fees.
One purchase per source project. MQLume does not charge by the number of activations or uses.
Vibe coding. Your trading judgement.
Bring your ideas to an AI coding assistant. Use the editable MQL5 project as your starting point, and stay in control of every change.
Describe your idea
Ask for a session filter, clearer logging or a different risk rule.
Review the change
Read the proposed code, check the logic and compile it in MetaEditor.
Test your version
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.
Trading setup
Stated specifications
Your next gold-trading idea starts here. Get the complete, editable MoonDog source for MT5 — free. Explore nine strategy modules, local ONNX filters and flexible trade management in one self-contained file.
These are marketplace specifications, not a guarantee of suitable capital or performance.
- Symbol
- XAUUSD
- Chart timeframe
- Any chart timeframe · strategies use their own internal periods
- Account
- Hedging account
- VPS
- Recommended for continuous operation
Inside the source
Explore 50 lines of the project's MQL5 source. Scroll inside the editor to discover more.
double MDFindPivot(const MDStrategyConfig &config,const bool buy, const double bid,const double ask,const double pipSize,const int digits, const MqlRates &bars[],const double &pendingPrices[]){ int required=config.searchDepth+2+config.olderBars; if(required<1 || ArraySize(bars)<required || !ArrayGetAsSeries(bars)) return 0.0; for(int shift=config.newerBars+1;shift<=config.searchDepth;shift++) { double pivot=buy ? bars[shift].high : bars[shift].low; if(buy ? pivot<=ask+config.minPivotDistance*pipSize : pivot>=bid-config.minPivotDistance*pipSize) continue; bool extreme=true; for(int k=shift-config.newerBars;k<=shift+config.olderBars;k++) if(buy ? bars[k].high>pivot : bars[k].low<pivot) { extreme=false; break; } if(!extreme) continue; for(int k=0;k<shift;k++) if(buy ? bars[k].high>pivot : bars[k].low<pivot) { extreme=false; break; } if(!extreme) continue; double entry=NormalizeDouble(pivot+(buy ? config.buyOffset : -config.sellOffset)*pipSize,digits); if(MDHasNearbyPending(entry,config.pendingSpacing*pipSize,pendingPrices)) continue; return NormalizeDouble(pivot,digits); } return 0.0;}bool MDPassPendingPlacementGates(const MDStrategyConfig &config,const bool buy, const double pivot,const double entry,const double pipSize, const double &pendingPrices[]){ if(MDHasNearbyPending(entry,config.pendingSpacing*pipSize,pendingPrices)) return false; int count=ArraySize(pendingPrices); if(count==config.pendingLimit && count>0) { double extreme=pendingPrices[0]; for(int i=1;i<count;i++) extreme=buy ? MathMin(extreme,pendingPrices[i]) : MathMax(extreme,pendingPrices[i]); if(buy ? extreme<pivot : pivot<extreme) return false; } for(int i=0;i<count;i++) if(buy ? pendingPrices[i]<=entry : entry<=pendingPrices[i]) return false; return true;}void MDResolvePendingExpiration(const MDStrategyConfig &config,const datetime now, const long supportedModes,const bool weekendShield, const datetime nextWeekendCutoff, const bool forcedMode,const ENUM_ORDER_TYPE_TIME cachedMode, ENUM_ORDER_TYPE_TIME &type,datetime &expiration){ type=ORDER_TIME_GTC;Overview
An EA you can make your own.
Read the logic. Shape your setup. MoonDog brings together breakout entries, MoonLock profit protection, fixed or percentage-based sizing, trading hours and news controls. Start with the five default strategies, explore the four optional modules, or work with an AI coding assistant to build and test your own changes. Both ONNX models and panel artwork are embedded; no separate model download or API subscription is needed.
Built for MetaTrader 5. A complete source project, clear inputs and practical documentation give you control over your next build.
Compile. Backtest. Demo. Then decide.
After compiling the purchased source, check its behaviour in the Strategy Tester. Test it on a demo account before deciding whether to trade live. Passing tests does not guarantee live returns.
Project specifications
- Platform
- MetaTrader 5 / MQL5; not compatible with MT4
- Version
- 4.21
- Dependencies
- One self-contained MQ5 file. Open it in MetaEditor and compile.
- Inputs
- 123 configurable inputs, with a complete parameter guide
- Build & testing
- Compile in MT5 MetaEditor; consult RELEASE_NOTES.txt for the packaged build and testing record.
Your next build starts here.
Included files
Complete source, practical documentation and reference files to help you understand, customise and test your EA.
One project.
Complete source.
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 4.21 · Personal-use licence- MQ5Included
MoonDog EA MT5 4.21[MQLume].mq5
Complete, editable single-file source. Read the logic, customise it and compile your own EA.
- EX5Included
MoonDog EA MT5 4.21[MQLume].ex5
The compiled EA accompanying the source. Recompile after editing the MQ5.
- TXTIncluded
README.txt
A concise welcome, installation and compilation guide, with licence terms and support details.
- PDFIncluded
PARAMETERS.pdf
The included PARAMETERS.pdf explains all 123 inputs, defaults and practical settings. The ZIP includes MQ5, EX5, README.txt, PARAMETERS.pdf and RELEASE_NOTES.txt. No SET preset is included.
- TXTIncluded
RELEASE_NOTES.txt
Build details, recorded test conditions, changes and known limits for the supplied package.
Testing
Build confidence through testing.
Explore, customise and test your EA across different market conditions. Start with the supplied guide, then build a testing routine around your own settings.
Compile your starting point
Open the source in MetaEditor, compile it and explore the default settings. The included guides explain installation and parameters so you can begin customising.
Test across market cycles
For a broader view of your settings, we recommend backtesting with the past 10 years of real tick data where available, followed by testing on a demo account.
Before live use
Backtest your chosen settings, then test on a demo account before deciding whether to trade live. Past results do not guarantee future performance.
Version v4.21 · 123
Parameter guide
Initial settings from the delivered source. Review and test changes before using them.
Initial values shown below come from the included source. Review the parameter guide before changing settings.
00 | QUICK SETUP: CHANGE ONLY THIS
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
SET 1 Default / SET 2 Adaptive / SET 3 All 9 / SET 4 All 9 AdapMoonQuickSetup | MDSetup_Default |
IMPORTANT | CHECK SET AGAIN AFTER EVERY EA UPDATE
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Recommended set link [check after every update]RecommendedSetLink | Display text |
01 | CHOOSE TRADING MODE
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
AI profile: Conservative [default] / More Trades / Without ONNXAiTradingMode | MDAi_Conservative |
02 | LOT SIZE & RISK
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Sizing: AUTO=BT 2% / live fixed; select another mode to overridMoonSizing | MDSizing_Auto |
Fixed lot [FIXED mode, or AUTO on live/demo charts]MoonFixedLot | 0.01 |
Risk per trade [%; CUSTOM RISK mode only]MoonCustomRiskPercent | 2.0 |
Maximum lot for % risk [0 = no cap]MaximumRiskLot | 0.0 |
Adaptive sizing [manual % risk + ONNX; not AUTO, Growth or fixeAdaptivePositionSize | MDAdaptive_Normal |
03 | STOP LOSS & PROFIT PROTECTION
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Initial stop loss [gold pips; new orders]MoonStopLossPips | 20.0 |
How to protect open-trade profitMoonProtectionMode | MDProtection_VirtualOnly |
Remember virtual protection after restartPersistVirtualTrailing | true |
Enable MoonLock profit protectionMoonLockEnabled | true |
Start MoonLock at profit per 0.01 lot [account money]MoonLockStartPer001 | 1.0 |
Choose Classic / Gradual, with or without Spike ShieldMoonLockProfile | MDLock_ClassicShield |
Classic profiles: share of peak profit to protect [%; default 5MoonLockPercent | 50.0 |
04 | CUSTOM BE & TRAILING [MOONLOCK OFF]
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Use my BE and trailing when MoonLock is OFFUseCustomBreakEvenTrailing | false |
Move to BE after this profit [gold pips]CustomBreakEvenStartPips | 10.0 |
At BE, protect this many profit pipsCustomBreakEvenLockPips | 1.0 |
Start trailing after this profit [gold pips]CustomTrailingStartPips | 20.0 |
Keep trailing this far behind price [gold pips]CustomTrailingDistancePips | 10.0 |
Move trailing only after this further improvement [gold pips]CustomTrailingStepPips | 2.0 |
05 | TAKE PROFIT TARGETS
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Moon Apex take profit [gold pips]MoonApexTargetPips | 140.0 |
Other four modules: take profit [gold pips]MoonCoreTargetPips | 150.0 |
06 | INDIVIDUAL STRATEGIES [ADVANCED CUSTOM ONLY]
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Enable Moon NovaMoonNova | true |
Enable Moon ApexMoonApex | true |
Enable Moon ZenithMoonZenith | true |
Enable Moon PulseMoonPulse | true |
Enable Moon EclipseMoonEclipse | true |
06B | ADVANCED CUSTOM ONLY
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Only when QUICK SETUP = Advanced CustomUsePerModuleTunedExits | true |
Moon Orbit add-on [M30 pivots; OFF = default]MoonAddOnA | false |
Moon Halo add-on [H1 wide pivots; OFF = default]MoonAddOnB | false |
Moon Titan add-on [H4 pivots; OFF = default]MoonAddOnC | false |
Moon Comet add-on [H1 fast pivots; OFF = default]MoonAddOnD | false |
Add-ons ON: max open positions in one direction, all modules [0MaxSameDirectionPositions | 8 |
Allow entries on NETTING accounts [V4.19 is validated on hedginAllowNettingAccount | false |
07 | MAGIC NUMBERS & EXISTING TRADES
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
MoonDog magic number [unique for each EA chart]MoonTradeIdentity | 33300 |
Manage previous magic number [0 = off]PreviousMoonTradeIdentityBase | 0 |
Manage older-format magic number [0 = off]PreviousMoonDogTradeIdentity | 0 |
08 | DAILY ENTRY HOURS
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Allow new entries only within set hoursUseTradingHours | false |
Entry start hour [broker time, 0-23]TradingStartHour | 2 |
Entry start minute [0-59]TradingStartMinute | 0 |
Entry end hour [broker time, 0-23]TradingEndHour | 19 |
Entry end minute [0-59]TradingEndMinute | 0 |
Delete pending orders outside entry hoursDeletePendingOutsideHours | false |
09 | WEEKEND ENTRY PAUSE
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Pause entries and remove pending for the weekendWeekendShieldEnabled | true |
Weekend times: automatic / customWeekendScheduleMode | MDWeekend_Automatic |
AUTO: pause minutes before Friday closeWeekendFridayCutoffMinutes | 240 |
AUTO: wait minutes after weekly reopeningWeekendReopenDelayMinutes | 240 |
AUTO fallback: Friday pause hour [broker time]WeekendFallbackFridayHour | 20 |
AUTO fallback: Monday resume hour [broker time]WeekendFallbackMondayHour | 5 |
CUSTOM: Friday pause hour [broker time]WeekendCustomFridayHour | 20 |
CUSTOM: Friday pause minuteWeekendCustomFridayMinute | 0 |
CUSTOM: Monday resume hour [broker time]WeekendCustomMondayHour | 5 |
CUSTOM: Monday resume minuteWeekendCustomMondayMinute | 0 |
10 | NFP, CPI & FOMC NEWS
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
News currency [USD for gold; both news filters]NewsCurrency | "USD" |
Enable separate NFP, CPI and FOMC protectionUseMajorEventControl | true |
Allow trading during NFP [false = pause]TradeDuringNFP | false |
NFP: pause minutes before releaseNFPMinutesBefore | 30 |
NFP: wait minutes after releaseNFPMinutesAfter | 60 |
Allow trading during CPI [false = pause]TradeDuringCPI | false |
CPI: pause minutes before releaseCPIMinutesBefore | 30 |
CPI: wait minutes after releaseCPIMinutesAfter | 60 |
Allow trading during FOMC [false = pause]TradeDuringFOMC | false |
FOMC: pause minutes before releaseFOMCMinutesBefore | 60 |
FOMC: wait minutes after releaseFOMCMinutesAfter | 150 |
11 | OTHER NEWS & CALENDAR SAFETY
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Enable the general economic-news filterMoonCalendarShieldEnabled | false |
General filter: block high-impact newsFilterHighImpactNews | true |
General filter: also block medium-impact newsFilterModerateImpactNews | false |
General filter: pause minutes before newsNewsMinutesBefore | 60 |
General filter: wait minutes after newsNewsMinutesAfter | 30 |
Both news filters: delete pending during pauseDeletePendingBeforeNews | true |
Calendar unavailable: pause NEW entries [pending orders stay unNewsFailClosed | false |
Also protect verified NFP/CPI/FOMC dates [check expiry in ExperUseBuiltInMajorNewsBackup | true |
12 | OPTIONAL WIDE-SPREAD PROTECTION
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Wide spread: pause entries and remove pendingWideSpreadProtectionEnabled | false |
Spread limit [MoonDog points; 200 = 20 gold pips]WideSpreadMaxPoints | 200.0 |
13 | NORMAL ACCOUNT DAILY LOSS LIMIT
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Enable a daily loss limit for normal accountsNormalDailyLimitEnabled | false |
Daily loss limit [% of day-start equity]NormalMaxDailyLossPercent | 20.0 |
Close MoonDog positions at the daily loss limitNormalDailyClosePositions | true |
Delete MoonDog pending at the daily loss limitNormalDailyDeletePendings | true |
Saved daily-limit profile nameNormalDailyProtectionId | "MAIN" |
14 | PROP FIRM LIMITS
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Enable prop-firm protectionPropFirmActive | false |
Saved challenge profile namePropFirmChallengeId | "MAIN" |
Challenge starting balance [0 = automatic]PropFirmStartingBalance | 0.0 |
Challenge profit target [%]PropFirmProfitTargetPercent | 8.0 |
Firm's maximum daily loss [%]PropFirmMaxDailyLossPercent | 5.0 |
Firm's maximum total drawdown [%]PropFirmMaxTotalDrawdownPercent | 10.0 |
Stop before the firm limit [percentage points]PropFirmSafetyBufferPercent | 0.5 |
Pause new entries at the profit targetPropFirmStopAtProfitTarget | true |
Delete pending at prop loss or profit-target limitsPropFirmDeletePendingsWhenBlocked | true |
Close MoonDog positions at a loss-limit triggerPropFirmClosePositionsOnLimit | true |
Close at profit target [also enable target entry pause]PropFirmClosePositionsAtTarget | false |
15 | PROP FIRM CALCULATIONS
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Total drawdown: fixed / highest balance / equityPropFirmDrawdownMode | MDPropDrawdown_Fixed |
Daily starting reference: balance / equityPropFirmDailyBaseline | MDPropBaseline_Equity |
Daily loss allowance: initial / daily referencePropFirmDailyLossAmount | MDPropDailyAmount_Initial |
Trailing allowance: fixed amount / % of peakPropFirmTrailingAmount | MDPropTrailing_Fixed |
Firm reset hour [broker time, 0-23]PropFirmDailyResetHour | 0 |
Firm reset minute [0-59]PropFirmDailyResetMinute | 0 |
Max positions + pending [0 = strategy limit]PropFirmMaximumExposureSlots | 0 |
16 | AUTOMATIC FIXED-LOT GROWTH
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Grow the fixed lot as the account growsLotScalingEnabled | false |
Growth starting balance [0 = save automatically]LotScalingBaseBalance | 0.0 |
Account growth needed for each lot increaseLotScalingBalanceStep | 500.0 |
Lot added at each growth stepLotScalingLotStep | 0.01 |
Maximum lot from automatic growthLotScalingMaxLot | 0.03 |
Use equity for growth [false = balance]LotScalingUseEquity | false |
Keep the highest reached growth levelLotScalingOnlyUp | false |
Remember the growth level after restartLotScalingPersistState | true |
Saved lot-growth profile nameLotScalingStateId | "MAIN" |
17 | ORDER COMMENTS
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Custom order comment [empty = module name]OrderCommentText | "MoonDog MQLume" |
Add module code to your custom commentAppendModuleToComment | false |
PROP mode only: leave order comments blankPropFirmBlankOrderComment | false |
18 | SLIPPAGE MEASUREMENT
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Measure slippage and enable its panelShowExecutionComparison | true |
Closed trades before an overall ratingExecutionMinimumTrades | 10 |
EXCELLENT: max one-way slippage [gold price]ExecutionExcellentMax | 0.05 |
GOOD: max one-way slippage [gold price]ExecutionGoodMax | 0.15 |
NORMAL: max one-way slippage [gold price]ExecutionNormalMax | 0.35 |
POOR: max one-way slippage [higher = BAD]ExecutionPoorMax | 0.75 |
19 | PANEL & STARTUP IMAGE
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Open full panel on startup [OFF = lightweight; use Show panel]MoonDashboardVisible | false |
Panel size [smaller number = smaller panel]MoonDashboardScale | 1.1 |
Show MoonDog startup imageShowLaunchSplash | true |
Startup image duration [seconds]LaunchSplashSeconds | 3 |
20 | TESTING & LOCAL REVIEW LOG
Initial values shown below come from the included source. Review the parameter guide before changing settings.
| Source input key | Initial value |
|---|---|
Reduce drawing during backtestsFastBacktest | true |
Save local review log [no auto-training]LocalLearningLogEnabled | false |
INTERNAL calendar helper: always leave empty on your trading chCalendarWorkerSession | "" |
Support after delivery
Bug fixes are included.
While the product is actively maintained, we investigate and fix reproducible defects in the delivered, unmodified code that conflict with the product description.
Support: while the product is actively maintainedDelivery & compilation
Missing files, incorrect delivery and original-code compilation failures in the stated environment.
Code & documentation defects
Provide the release, settings, logs and reproduction steps so we can assess and resolve the issue.
Support scope
Future profits are not guaranteed. You should be comfortable using MQL5 and MT5; difficulties caused by a lack of the required knowledge are outside bug-fix support.
FAQ
Frequently asked questions
Designed for users with programming skills and trading experience who can read code, compile MQL5 and test strategies independently.
Help centreWhat am I buying?
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.
Refunds after delivery
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.
Delivery and bug reports
Enter your email, confirm the licence and download your free EA source package. No payment needed.
Delivery & support
- 1
Add to cart
Choose your free EA source packages.
- 2
Check your order
Review the products and US$0 total.
- 3
Enter your email
Confirm the licence and complete your free order.
- 4
Download
One ZIP for all selected free products, with individual downloads available.
Explore free EA source code
Free downloads. Real source files.

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.
Journal Starter
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.