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.

  1. Describe your idea

    Ask for a session filter, clearer logging or a different risk rule.

  2. Review the change

    Read the proposed code, check the logic and compile it in MetaEditor.

  3. 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.

MQL5 / .mq5
MoonDog EA MT5 4.21[MQLume].mq5v4.21
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.

No external MQH or DLL required

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
  • MQ5

    MoonDog EA MT5 4.21[MQLume].mq5

    Complete, editable single-file source. Read the logic, customise it and compile your own EA.

    Included
  • EX5

    MoonDog EA MT5 4.21[MQLume].ex5

    The compiled EA accompanying the source. Recompile after editing the MQ5.

    Included
  • TXT

    README.txt

    A concise welcome, installation and compilation guide, with licence terms and support details.

    Included
  • PDF

    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.

    Included
  • TXT

    RELEASE_NOTES.txt

    Build details, recorded test conditions, changes and known limits for the supplied package.

    Included

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.

00 | QUICK SETUP: CHANGE ONLY THIS
Source input keyInitial value
SET 1 Default / SET 2 Adaptive / SET 3 All 9 / SET 4 All 9 AdapMoonQuickSetupMDSetup_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.

IMPORTANT | CHECK SET AGAIN AFTER EVERY EA UPDATE
Source input keyInitial value
Recommended set link [check after every update]RecommendedSetLinkDisplay text
01 | CHOOSE TRADING MODE

Initial values shown below come from the included source. Review the parameter guide before changing settings.

01 | CHOOSE TRADING MODE
Source input keyInitial value
AI profile: Conservative [default] / More Trades / Without ONNXAiTradingModeMDAi_Conservative
02 | LOT SIZE & RISK

Initial values shown below come from the included source. Review the parameter guide before changing settings.

