Alım-satım robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Facebook üzerinde bulun!
Fan sayfamıza katılın
MetaTrader 5 terminalinizden Kod Tabanına erişin
Doğru kodu bulamadınız mı? Freelance bölümünden sipariş edin
Bir Uzman Danışman veya Gösterge Nasıl Yazılır?

MetaTrader 5 için MQL5 Kaynak Kodu Kütüphanesi - 2

icon

Bu, MetaTrader 5 platformu programlarının en büyük ücretsiz kaynak kodu kütüphanesidir. Burada hazır Uzman Danışmanlar, teknik göstergeler, komut dosyaları ve kütüphaneler bulabilirsiniz. MQL5 dilini öğrenirken kod kütüphanesini kullanın ve sağlanan kodlara dayalı olarak kendi otomatik alım-satım uygulamalarınızı geliştirin.

Yayınlanan kodları ücretsiz olarak indirebilir, MetaTrader 5'te test edebilir ve başlatabilirsiniz. Kütüphaneye ayrıca doğrudan MetaTrader 5 platformundan ve MetaEditor geliştirme ortamından da erişebilirsiniz.

Kod ekle

A small educational Expert Advisor showing how Wilder's ADX and Directional Movement can be calculated directly from completed classic Renko bricks. The EA builds fixed-size Renko internally from BID ticks. No offline charts, custom symbols, DLLs or external indicators are required. +DI, -DI and ADX are updated only after a Renko brick has been completed.

GDS Renko Canvas is a compact educational indicator showing how a classic fixed-size Renko chart can be rendered directly in MetaTrader 5 with the standard CCanvas class. The indicator builds Renko bricks from incoming BID ticks and displays only completed bricks. Continuation requires one brick, while a reversal follows the classic two-brick rule. Unlike object-based Renko overlays, the visible chart is drawn on a single Canvas bitmap layer. This keeps the chart object list small and makes redraws on resize straightforward.

GDS Renko Dual MA Demo EA is a small educational Expert Advisor for MetaTrader 5. It shows one simple way to combine classic fixed-size Renko bricks with two simple moving averages calculated directly from completed Renko closes.

Tick-driven scalper that only trades genuine statistical outlier price moves, sized and protected to survive real broker execution delay. Backtest results included below.

AurumNeuro Vanguard is an intelligent Expert Advisor (EA) specifically designed for XAUUSD / Gold trading, combining a hybrid Neural Risk Architecture with the Unified Market Dynamics Engine (UMDE).

Day Trader Dashboard, MetaTrader 5 için geliştirilmiş, Bloomberg tarzında bir görsel paneldir; gün içi fiyat aralığını takip eder ve fiyatın bu aralığın içinde olduğu (fade zone) veya aralığın dışına çıktığı durumları işaretler. Bu araç işlem yapmaz — son çubuklardan Yüksek/Düşük aralığını hesaplayan, bu seviyeleri doğrudan grafiğe çizen ve temalı, otomatik ölçeklenebilir bir panelde canlı durum bilgisini (tarama / aralık içinde / kırılma) gösteren bir karar destek katmanıdır. Aynı grafikte birden fazla bağımsız örneği ve çeşitli renk temalarını destekler; kaldırıldığında nesnelerinin %100'ünü temizler.

Bu, MT5 grafiği üzerinde yer alan bir FX Dashboard tarzı terminal paneli ve grafiğe çizilmiş çizgilerdir (EMA, Bollinger, Donchian).

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.

PulseStrike Scalper - Statistical Burst Detection EA

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. Unlike standard terminal panels, this utility places a fully interactive, color-coded symbol grid directly on your chart — showing at a glance which instruments are in Profit, which are in Loss, how many trades are open, and what trade types are active. Whether you trade Forex, Synthetic Indices, Commodities, or CFDs, this utility eliminates the need to scroll through the Terminal window to check your exposure. Every symbol button updates in Real-Time with your running P&L, Trade Count, and Trade Type — all color-coded for instant recognition. EMTOrdersUtility v2.3: The Panel will now always list/show symbols in Alphabetical Order regardless of the original Market Watch order or the order you typed them in the manual list. It also comes without the Hide/Show Button

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.

