MQL4 ve MQL5 Kaynak Kodu Kütüphanesi

icon

MQL4 veya MQL5 programlama dilini öğrenmeye nereden başlayacağınızı bilmiyor musunuz? MetaTrader terminaliniz için çeşitli programlar burada mevcuttur. Yayınlanmış kod örneklerini indirin ve onlar üzerinde çalışın, kendi göstergelerinizi ve Uzman Danışmanlarınızı geliştirin. Uygulamalarınızı en büyük MQL4 ve MQL5 kod kütüphanesinde yayınlayın; uygulamalarınız her MetaTrader terminalinde ve MetaEditor'da kullanıma sunulacaktır.

MQL4 ve MQL5 kod örnekleriniz tüm dünyaya dağıtılacak ve böylece yüz binlerce yatırımcı sizi tanıyacaktır!

Kod ekle

Trending up, trending down or ranging: a verdict for every bar, and how long it has held. Each stretch of one regime is boxed on the price chart, ADX columns below show how strong it is, and a one-line panel gives the regime, its age and the ADX. Values for Expert Advisors and an alert on closed bars.

Reads your closed positions and the M1 bars after each exit. Shows how many stopped-out trades later reached their take profit, how far take-profit trades kept running and how much move was left after manual or EA exits. Summary panel, per-position log table and CSV.

Free educational EA — a single-position trend-following EMA crossover system for XAUUSD M30, released as open source for beginners to study trade ownership guards, preflight order validation, risk-based lot sizing, and server-time session filtering. This code demonstrates how a strategy - identifies and manages only its own positions and orders through MagicNumber and comment tags, - wraps CTrade with an OrderCheck preflight that blocks invalid or margin-breaking requests, - sizes each trade from a fixed stop-loss and risk percentage, - and restricts entries to a configurable broker session window with a daily close-all — all evaluated on completed bars only, so signals never repaint.

Asya, Londra ve New York seans aralık kutularını çizer ve likidite dalgalanmalarını işaretler: tamamlanmış bir seansın en yüksek veya en düşük seviyesinin ötesine uzanan ve tekrar bu sınırların içinde kapanan kapalı bir çubuk. Yeniden çizilmeyen oklar, genişletilmiş seans seviyeleri, uyarılar ve iCustom uyumlu tamponlar.

Yerleşik hesap koruma özelliğine sahip Açılış Aralığı Kırılma EA şablonu. Seans açılışından sonraki ilk N dakikanın en yüksek ve en düşük seviyelerini belirler ve aralığın üstüne ve altına OCO stop emirleri yerleştirir. Risk temelli pozisyon büyüklüğü belirleme, günlük zarar limiti, maksimum değer kaybı limiti, ATR aralığı filtresi, işlem yönü filtresi ve geceleme pozisyonlarına karşı koruma özelliklerini içerir. Tüm seans süreleri yapılandırılabilir girdilerdir. Bu şablon eğitim amaçlıdır; kâr garantili bir sistem değildir. Canlı kullanıma geçmeden önce demo hesabında test ediniz.

Non-repainting fair value gaps on closed bars, with zone states (active, touched, mitigated) and iCustom buffers for EAs.

Real-time daily drawdown buffer monitor and exact breach price line indicator for prop firm accounts. Features 00:00 server-time deal history reconstruction (including entry commissions), 00:00 HWM snapshot locking, two-stage OrderCalcProfit cross-rate calibration, and iCustom() data buffers for Expert Advisors.

Grafik arka planını, mevcut ATR’nin yüzdelik sıralamasına göre volatilite rejimine (Sıkışma, Normal, Genişleme) göre renklendirir. Grafikte mevcut rejimi gösterir, rejim değişiklikleri konusunda uyarı verir ve Uzman Danışmanlar için tamponları ortaya çıkarır.

Grafiğin arka planını, mevcut ATR’nin yüzdelik sıralamasına göre volatilite rejimine (Sıkışma, Normal, Genişleme) göre renklendirir. Grafikte mevcut rejimi gösterir, rejim değişiklikleri konusunda uyarı verir ve Uzman Danışmanlar için tamponları ortaya çıkarır.