02 | LOT SIZE & RISK
Source input keyInitial value
Sizing: AUTO=BT 2% / live fixed; select another mode to overridMoonSizingMDSizing_Auto
Fixed lot [FIXED mode, or AUTO on live/demo charts]MoonFixedLot0.01
Risk per trade [%; CUSTOM RISK mode only]MoonCustomRiskPercent2.0
Maximum lot for % risk [0 = no cap]MaximumRiskLot0.0
Adaptive sizing [manual % risk + ONNX; not AUTO, Growth or fixeAdaptivePositionSizeMDAdaptive_Normal
03 | STOP LOSS & PROFIT PROTECTION

Initial values shown below come from the included source. Review the parameter guide before changing settings.

03 | STOP LOSS & PROFIT PROTECTION
Source input keyInitial value
Initial stop loss [gold pips; new orders]MoonStopLossPips20.0
How to protect open-trade profitMoonProtectionModeMDProtection_VirtualOnly
Remember virtual protection after restartPersistVirtualTrailingtrue
Enable MoonLock profit protectionMoonLockEnabledtrue
Start MoonLock at profit per 0.01 lot [account money]MoonLockStartPer0011.0
Choose Classic / Gradual, with or without Spike ShieldMoonLockProfileMDLock_ClassicShield
Classic profiles: share of peak profit to protect [%; default 5MoonLockPercent50.0
04 | CUSTOM BE & TRAILING [MOONLOCK OFF]

Initial values shown below come from the included source. Review the parameter guide before changing settings.

04 | CUSTOM BE & TRAILING [MOONLOCK OFF]
Source input keyInitial value
Use my BE and trailing when MoonLock is OFFUseCustomBreakEvenTrailingfalse
Move to BE after this profit [gold pips]CustomBreakEvenStartPips10.0
At BE, protect this many profit pipsCustomBreakEvenLockPips1.0
Start trailing after this profit [gold pips]CustomTrailingStartPips20.0
Keep trailing this far behind price [gold pips]CustomTrailingDistancePips10.0
Move trailing only after this further improvement [gold pips]CustomTrailingStepPips2.0
05 | TAKE PROFIT TARGETS

Initial values shown below come from the included source. Review the parameter guide before changing settings.

05 | TAKE PROFIT TARGETS
Source input keyInitial value
Moon Apex take profit [gold pips]MoonApexTargetPips140.0
Other four modules: take profit [gold pips]MoonCoreTargetPips150.0
06 | INDIVIDUAL STRATEGIES [ADVANCED CUSTOM ONLY]

Initial values shown below come from the included source. Review the parameter guide before changing settings.

06 | INDIVIDUAL STRATEGIES [ADVANCED CUSTOM ONLY]
Source input keyInitial value
Enable Moon NovaMoonNovatrue
Enable Moon ApexMoonApextrue
Enable Moon ZenithMoonZenithtrue
Enable Moon PulseMoonPulsetrue
Enable Moon EclipseMoonEclipsetrue
06B | ADVANCED CUSTOM ONLY

Initial values shown below come from the included source. Review the parameter guide before changing settings.

06B | ADVANCED CUSTOM ONLY
Source input keyInitial value
Only when QUICK SETUP = Advanced CustomUsePerModuleTunedExitstrue
Moon Orbit add-on [M30 pivots; OFF = default]MoonAddOnAfalse
Moon Halo add-on [H1 wide pivots; OFF = default]MoonAddOnBfalse
Moon Titan add-on [H4 pivots; OFF = default]MoonAddOnCfalse
Moon Comet add-on [H1 fast pivots; OFF = default]MoonAddOnDfalse
Add-ons ON: max open positions in one direction, all modules [0MaxSameDirectionPositions8
Allow entries on NETTING accounts [V4.19 is validated on hedginAllowNettingAccountfalse
07 | MAGIC NUMBERS & EXISTING TRADES

Initial values shown below come from the included source. Review the parameter guide before changing settings.

07 | MAGIC NUMBERS & EXISTING TRADES
Source input keyInitial value
MoonDog magic number [unique for each EA chart]MoonTradeIdentity33300
Manage previous magic number [0 = off]PreviousMoonTradeIdentityBase0
Manage older-format magic number [0 = off]PreviousMoonDogTradeIdentity0
08 | DAILY ENTRY HOURS

Initial values shown below come from the included source. Review the parameter guide before changing settings.

08 | DAILY ENTRY HOURS
Source input keyInitial value
Allow new entries only within set hoursUseTradingHoursfalse
Entry start hour [broker time, 0-23]TradingStartHour2
Entry start minute [0-59]TradingStartMinute0
Entry end hour [broker time, 0-23]TradingEndHour19
Entry end minute [0-59]TradingEndMinute0
Delete pending orders outside entry hoursDeletePendingOutsideHoursfalse
09 | WEEKEND ENTRY PAUSE

Initial values shown below come from the included source. Review the parameter guide before changing settings.

09 | WEEKEND ENTRY PAUSE
Source input keyInitial value
Pause entries and remove pending for the weekendWeekendShieldEnabledtrue
Weekend times: automatic / customWeekendScheduleModeMDWeekend_Automatic
AUTO: pause minutes before Friday closeWeekendFridayCutoffMinutes240
AUTO: wait minutes after weekly reopeningWeekendReopenDelayMinutes240
AUTO fallback: Friday pause hour [broker time]WeekendFallbackFridayHour20
AUTO fallback: Monday resume hour [broker time]WeekendFallbackMondayHour5
CUSTOM: Friday pause hour [broker time]WeekendCustomFridayHour20
CUSTOM: Friday pause minuteWeekendCustomFridayMinute0
CUSTOM: Monday resume hour [broker time]WeekendCustomMondayHour5
CUSTOM: Monday resume minuteWeekendCustomMondayMinute0
10 | NFP, CPI & FOMC NEWS

Initial values shown below come from the included source. Review the parameter guide before changing settings.

10 | NFP, CPI & FOMC NEWS
Source input keyInitial value
News currency [USD for gold; both news filters]NewsCurrency"USD"
Enable separate NFP, CPI and FOMC protectionUseMajorEventControltrue
Allow trading during NFP [false = pause]TradeDuringNFPfalse
NFP: pause minutes before releaseNFPMinutesBefore30
NFP: wait minutes after releaseNFPMinutesAfter60
Allow trading during CPI [false = pause]TradeDuringCPIfalse
CPI: pause minutes before releaseCPIMinutesBefore30
CPI: wait minutes after releaseCPIMinutesAfter60
Allow trading during FOMC [false = pause]TradeDuringFOMCfalse
FOMC: pause minutes before releaseFOMCMinutesBefore60
FOMC: wait minutes after releaseFOMCMinutesAfter150
11 | OTHER NEWS & CALENDAR SAFETY

Initial values shown below come from the included source. Review the parameter guide before changing settings.

11 | OTHER NEWS & CALENDAR SAFETY
Source input keyInitial value
Enable the general economic-news filterMoonCalendarShieldEnabledfalse
General filter: block high-impact newsFilterHighImpactNewstrue
General filter: also block medium-impact newsFilterModerateImpactNewsfalse
General filter: pause minutes before newsNewsMinutesBefore60
General filter: wait minutes after newsNewsMinutesAfter30
Both news filters: delete pending during pauseDeletePendingBeforeNewstrue
Calendar unavailable: pause NEW entries [pending orders stay unNewsFailClosedfalse
Also protect verified NFP/CPI/FOMC dates [check expiry in ExperUseBuiltInMajorNewsBackuptrue
12 | OPTIONAL WIDE-SPREAD PROTECTION

Initial values shown below come from the included source. Review the parameter guide before changing settings.

12 | OPTIONAL WIDE-SPREAD PROTECTION
Source input keyInitial value
Wide spread: pause entries and remove pendingWideSpreadProtectionEnabledfalse
Spread limit [MoonDog points; 200 = 20 gold pips]WideSpreadMaxPoints200.0
13 | NORMAL ACCOUNT DAILY LOSS LIMIT

Initial values shown below come from the included source. Review the parameter guide before changing settings.

13 | NORMAL ACCOUNT DAILY LOSS LIMIT
Source input keyInitial value
Enable a daily loss limit for normal accountsNormalDailyLimitEnabledfalse
Daily loss limit [% of day-start equity]NormalMaxDailyLossPercent20.0
Close MoonDog positions at the daily loss limitNormalDailyClosePositionstrue
Delete MoonDog pending at the daily loss limitNormalDailyDeletePendingstrue
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.

14 | PROP FIRM LIMITS
Source input keyInitial value
Enable prop-firm protectionPropFirmActivefalse
Saved challenge profile namePropFirmChallengeId"MAIN"
Challenge starting balance [0 = automatic]PropFirmStartingBalance0.0
Challenge profit target [%]PropFirmProfitTargetPercent8.0
Firm's maximum daily loss [%]PropFirmMaxDailyLossPercent5.0
Firm's maximum total drawdown [%]PropFirmMaxTotalDrawdownPercent10.0
Stop before the firm limit [percentage points]PropFirmSafetyBufferPercent0.5
Pause new entries at the profit targetPropFirmStopAtProfitTargettrue
Delete pending at prop loss or profit-target limitsPropFirmDeletePendingsWhenBlockedtrue
Close MoonDog positions at a loss-limit triggerPropFirmClosePositionsOnLimittrue
Close at profit target [also enable target entry pause]PropFirmClosePositionsAtTargetfalse
15 | PROP FIRM CALCULATIONS

Initial values shown below come from the included source. Review the parameter guide before changing settings.

15 | PROP FIRM CALCULATIONS
Source input keyInitial value
Total drawdown: fixed / highest balance / equityPropFirmDrawdownModeMDPropDrawdown_Fixed
Daily starting reference: balance / equityPropFirmDailyBaselineMDPropBaseline_Equity
Daily loss allowance: initial / daily referencePropFirmDailyLossAmountMDPropDailyAmount_Initial
Trailing allowance: fixed amount / % of peakPropFirmTrailingAmountMDPropTrailing_Fixed
Firm reset hour [broker time, 0-23]PropFirmDailyResetHour0
Firm reset minute [0-59]PropFirmDailyResetMinute0
Max positions + pending [0 = strategy limit]PropFirmMaximumExposureSlots0
16 | AUTOMATIC FIXED-LOT GROWTH

Initial values shown below come from the included source. Review the parameter guide before changing settings.

16 | AUTOMATIC FIXED-LOT GROWTH
Source input keyInitial value
Grow the fixed lot as the account growsLotScalingEnabledfalse
Growth starting balance [0 = save automatically]LotScalingBaseBalance0.0
Account growth needed for each lot increaseLotScalingBalanceStep500.0
Lot added at each growth stepLotScalingLotStep0.01
Maximum lot from automatic growthLotScalingMaxLot0.03
Use equity for growth [false = balance]LotScalingUseEquityfalse
Keep the highest reached growth levelLotScalingOnlyUpfalse
Remember the growth level after restartLotScalingPersistStatetrue
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.

17 | ORDER COMMENTS
Source input keyInitial value
Custom order comment [empty = module name]OrderCommentText"MoonDog MQLume"
Add module code to your custom commentAppendModuleToCommentfalse
PROP mode only: leave order comments blankPropFirmBlankOrderCommentfalse
18 | SLIPPAGE MEASUREMENT

Initial values shown below come from the included source. Review the parameter guide before changing settings.

18 | SLIPPAGE MEASUREMENT
Source input keyInitial value
Measure slippage and enable its panelShowExecutionComparisontrue
Closed trades before an overall ratingExecutionMinimumTrades10
EXCELLENT: max one-way slippage [gold price]ExecutionExcellentMax0.05
GOOD: max one-way slippage [gold price]ExecutionGoodMax0.15
NORMAL: max one-way slippage [gold price]ExecutionNormalMax0.35
POOR: max one-way slippage [higher = BAD]ExecutionPoorMax0.75
19 | PANEL & STARTUP IMAGE

Initial values shown below come from the included source. Review the parameter guide before changing settings.

19 | PANEL & STARTUP IMAGE
Source input keyInitial value
Open full panel on startup [OFF = lightweight; use Show panel]MoonDashboardVisiblefalse
Panel size [smaller number = smaller panel]MoonDashboardScale1.1
Show MoonDog startup imageShowLaunchSplashtrue
Startup image duration [seconds]LaunchSplashSeconds3
20 | TESTING & LOCAL REVIEW LOG

Initial values shown below come from the included source. Review the parameter guide before changing settings.

20 | TESTING & LOCAL REVIEW LOG
Source input keyInitial value
Reduce drawing during backtestsFastBacktesttrue
Save local review log [no auto-training]LocalLearningLogEnabledfalse
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 maintained

Delivery & 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 centre
What 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. 1

    Add to cart

    Choose your free EA source packages.

  2. 2

    Check your order

    Review the products and US$0 total.

  3. 3

    Enter your email

    Confirm the licence and complete your free order.

  4. 4

    Download

    One ZIP for all selected free products, with individual downloads available.

Explore free EA source code

Free downloads. Real source files.

MoonDog EA MT5

Free EA source code · v4.21

US$299Original EA market priceFREE

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.

Checkout

MoonDog EA MT5

Version 4.21 · Personal-use licence

Order total
US$0

Instant download after checkout

Screenshot · MoonDog EA MT5

Screenshot — MoonDog EA MT5
Enlarge image ↗

Cart

One personal-use licence per project. Each project can be added once.

Your cart is empty

Choose a source project to get started.

Continue shopping