Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Access the CodeBase from your MetaTrader 5 terminal
Couldn't find the right code? Order it in the Freelance section
How to Write an Expert Advisor or an Indicator

Top MQL4 and MQL5 source codes based on user ratings - 19

Submit your code

An Expert Advisor that measures the high/low of a defined session opening window, then trades the confirmed breakout of that range with risk-based position sizing and a one-trade-per-session cap.

BMP Chart Wallpaper Background for MT5

Plots a volume-weighted, volatility-normalized oscillator that flags impulse and exhaustion conditions as price stretches away from its rolling VWAP

A normalized order-flow oscillator that estimates buy/sell volume pressure per bar, accumulates it into a rolling delta, and automatically flags regular bullish and bearish divergence against price swings.

Tracks the rolling correlation between the current chart symbol and a chosen reference symbol, and flags the moment they decouple while their price spread is statistically stretched.

Converts the body-to-wick makeup of every candle into a bounded conviction reading, then smooths it into an oscillator that flags buyer/seller pressure and automatically marks divergence against price.

Ranks the 8 major currencies by relative strength on a live on-chart panel, calculated from the average percentage change of every available cross pair — not just USD pairs — so weak/strong currencies are visible at a glance, independent of whichever chart you have open.

Tracks the Asian, London, and New York session ranges, locks each one at session close, and flags true liquidity sweeps — a wick that pierces a locked high or low and closes back inside it — with an arrow signal and a shaded reaction zone. Non-repainting, works on any symbol and timeframe.

A Fisher Transform oscillator built from statistical first principles — normalizing price into a bounded range, then applying a logarithmic transform to produce sharp, well-defined reversal signals instead of the gradual turns typical of conventional oscillators. Internal recursive state is handled through proper calculation buffers for reliable, correct behavior across backtests. From the article series "Making Custom Indicators for Beginners."

A compact on-chart panel showing the current symbol's trend across several timeframes at once, each evaluated independently with its own Fast/Slow moving-average cross. No switching charts to check "what's H4 doing" — it's all in one place, color-coded.

simple coundown timer

Most reports give you one drawdown number - the worst one. This read-only script measures all three that matter on your own closed history: depth, duration and frequency. It prints the maximum drawdown with its peak, trough and recovery dates, the longest underwater period in days, whether you are at a new peak or how far below it and for how long, and a table of the deepest episodes with the days each took to recover. An episode is not a losing streak: it closes only when a NEW high is made, so a dip that never reclaims the old peak stays the same episode - which is what makes the duration column meaningful. Entry commissions are included and a partial close counts as one round turn, so the curve carries full cost. Optional percentage figures and CSV export. Deposits and withdrawals are excluded: this is the drawdown of your trading, not of your balance line.

Neural Loss-Pattern Auditor trains a small feed-forward neural network, written from scratch in native MQL5, on closed-deal history to test whether behavioral and market-context features predict which trades are more likely to lose. It reports an accuracy uplift over a naive baseline, a probability-calibration table, a permutation feature-importance ranking, and a configurable A-F composite grade with recommendations. On first run it uses a built-in synthetic demo, so the output is visible immediately with no setup; switch one input to InpUseDemoData=false to analyze real account history instead. Pure MQL5: no external libraries, no Python, and no AI service of any kind.

This allows mt5 chart to scroll like tradingview chart with auto button to reset

Spread histogram in a sub-window with current/avg/max/min stats, cost per trade, and threshold alerts for scalpers.

Marks fractal swing highs/lows as liquidity levels, then flags the exact bar where price wicks beyond one and closes back inside — a liquidity sweep / stop hunt — with an arrow and an optional price label. Sweep checks run only on closed bars, so signals never repaint.

Market Structure Shift (CHoCH) Bullish Setup (CHoCH ): Price breaks above the previous confirmed Lower High (LH), signaling a trend reversal from bearish to bullish. Bearish Setup (CHoCH ): Price breaks below the previous confirmed Higher Low (HL), signaling a trend reversal from bullish to bearish.

A read only MT5 script that reports broker symbol specifications, volume limits, price settings, execution modes, trading permissions, margin requirements and estimated profit values.

A compact MT5 trend dashboard that compares EMA alignment and ADX strength across six timeframes.

Equity guard that enforces a daily loss limit and a total drawdown limit, flattens the account on breach and blocks trading until the next daily reset. Includes the guard as a reusable include file plus a self-test expert that proves the behaviour in the strategy tester.

A simple real-time classic Renko chart for MetaTrader 5. Set the brick size and the indicator builds equal-width Renko bricks directly from tick data. No offline charts, custom symbols or external libraries are required.

A small educational Expert Advisor for MetaTrader 5 showing one simple way to automate support and resistance reactions with internally built classic Renko bricks.