A library of 24 MQL5 classes that watches a prop-firm rulebook -- drawdown, daily loss, payout consistency, minimum trading days, news blackout -- against any account, and flattens on breach without ever opening a position of its own.

Birden fazla EA çalıştıran (veya bunlarla birlikte manuel işlemler gerçekleştiren) hesaplar için salt okunur bir denetim betiği. Bu betik, kapatılmış işlem geçmişini “magic number” (magic numara) bazında gruplandırır ve her bir magic numara için bir satır çıktılar: kapalı işlem çiftleri, işlemin HER İKİ tarafındaki swap ve komisyon dahil net kâr/zarar, kazanma oranı, kâr faktörü, ortalama kâr/zarar, şu anda açık olan pozisyonlar ve bekleyen emirler, işlem tarihleri ve semboller - net sonuca göre sıralanmış, elektronik tablolar için CSV dışa aktarma özelliği ile.

Daily Zone Recovery, önceki işlem gününün en yüksek ve en düşük seviyelerini temel alan, MetaTrader 5 için geliştirilmiş çok stratejili bir ticaret danışmanıdır. Bu danışman, günlük en yüksek ve en düşük seviyelerin yakınındaki fiyat hareketlerini izler, üç bağımsız giriş stratejisi kullanır ve sabit hacimli bir ağ yardımıyla pozisyonları yönetebilir.

MSNR KeyLevels MultiTF draws Malaysian SNR key levels from M5, M10, M15, H1, H4 and D1 at the same time, on any chart you have open. A built-in control panel lets you switch each timeframe on and off with a single click, so you go from a clean chart to full higher timeframe context in a second, and back again just as fast.

Daily Pivot Points indicator for MetaTrader 5 with Classic and Fibonacci methods. Displays PP, R1-R3 and S1-S3 using the previous completed daily candle.

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.

Risk yüzdesini belirleyin, stop seviyesini sürükleyin ve hesap para biriminizde fiyatlandırılmış tam lot büyüklüğünü öğrenin — teminat ve hedef dahil. Yalnızca hesaplama yapar, asla işlem yapmaz.

Mevcut trend koşullarını değerlendirip, brokerlara göre normalleştirilmiş uzun ve kısa pozisyon risk planları oluşturan ücretsiz, açık kaynaklı bir MT5 salt okunur grafik yardımcı programıdır. Program, hareketli ortalamanın yönü ve eğimi, ADX, Verimlilik Oranı, ATR, spread, hesap para birimi ve sembol özelliklerini kullanır. Program hiçbir zaman işlem açmaz, değiştirmez veya kapatmaz.

A lightweight, OOP-compliant MQL5 header class (.mqh) for accurate pip value calculation and dynamic lot sizing across all instruments, featuring automated cross-currency rate conversion and broker volume normalization.

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.

Built on Wyckoff Volume Spread Analysis (VSA) principles, it decodes smart money accumulation, distribution, absorption, and trend direction with zero repainting and a strict 2,000-bar performance limit.

Closed-bar ICT/SMC session-liquidity scanner for three symbols, with confirmed MSS, FVG retests, risk/reward projections and optional macro context.

A liquidity-sweep / order-block scalper with ATR-based sizing and a higher-timeframe trend filter. Every trade is tagged on the chart with the live historical win rate of that setup type — a running scorecard, not just boxes.

Drag your stop loss where you actually want it, hit Buy or Sell, and the lot size is already correct — no calculator, no spreadsheet. Handles break-even, trailing, and shuts trading down for the day if you hit your loss limit.

MT5 için bu EA, işlem yapmayan, ancak broker ve işlem ortamının teknik özelliklerini toplayıp gösteren bir tanılama aracıdır. Kod, 4 ana bloktan oluşmaktadır: Veri Toplama (CollectAll): Hesap bilgileri (kaldıraç, para birimi), sembol bilgileri (haneli sayılar, spread, swap, hacimler, stop seviyeleri), gecikme süresi (ping) ve saat dilimi (Sunucu-UTC farkı) bilgilerini alır. Swap değerini gerçek para biriminde hesaplar. Örnekleme (OnTick): Spread istatistiklerini (minimum, ortalama, maksimum) gerçek zamanlı olarak günceller. Çıktı: Verileri "Uzmanlar" günlüğüne yazdırır, bir CSV dosyasına kaydeder ve grafikteki bir grafik panelinde (UpdatePanel) gösterir. Yardımcı: CalcSwapInCurrency ve çeşitli *ToStr işlevleri, brokerın ham sayısal verilerini okunabilir dizelere dönüştürür.