Tek bir tıklamayla, herhangi bir zaman diliminde, tüm Market Watch sembolleri veya özel bir sembol listesi için grafikleri açar; her grafiğe isteğe bağlı bir şablon uygulanabilir. Zaten açık olan grafikleri atlar ve aynı anda açılan grafik sayısını sınırlar.

İhracat, M1 geçmiş verilerinden hesaplanan, puan ve para cinsinden Maksimum Olumsuz Sapma (MAE) ve Maksimum Olumlu Sapma (MFE) değerlerini içeren işlemleri CSV dosyasına aktarır; buna ek olarak, her işlemin yakaladığı mevcut hareketin yüzdesini de içerir.

See the real leverage of every Market Watch symbol, including floating margin tiers, with swap, commission and live spread in one panel.

Watches the whole account and closes everything before the daily loss or max drawdown limit is breached, then keeps the account flat until the block ends. Does not trade.

Expert Advisor template that shows safe execution practices: closed-bar signals once per bar, no duplicate entries after an MT5 or VPS restart, spread and stop-level checks, normalised volume and a log line for every decision.

Shows the current spread next to its recent average and maximum and compares it with ATR, so you can see at a glance when trading costs are too high relative to the symbol's normal movement.

On-chart panel that calculates the lot size for a given risk (% of balance, % of equity or fixed money) and stop-loss distance, using the broker's tick size and tick value. Works on forex, metals, indices and crypto.

Trailing stop and breakeven manager for Gold (XAUUSD), forex and any symbol: moves the stop to breakeven with an offset, then trails it in points or ATR multiples on manual trades and on any EA, filtered by magic and symbol. Open source code.

Script that reads the deal history of your account and writes a plain note on how an Expert Advisor really trades: entries, stops and trailing, lot changes, martingale, averaging, trades at once, hours and holding time, plus what to watch out for. It never trades and says nothing about profit

WaveMaster Osiloskop için Sinyal Odaklı Otomasyon. WaveMaster Osiloskop için otomatik yürütme motoru. Sinyal tamponlarını gerçek zamanlı olarak okur. Tam risk yönetimi, takip ve başabaş noktası özellikleri yerleşik olarak bulunur.

Terminalinizin gerçekte baraladığı çubuk geçmişini denetler; bu, her geriye dönük testin ve her göstergenin okuduğu geçmişi ifade eder. Her sembol için altı kontrol yapılır: imkansız OHLC değerleri, hatalı çubuk zamanları, brokerin kendi seans tablosunda fiyatlandırma yapıldığı belirtilmesine rağmen eksik çubuklar, boş ve düz çubuklar, brokerin kendi M1 serisiyle uyuşmayan çubuklar ve spread tutarlılığı. En önemli rakam, seans kapsamıdır; çoğunlukla kaç hafta sonu denetlediğinizi ölçen bir tablo yüzdesi değildir. Her bulgu, çubuk zamanıyla birlikte CSV dosyasına aktarılır ve denetlenen çubuklar ile seans tablosu dışa aktarılabilir; böylece raporun tamamı bu araç dışında başka bir yöntemle yeniden hesaplanabilir.

Draws the previous day, previous week and previous month high and low, plus automatic round-number levels around the current price. Every level carries a label with how many times price touched it and how many times a bar swept it (pierced the level and closed back on the original side). Counts use closed bars only, so they do not repaint. Optional alerts (popup, push, email, sound) for sweeps and new touches. Touch tolerance is a fraction of ATR or a fixed number of points. The 6 previous-period levels and their touch counts are exposed in 12 indicator buffers for use from an Expert Advisor with iCustom(). Works on any timeframe up to H4. Read-only: it never opens, modifies or closes a trade. No DLLs, no web requests.