A small educational Expert Advisor for MetaTrader 5 showing one simple way to combine classic fixed-size Renko bricks with a SuperTrend-style trend state.

The script prices one night of holding: for every open position and every Market Watch symbol it prints the swap per night in your account currency, the annualized cost in percent for both directions, the broker's rate-independent markup (|swap long| + |swap short| never depends on interest rates - it is pure broker margin), and the triple-swap day. Honest "n/a" where a swap mode cannot be converted reliably.

A safety EA that watches every open position on the chart symbol: it reports any position left without a stop loss, optionally attaches an ATR-based stop, and enforces a daily and a total drawdown limit that re-arms after a cooldown.

Exporting your deal history is easy and a dozen scripts already do it..

This Expert Advisor is that missing bridge. Attach it to any chart and it periodically writes the calendar to a CSV file in `MQL5\Files`, where anything outside the terminal can read it.

Checks your trade history against common prop-firm challenge rules — profit target, max daily loss, max drawdown, consistency rule, and minimum trading days — with a clear PASS/FAIL report.

Read-only panel that checks a BUY STOP or SELL STOP against the symbol contract before you send it: price tick grid, volume minimum/step/maximum, stop distances and order permissions. It never sends, changes or suggests anything.

An MT5 dashboard that classifies completed-bar trend regimes using EMA structure, ADX/DI, higher-timeframe confirmation, ATR, breakout position and spread context.

A SuperTrend that returns the same values as TradingView's ta.supertrend, shipped with the tool that proves it bar for bar against the Pine reference

Educational MT5 hedging-account trade panel with risk sizing, spread protection, a persistent daily-loss lock, break-even and trailing stops.

Cost is the one input to a trading system that is knowable exactly, and it is almost always estimated wrongly - always in the direction that flatters the strategy. This EA measures what one round trip really costs on YOUR broker: the live spread sampled from ticks, the swap for both sides including the triple-charge day, and the commission read from your own deals. Most spread figures come from the bar's "spread" field, because that is the easy one to reach. It is a per-bar summary, not the quote at any instant. Measured on XAUUSD: 20 points live across 60 readings against a bar-field median of 6. A factor of 3.3. So a filter set to "skip if spread > 15" never fires - it lets through exactly the moments it exists to block. Swap is the half most custom simulators do not charge at all. It is asymmetric, one side pays while the other collects, and one weekday counts three times. Read-only: it never opens, closes or modifies a position.

A simple MQL5 script that calculates the correct lot size for a trade based on your account risk percentage and stop loss distance in pips, so every trade risks a consistent, controlled amount of your balance.

GDS Renko Replay Trainer is a free educational tool for practising manual decisions on historical Renko charts in MetaTrader 5. Load a historical interval, replay it forward and place virtual BUY or SELL trades. You can pause, advance one tick or move to the next completed Renko brick. Each virtual position has a stop loss and take profit, and the trainer records the results of your session. The tool builds fixed-size Renko bricks from historical Bid/Ask ticks, with a classic two-brick reversal. Future ticks are not used to draw the visible chart or execute virtual trades. Buy trades use Ask for entry and Bid for exit; sell trades use the opposite sides. Orders entered on the panel wait for the next replayed valid tick. Stops and targets are checked on every tick, including price gaps.

Real-time risk calculator and lot size guard HUD for MT5. Computes exact lot sizing based on account balance, target risk %, and dynamic ATR Stop Loss with minimum lot overshoot warning.

Ranks the current period's range-so-far against the full historical distribution of past ranges — a true percentile, not just a comparison to the average like ADR% — and flags statistical compression or expansion on a compact live panel with a percentile gauge.

EMTOrdersUtility is a Real-Time Trade Monitor & Symbol Changer Utility designed for active traders who demand Real-Time visibility into their open positions across multiple financial instruments.

This educational Expert Advisor demonstrates one simple way to trade momentum on Renko bricks in MetaTrader 5. Momentum is the difference between the latest completed Renko close and the close N bricks earlier, divided by the brick size. A crossing above the positive threshold produces a BUY signal; a crossing below the negative threshold produces a SELL signal. Staying beyond a threshold does not generate repeated signals. The EA builds classic fixed-size Renko internally from Bid ticks, with a two-brick reversal. Orders use the available market Bid/Ask rather than synthetic brick prices. If several bricks form on one tick, only a crossing on the final brick can trigger entry. There is one position at a time, with virtual take profit, virtual stop loss, a maximum holding time, a cooldown and a spread filter. No external indicator, DLL, custom symbol or offline chart is required.

A quick market scan to identify sustainable trends. The script analyses all symbols from the ‘Market Overview’ in a matter of seconds and identifies instruments with the clearest and strongest price movements using R² linear regression and the ADX indicator.

1...121314151617181920212223242526...210