Aşırı bölge geçişlerine dayalı olarak alım ve satım sinyalleri üreten, yeniden çizilmeyen, stokastik tabanlı bir gösterge; alternatif sinyal filtresi ve çubuk kapanış uyarıları içerir.

Three position-sizing protections that do different things; confusing them is why so many accounts get wiped out: - ladder: one contract per X of balance, always applied as a CAP, even with manual lot sizing; - floor: below the minimum capital it does not trade; a new deposit is needed; - breaker: stops at X% below the peak, at any account size, and does not rearm by itself. What this library solves and almost none does: a deposit is not profit, and a withdrawal is not a loss. The breaker measures the drop against the balance peak. Untreated, a deposit made DURING a drawdown lifts balance and peak together, and the protection stops seeing the drop exactly when it would help. Here deposits and withdrawals shift the peak by the same amount. The peak is persisted to a file: a breaker that forgets the peak on a terminal restart is not a breaker. The demo simulates a deposit at the bottom of a drawdown. Run it with the deposit on and off and compare the "drop" column.

Four EAs writing to the same file, all with FILE_SHARE_READ|FILE_SHARE_WRITE, FileSeek(SEEK_END), FileWrite, FileClose. Looks correct. Every FileOpen returns success. No error in the log. And the lines vanish. Reason: FILE_SHARE_WRITE lets all four open at the same time. All four call FileSeek(SEEK_END) and get THE SAME offset, because none has written yet. All four write at the same position. Whoever closes last wins. Three lines vanish silently. In my case: 12 events expected, 8 in the file. The fix is to open EXCLUSIVELY (no FILE_SHARE_WRITE) and retry while another EA holds the file. And to shout in the log when the retries run out: a log that fails silently is worse than no log at all, because you trust it. The demo script reproduces both modes. To see the loss, drag it onto four charts at the same time with safe mode off and count the lines in the CSV. On a single chart the defect does not show up - which is why it passes in testing and breaks in production.

TimeCurrent() is not a clock. It is the stamp of the LAST TICK. Two consequences break robots in production: 1. It freezes. With no tick it does not move: illiquid instrument, end of session, unstable connection - and any rule based on it stops with it. 2. It steps backwards: on a symbol switch, a reconnection or a tick from another instrument, the value can go back. The case that cost me a whole protection: I compared the date of a daily decision with TimeCurrent() to reject an expired one. The server clock stepped back to the previous day, the comparison matched, and four EAs accepted YESTERDAY's decision as valid. The gate that should have failed closed failed open - without a single error in the log. Rule: TimeLocal() for timestamps, dates, day changes, expiry - all that must always move forward; TimeCurrent() for session hours and market data. The script measures the divergence in your environment and reports both symptoms live. Run it with the market closed.

Measures, hour by hour, how far a symbol travels and how much of that the spread takes away. Built for gold, works on any symbol, compares several side by side.

Detects the gold symbol whatever the broker calls it, reads the contract specification from the terminal instead of assuming it, and turns a risk in account currency into a lot size that is correct for that broker.

Opens a virtual bracketed trade on every M1 bar, walks it forward on the real tick history, and reports for a sweep of stop distances how often 1-minute OHLC modelling would score the trade the wrong way round.

Gold has a daily maintenance break on the CME. The first hour after it rises more than chance explains, in every calendar year of an 11-year sample - while every other hour of the day measures flat. One trade per session, a volatility-scaled server-side stop, no averaging or grid. Then my cost model turned out to be wrong. A real-tick backtest showed the true round-trip cost at the reopen is about 60 points, not the 19 my research had charged - the M1 bar spread field is a per-bar summary and understates it roughly threefold. Re-running 11 years at the corrected cost: +3.34 bps, t 7.40, 59.3% wins -> +1.60 bps, t 3.42, 50.8% wins The edge survives, at less than half its original strength. That second number is the real one. What it is not: about +3.3% a year with 4.6% drawdown, roughly one year in nine negative. At 0.01 lots that is ~130 a year - a figure that measures the position size, not the strategy.