Draws the opening range of a configurable session (start time and length in minutes, with a server time zone adjustment), the 1R and 2R levels above and below the box, and the session VWAP (tick volume, or real volume when the broker provides it). A small panel counts, over the last N finished sessions, how many broke the range up only, down only, on both sides, or not at all, and how often price reached 1R and 2R after the first break. The statistics are historical counts: they describe the past and do not predict anything. Only closed bars are used, so nothing repaints; optional popup, push and sound alerts fire once per direction per session when a closed bar closes outside the box. Eight buffers (range, targets, VWAP, break state) can be read from an Expert Advisor with iCustom(). Works on M1 to M30, recalculates only new bars and deletes its chart objects when removed. Read-only: it never trades. No DLLs, no web requests.

Draws the high and low of the Asia, London and New York sessions as boxes or lines extended to the end of the day, with configurable session hours and a server time zone adjustment. Optional previous day and previous week high/low. When a CLOSED bar breaks the high or low of a session that has already finished, it can raise a popup alert, a push notification and/or a sound, once per level per day. Alerts are evaluated on closed bars only, so they do not repaint. The 10 levels are exposed in indicator buffers, so an Expert Advisor can read them with iCustom(). It recalculates only new bars, works on any timeframe up to H1, and deletes all its chart objects when removed. Read-only: it never opens, modifies or closes a trade. No DLLs, no web requests.

Marks bullish and bearish engulfing, bullish and bearish pin bar and inside bar patterns with arrows, using closed bars only, so nothing repaints. The definitions (wick and body proportions, minimum bar size in ATR) are inputs, with an optional EMA trend filter. For each pattern a small panel shows a rolling historical statistic: the share of the last N resolved cases where price moved X ATR in the pattern direction before moving Y ATR against it, together with the number of cases. X, Y, N and the waiting time are inputs. The numbers describe what happened on your chart history; they do not predict the next trade. Optional alerts on closed bars (popup, push, sound). 20 buffers (signal, hit rate and sample size per pattern) can be read with iCustom(). Uses prev_calculated, deletes its chart objects when removed. Read-only: it never trades. No DLLs, no web requests.

Utility Expert Advisor that watches the account equity against two limits: a maximum daily loss and a maximum total drawdown. Each limit can be set as a percentage or as a money amount, and the daily loss can be measured from the balance or from the equity at the start of the day, as many prop firms do. When a limit is touched the EA closes all positions, deletes all pending orders and keeps the account locked until the next trading day: anything opened in the meantime, by another EA or by hand, is closed again. Optional early warning at a percentage of the limit (Alert and push), a small on-chart panel, a magic number / symbol filter, a configurable day-reset time and retries when a close fails. The state is stored in terminal global variables, so a restart does not unlock the account. Works on hedging and netting accounts. No DLLs, no web requests. It never opens trades (only the optional Strategy Tester demo mode does).

Exports your closed trade history to a CSV file with one row per position (not per deal), ready for Excel, Python or any journal. Each row has ticket, symbol, magic number, comment, side, volume, entry and exit time and price, duration, initial SL and TP when known, gross profit, commission, swap, net result and R multiple. It also calculates MFE and MAE (best and worst price reached while the trade was open, in points and in money) from the M1 bars between entry and exit, plus the entry session (Asia, London, New York) and weekday. Filter by magic number (lists and ranges) and symbol (wildcards), pick the period, the column separator (; or ,) and the decimal mark, and save to MQL5\Files or the common folder. Tested on hedging accounts and in the Strategy Tester (netting logic included; feedback welcome), where the file is written when the test ends. Read-only: it never opens, modifies or closes a trade. No DLLs, no web requests.

XAUUSD grid EA that opens a basket when RSI leaves oversold or overbought on a closed candle, adds levels with a lot multiplier and closes the basket at a money or points target. Open source code.

Aynı hedging hesabında başka bir EA tarafından açılan, değiştirilen ve kapatılan işlemleri, sihirli numara ile seçerek yansıtır. Varsayılan olarak yönü tersine çevirir (Alış↔Satış, SL↔TP); böylece bir stratejinin tersini gerçek spreadler, kayma ve işlem koşullarıyla ileriye dönük test edebilirsiniz.

