Alım-satım robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Telegram ü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 Komut Dosyası Kaynak Kodları

icon

Komut dosyaları, bir MQL5 programı kullanarak MetaTrader 5'te tek seferlik eylemler gerçekleştirir ve hemen ardından grafikten silinir. Örnek işlevler olarak, işlem geçmişini yükleme, rapor oluşturma ve bu raporu e-posta ile gönderme, bir dosyadan veri indirme ve bu veriyi işleme söylenebilir. Komut dosyaları ayrıca grafik arayüzü oluşturmak veya tek tip alım-satım işlemlerini hızlı bir şekilde yürütmek (örneğin tüm pozisyonları hemen kapatmak) için de kullanılabilir.

Sunulan komut dosyalarını MetaTrader 5'te indirebilir ve başlatabilirsiniz. Komut dosyası kütüphanesine, MQL5 programlamayı öğrenmenize olanak sağlayan MetaEditor geliştirme ortamından da doğrudan erişebilirsiniz.

Kod ekle

A script for accounts that run several Expert Advisors or configurations. It aggregates the net result of each configuration (magic number, or magic number and symbol) per calendar day and measures how much each one contributes to the portfolio drawdown: drawdown added by leave-one-out, share of the worst drawdown, and Euler variance share. It prints verdicts, recommendations, and a heuristic A+ to F score. It runs out of the box on a built-in demonstration portfolio and is written in pure MQL5.

Exports bars to a CSV file that pandas.read_csv() loads without encoding, separator or date-format arguments: ISO 8601 timestamps, prices at the symbol's own digits, single-byte encoding. Two modes (last N bars or a date range) and a switchable separator for Excel.

Shows what every buffer of an indicator holds - arrows, a line or a colour index - and labels the arrows on the chart with their buffer numbers. Works with compiled indicators without source code.

Calculates the lot size for a chosen risk percent and stop loss distance, and shows the result in a clean panel on the chart.

Read-only MT5 script for exact Market Watch symbols: contract and volume rules, quote age and spread, isolated BUY/SELL margin, one-tick price moves and spread-only results in account currency. MIT source; Experts journal output.

Writes the trading specification of every symbol to a CSV file: volume step, filling modes, stops level, tick value and more.

Her M1 çubuğunda sanal bir parantezli işlem açar, bunu gerçek tik geçmişi üzerinde ilerletir ve çeşitli stop mesafeleri için 1 dakikalık OHLC modellemesinin işlemi ne sıklıkla ters yönde değerlendireceğini raporlar.

Kapanan her işlem için, hesap özetinde yer almayan rakamları içeren bir CSV satırı dışa aktarır: işlemin gösterdiği en yüksek gerçekleşmemiş kâr (MFE), atlattığı en kötü gerçekleşmemiş zarar (MAE), MFE’nin ne kadarının fiilen elde edildiği, kaç çubuk boyunca sürdüğü ve ne kadar süreyle açık kaldığı. Trade Excursion göstergesiyle aynı ölçümler, grafikte gösterilmek yerine bir dosyaya yazılır; çünkü bu verilerle ilgili sorulması gereken sorular, bir grafiğin cevaplayamayacağı sorulardır: yakalama oranı giriş saatine bağlı mıdır? Erken kapattığım işlemler, en uzun süre tuttuklarım mı? Pazartesi günleri gerçekleşen zararlı işlemlerin MAE değeri, Cuma günlerinkinden farklı mı? CSV dosyası hazır olduğunda, bu soruların yanıtlarını bir pivot tablo ile kolayca elde edebilirsiniz. Çıktı, MQL5\Files dizininde başlık satırı ile birlikte noktalı virgülle ayrılmış haldedir; herhangi bir elektronik tabloda açılabilir. Ölçüm sınırı: sapmalar, seçilen zaman dilimindeki çubukların en yüksek ve en düşük değerlerinden elde edilir; çubuk içindeki yol bilinmemektedir. Çubuklar sütunu, her işlemin elde ettiği çözünürlüğü bildirir ve özet, tek çubuklu işlemleri ortalamak yerine ayrı ayrı sayar.

Measures how far your PC clock is from the trade server's clock, from the server time stamped on live ticks, and tells you how to fix it.

Basit bir komut dosyası kullanarak MetaTrader 5 AI Asistanınızı seçilebilir dil, kişilik, menü ve davranış seçenekleriyle özelleştirin.

Exports closed trades to CSV with Maximum Adverse Excursion (MAE) and Maximum Favorable Excursion (MFE) in points and money, calculated from M1 history, plus the percentage of the available move each trade captured.

Opens charts for all Market Watch symbols or a custom symbol list in one click, on any timeframe, with an optional template applied to each chart. Skips charts that are already open and limits how many are opened at once.

Resamples your closed trades 10,000 times to show whether your average trade is an edge or could still be luck: the 95% range of the average and the chance it is below zero.

Tests whether live closing deals still match the backtest of an Expert Advisor. A bootstrap-calibrated CUSUM detector raises an alarm and estimates when the drift began, a two-window check separates a short dip from a lasting decline, and an expectancy decomposition shows whether the win rate or the trade sizes changed. The script generates demonstration data on the first run and is written in pure MQL5.

Script that lists the global variables of the terminal with value, last access time and age, filtered by prefix, substring and age. It exports them to CSV, deletes the matching ones after a confirmation and a backup, and restores them from a CSV file.