Exports one CSV line per closed trade with the numbers a statement does not carry: the best unrealised profit the trade showed (MFE), the worst unrealised loss it survived (MAE), how much of the MFE was actually kept, how many bars it spanned, and how long it was held. Same measurement as the Trade Excursion indicator, written to a file instead of drawn, because the questions worth asking of this data are ones a chart cannot answer: does the capture ratio depend on the hour of entry? Are the trades I close early the ones I hold longest? Do losers on Mondays reach a different MAE than on Fridays? Those are one pivot table away once the CSV exists. Output is semicolon separated with a header row, in MQL5\Files; opens in any spreadsheet. Measurement limit: excursions come from bar highs and lows on the chosen timeframe; the path inside a bar is unknown. The bars column reports the resolution each trade got, and the summary counts single-bar trades separately instead of averaging them in.

Your statement tells you what you KEPT. It does not tell you what you HAD. This indicator reads your own closed trades from the account history and draws, for each one, the full range it travelled: the best unrealised profit it ever showed (MFE) and the worst unrealised loss it survived (MAE). The gap between what a trade showed and what it paid is where two common problems hide, and neither is visible in a balance curve: winners closing far below their best point (the exit leaves money behind), and losers whose worst excursion barely passed the stop (the stop sits inside the noise). The number to look at is the CAPTURE RATIO: of the profit a winner showed at its best, how much did you take home? 90% says the exits are well placed; 30% says the market kept offering and the exit kept refusing. Limit, stated up front: excursions come from the bars each trade spanned, on the chart timeframe; the path inside a bar is unknown. Predicts nothing; measures trades that already happened.

A daily process writes "today's decision" (which strategy runs, or FLAT) to a file the EAs read at the open. One day the writer did not run. The EAs read yesterday's file, compared its date with TimeCurrent() - the server clock, which had stepped back to the previous day overnight - saw a match, and traded all morning on a 24-hour-old decision. No error anywhere. Two rules, both in this class: 1) staleness is judged against TimeLocal(), which always moves forward; TimeCurrent() is the last tick's stamp - it freezes without ticks and can step back on reconnect. 2) When in doubt the answer is FLAT: missing file, bad date, wrong day, empty line - every failure path returns "do nothing", and each is logged ONCE per state change, not on every tick and not never. File format: line 1 = ISO date, line 2 = decision string. The demo writes a fresh, a stale, a malformed, an empty and a missing file, and shows that only the first is allowed to trade.

Four EAs on the same symbol, each one honest on its own: each checks "do I have a position?" with its own magic number, sees none, and enters. On a demo account this reached 22 contracts on a symbol meant to carry 1, and a watchdog had to close 16 positions in one morning. The cap belongs at the door, not after the fact. ExposureCap::Allowed(symbol, lots, cap) sums the volume of every open position on the symbol - all magic numbers, manual trades included - and refuses the order BEFORE it is sent when it would breach the cap. One log line with the three numbers (held, requested, cap) says why. Deliberately simple: gross exposure, no netting of longs against shorts, no per-EA quota. It is a check, not a lock: two EAs deciding on the same tick can both pass; in practice EAs on different charts decide on different ticks. The demo script prints held / cap / room for the current symbol and shows the refusal line. Nothing is traded.

A datetime in MQL5 is seconds since 1970 - but server time (TimeCurrent, bar times, deal times) is the broker's wall clock stored AS IF it were UTC. Export it to CSV, read it in Python or a spreadsheet with a "seconds since 1970 UTC" parser, and every timestamp shifts by the server's UTC offset. On a UTC-3 broker that is three hours: the daily bar dated 00:00 reads as 21:00 of the previous day, and "yesterday's session" silently becomes "today's, half formed". That happened to a morning report of mine before this script existed. The script prints TimeTradeServer, TimeCurrent, TimeGMT and TimeLocal, the three offsets between them, the tick lag, and this chart's last bar time in server time and in real UTC - then states the rule: export server timestamps as wall-clock text, or export the epoch together with the offset, and never let the consumer apply its own timezone.

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.

123456789...206