Olsen grubunun Alpha Engine’inin bir uyarlaması: Sekiz adet limit emri ajanı, bir riskten korunma hesabında içsel zamana dayalı yön değişiklikleri üzerinden işlem yapmaktadır. Bu ajanlar, fiyatların hedef seviyeyi aşması durumunda pozisyonlarını artırır ve ters yönlü hareketlerde kâr elde ettiklerinde pozisyonlarını azaltır.

Manages positions that are already open: it adds a missing SL/TP, moves the stop to break even, trails it, caps the position count and applies daily equity limits. It never opens trades.

Draws the high and low of a chosen time window and alerts on the first break on each side. The levels are also available through iCustom.

Close all positions panel for MT5: seven buttons to close all, buys, sells, winners, losers, the chart symbol or delete pending orders, on Gold (XAUUSD), forex or any symbol, for manual trades and any EA. Open source code.

Auto Fibo Extended is a MetaTrader 5 indicator designed to automatically identify significant swing highs and swing lows and draw Fibonacci Retracement and Extension levels directly on the chart.

A stop distance in points is not money until the tick size and tick value make it one. This library turns four risk bases into a lot size, floors it to the volume step, caps it against free margin and tracks a daily loss limit. Two MQL5 headers, no DLL.

A one-file library that handles how an EA trades: pre-trade checks, normalisation to broker limits, safe retries, one order per signal, isolation by magic number and state recovery after a restart. Lot by risk, daily loss limit and equity floor included. Verified in the Strategy Tester.

A regime-classification oscillator that measures how far, and how persistently, price deviates from a rolling volume-weighted VWAP in standard-deviation units, separating trending conditions from ranging ones.

A small include class that stops indicator alerts from firing on every tick. One alert per event and bar, silent about history on start, popup, push, email or sound, and an optional log of every decision. Comes with a working range break indicator as an example

İddialara güvenmek yerine, bir göstergenin yeniden çizilip çizilmediğini ölçer. Halihazırda kapanmış çubuklarda herhangi bir özel göstergenin tamponlarını yeniden okur ve değişen, ortaya çıkan veya kaybolan her değeri sayar; bu durumun en son gerçekleştiği en eski zaman noktasını belirler. Grafik panelinde tampon başına sonuç gösterilir; her olay CSV dosyasına kaydedilir.

Stop emirlerinin muhtemelen nerede durduğunu ve hangilerinin az önce tetiklendiğini gösterir. Likidite havuzları = fiyatın henüz aşmadığı teyit edilmiş salınım yüksek ve düşük seviyeleri, eşit yüksek/düşük seviyeler (daha büyük bir havuz) ve dünkü en yüksek ve en düşük seviyelerdir. Bir çubuk bir havuzun ötesinde işlem gördüğünde "süpürülmüş" olarak işaretlenir; aynı çubuk tekrar havuzun içinde kapanırsa "yakalanıp reddedilmiş" olarak işaretlenir. Yeniden çizilmezlik: bir salınım, her iki tarafta N adet kapalı çubuktan sonra kullanılır. Panel, bir CCanvas üzerine çizilmiş neon ışıklı bir şehirdir: fiyat uçan bir arabadır, satış stopları onun altındaki kulelerdir, alım stopları ise üstündeki yüzen platformlardır; dünkü seviyeler altın renkli reklam panolarıdır; bir projektör gökyüzünü tarar ve bir ticker bugünün yakalamalarını gösterir. İki tampon, bir Uzman Danışman'da kullanılmak üzere yukarı ve aşağı yöndeki en yakın aktif havuzu gösterir. Yalnızca gösterge: asla işlem yapmaz.

Tests "buy at hour X, exit Y hours later" on your broker's own history after spread, commission and swap, with an out-of-sample split, weekday/year breakdown and an all-hours baseline.