Bir çizim göstergesinin yeniden çizilip çizilmediğini ölçer; çizilmediğini iddia etmek yerine. Değişmezlik kuralı: Bir çubuk kapandıktan ve işlendikten sonra, üzerine çizilen hiçbir nesne asla değişmemelidir — hareket etmemeli, rengi değişmemeli, metni değişmemeli ve kaybolmamalıdır. Komut dosyası, gerçek geçmiş verileriyle özel bir sembol oluşturur, şablon aracılığıyla göstergenizi ekler, her nesneyi kaydeder, çubukları ekler, tam bir yeniden hesaplama yapar ve nesneleri tek tek karşılaştırır. Değişiklikler ve kaybolmalar ayrı ayrı sayılır, çünkü yalnızca bir değişiklik olması iddianın yanlış olduğu anlamına gelir. Hiçbir şeyi karşılaştırmayan bir çalıştırma, ASLA "geçti" olarak değil, "SONUÇSUZ" olarak raporlanır. Çıktı, sayının yanında yayınlayabileceğiniz bir CSV dosyasıdır.

Neural Loss-Pattern Auditor, davranışsal ve piyasa bağlamına ilişkin özelliklerin hangi işlemlerin zarar etme olasılığının daha yüksek olduğunu öngörüp öngörmediğini test etmek amacıyla, tamamen sıfırdan yerel MQL5 dilinde yazılmış küçük bir ileri beslemeli sinir ağını, kapatılmış işlem geçmişi üzerinde eğitir. Bu araç, basit bir temel referans değerine kıyasla doğruluk artışını, bir olasılık kalibrasyon tablosunu, permütasyon özellik önem sıralamasını ve öneriler içeren yapılandırılabilir bir A-F bileşik notunu raporlar. İlk çalıştırmada yerleşik bir sentetik demo kullanır, böylece herhangi bir kurulum gerektirmeden çıktı hemen görülebilir; bunun yerine gerçek hesap geçmişini analiz etmek için bir girişi InpUseDemoData=false olarak değiştirin. Saf MQL5: harici kütüphaneler, Python ve herhangi bir türde yapay zeka hizmeti içermez.

Bir giriş sinyalinin, bu sinyal üzerine haftalarca süren bir EA geliştirme çalışmasına girişmeden önce, gerçekten işlem maliyetlerini karşılayıp karşılamadığını ölçer. Maliyet düşüldükten sonraki net sonucu, birbiriyle örtüşmeyen örneklemler üzerinde hesaplanan güvenilir bir t-istatistiği ve rastgele bir kontrol sunar. Hiçbir emir vermez.

Emirleri sessizce reddeden görünmez sözleşme sınırlarını görüntüler: durdurma seviyesi, dondurma seviyesi, minimum/adım/maksimum lot, tik boyutu ve değeri, spread türü, yürütme modu, swaplar ve serbest marjınıza karşı minimum lot için gereken marj.

Mevcut durum, bir sonraki geçiş, çoklu sembol kapsamı ve CSV'ye aktarma özelliklerine sahip, salt okunur, broker tabanlı işlem oturumu denetleyicisi.

Broker hacmi, fiyat, stop emirleri, donma, spread ve işlem kısıtlamalarını bildiren, salt okunur bir MT5 komut dosyası.

MT5 EA’nın giriş durumu mantığı için, piyasaya, hesaba veya emirlere erişim olmaksızın gerçekleştirilen deterministik sentetik kabul testleri.

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.

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.

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.

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.

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.

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 read only MT5 script that reports broker symbol specifications, volume limits, price settings, execution modes, trading permissions, margin requirements and estimated profit values.

Bu komut dosyası, M1 çubuklarının spread alanından brokerınızın gerçek spread değerini toplar ve medyanı, 90. ve 99. persentilleri fiyat birimlerinde, puan olarak ve ATR'nin kesirleri olarak yazdırır; ayrıca her saat için ortalama ve maksimum spread değerlerini CSV dosyasına kaydeder. Bu, stratejileri kafanızdaki "tipik" spread yerine, hesabınızın gerçek maliyetlerine göre test etmek için gereklidir.

Kapalı pozisyonların işlem geçmişini (bir CSV dosyası veya RuinExport.mq5 komut dosyası tarafından mevcut hesabın işlem geçmişinden otomatik olarak oluşturulan bir dosya) okur ve dört bağımsız risk göstergesini raporlar: zarar sonrası hacim artışı, ortalama fiyatı daha kötü hale getiren aynı yöndeki örtüşen pozisyonlar, kazançlar ve zararlar arasındaki getiri asimetrisi ve işlem başına belirtilen risk düzeyinde klasik iflas riski tahmini. Bu dört puan, sade bir dille yazılmış önerilerle birlikte tek bir A'dan F'ye kadar not sistemine dönüştürülür. CSV dosyası bulunmazsa, komut dosyası otomatik olarak tekrarlanabilir bir örnek işlem defteri oluşturur; böylece rapor ilk çalıştırmada görüntülenebilir.

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.

Read-only MT5 script that estimates stop-distance cash loss in account currency, reserves explicit cash costs and floors volume to the broker grid. It never sends or modifies an order.

A native MQL5 tool that reconstructs closed positions from deal-level history, flags the ones closed through more than one exit, and reprices each one at its own first, last, and best exit rates to measure whether scaling out actually added value. Reports a Value-Add Ratio, a Scale Out Win Rate, an Efficiency figure, and a single-trade dependence check, combined into an A+ to F score with recommendations. Runs out of the box against a built-in demonstration data set; a companion script exports the real input file from your own account history. Pure MQL5, no external libraries.

Checks a hypothetical MT5 market or pending order against current symbol, volume, tick-size, stop-distance and filling rules without sending a trade.

Prints a privacy-conscious snapshot of the current MT5 broker, account, symbol and terminal environment to the Experts log for diagnostics and support.

12345678...10