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?

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

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.

Sizes your next trade based on the correlated risk you already have open across other positions — not just the trade in isolation.

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.

MetaTrader 5 için profesyonel bir açık kaynaklı Mum Gücü Analizcisi. Mum gövdesini, üst ve alt fitilleri, alıcı/satıcı baskısını, reddedilme durumlarını, aralık genişlemesini ve mum gücünü gerçek zamanlı olarak analiz eder.

MetaTrader 5 için, mevcut manuel veya EA pozisyonlarını ayarlamak üzere özel olarak tasarlanmış grafik üzerinde işlem yönetimi aracı. Break-Even yerleştirme, nokta ofsetleri, kar kilitleme, takip eden stoplar, Risk-Ödül (1R–3R) Kar Al hedefleri ve hacim doğrulamalı kısmi kapatmalar (%25–%100) için tek tıklamayla kontrol özellikleri sunar. Sürüklenebilir grafik kullanıcı arayüzü ve sembol ile yön bazında filtreleme içerir. Yeni işlemler açmaz.

A small educational Expert Advisor showing how a classic Donchian breakout can be applied directly to completed Renko bricks.

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.

An Expert Advisor that trades the SuperTrend TV indicator through iCustom on closed bars only, shipped with the audit that proves every trade matches a signal and no signal was missed

Attach it to a chart, type the name of any custom indicator, and it alerts you on that indicator's own buffers - popup, sound, push notification to your phone, or email. It reads the indicator through iCustom, so no source is needed: a compiled .ex5 you downloaded is enough. It can also read that indicator from a higher timeframe, and it re-checks closed bars to tell you whether the indicator repaints or merely lags. It opens in EXPLORE mode, which lists every buffer the indicator has and what is in each one, because "which buffer holds the signal" is the question that stops most people using iCustom at all.

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

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.

MetaTrader 5 için profesyonel, açık kaynaklı bir Risk Hesaplayıcı. Para riskini, hesap risk yüzdesini, potansiyel kârı, Kâr-Risk oranını, teminat gereksinimini ve risk seviyesini hesaplar.

MetaTrader 5 için profesyonel, açık kaynaklı bir Teminat Hesaplayıcı. Modern bir Quantora kontrol paneli aracılığıyla gerekli teminat, Serbest Teminat etkisi, Teminat Seviyesi, pozisyon değeri ve teminat güvenliği değerlerini hesaplar.

Draws Sydney, Tokyo, London and New York as high/low boxes with the London-New York overlap outlined and the rollover hour shaded. Session times in GMT, broker offset detected automatically, average range of the last N sessions on every label, optional alert at session open.

A lightweight memory meter dashboard that reveals current MT5 memory usage and key resource statistics directly on the chart.

Customize your MetaTrader 5 AI Assistant with selectable language, personality, menu and behavior using a simple prompt file.

Everyone running a grid asks: is my account big enough? The usual answer - the loss at the last grid level - is the wrong number. What ends the account is the margin level reaching the broker's stop-out, while the chain is still open and still looks recoverable. This EA computes the real figure, then counts how often a move that large has already happened on the symbol's own M1 history. Three mistakes it fixes, all erring in the reassuring direction: a chain of N legs floats at step x N(N-1)/2, not step x N (at 10 legs, 45 steps of loss, not 10); open positions also lock up margin while they float; and stop-out is a percentage, not zero - at 50%, losing half the equity is enough. "You need 86 dollars of room" is an abstraction. "A move that size happened 71 times in 100 days, one every 1.4" is a decision. Set InpEquity to a size you do not have yet to see what the configuration would really need. Strictly read-only: it never opens, closes or modifies a position.

The Advanced Harmonic & RSI Reversal Scanner solves both problems. By combining precise Fibonacci geometry (to find the location of a reversal) with an RSI exhaustion filter (to time the exact moment of the reversal), this script prevents you from catching falling knives

Reports, month by month, whether your symbol really has ticks or only bars - so you know which part of your backtest ran on generated ticks before you trust the curve. The Strategy Tester gives you one History Quality figure after the test has finished, and it never says which months were the problem. This script asks first.

Sürükle ve bırak özelliğine sahip grafik çizgileri, risk yüzdesine dayalı dinamik lot belirleme, ATR/Puan Stop Loss modları ve gerçek zamanlı değişken kâr/zarar izleme özelliklerini barındıran basit bir MQL5 işlem yönetimi paneli.

Global Macro Soros. George Soros’un makro ticaret tarzından esinlenerek geliştirilmiş, çoklu zaman dilimlerinde trend uyumu gösteren bir gösterge.

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.

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.

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

Records the maximum favourable and adverse excursion of every position in R multiples and writes one CSV row per closed trade.

Session-range breakout EA with ATR filtering, stop-distance sizing, optional break-even/partial close, and a shared chart desk. Hedging accounts; educational source with documented execution and coordination limits.

Concept: Identifies market microstructure turning points based on ICT/SMC principles.

Sembolik Toplam Yaklaşımı (SAX) yöntemiyle oluşturulmuş bir tahmin modeli

Kapalı işlem geçmişinizi okuyan ve kazanma oranını, kâr faktörünü, galibiyet serilerini ve sermaye eğrisini gösteren, hafif ve grafik üzerinde yer alan bir gösterge paneli — strateji girdisi gerekmez, sadece kendi verileriniz kullanılır ve veriler otomatik olarak güncellenir.

Detects order blocks — the last opposing candle before an impulsive move that breaks market structure — and draws them as zones that extend live until price returns and mitigates them. Structure breaks and mitigation are both evaluated only on closed bars, so nothing repaints.

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.

Heikin Ashi mum çubuklarını çizen, onaylanmış alım ve satım okları sunan, isteğe bağlı MACD histogramı sapma filtreleme özelliğine sahip ve yapılandırılabilir uyarılar içeren bir MetaTrader 5 grafik göstergesi.

Birden fazla Uzman Danışman çalıştıran hesaplar için salt okunur analizler. Bu analiz, kapanmış işlemleri “magic number” (benzersiz kimlik numarası) bazında gruplandırır ve bu sistemlerin birlikte çalıştırılmasının size gerçekte ne kadar tasarruf sağladığını ölçer: tek başına ve birleştirilmiş durumdaki değer kaybı karşılaştırması, grafikte ısı haritası olarak gösterilen ikili korelasyon matrisi ve portföyün dönem getirilerinin Monte Carlo yöntemiyle yeniden düzenlenmesi.

A closed-bar M5 indicator combining market structure, liquidity sweeps, BOS/CHoCH and momentum to display Entry, SL, TP1 and TP2, with retail-frequency signals and clickable setup history.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205