Alım-satım robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Twitter ü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 Kütüphane Kaynak Kodları

icon

Kütüphaneler, yeni uygulamalar geliştirmek için kullanılabilecek belirli bir işlevsellik içeren küçük alt programlardır. Bir kütüphane yazıldıktan ve kapsamlı bir şekilde kontrol edildikten sonra, kullanıcıların yeni MQL5 uygulamalarının geliştirilmesini hızlandırmasına olanak tanır. Bunlardan biri, çoklu sayısal analiz fonksiyonlarına sahip ALGLIB kütüphanesidir.

Kütüphane kaynak kodları, alım-satım stratejileri geliştirilirken MetaEditor'da indirilebilir ve kullanılabilir. MetaTrader 5'te bağımsız olarak başlatılamazlar.

Kod ekle

Herhangi bir hesapta, bir prop firmasının kural kitabında belirtilen kriterleri (drawdown, günlük zarar, ödeme tutarlılığı, minimum işlem günü sayısı, haber kısıtlaması) izleyen ve ihlal durumunda kendi adına hiçbir pozisyon açmadan pozisyonu kapatan 24 MQL5 sınıfından oluşan bir kütüphane.

The library reconstructs a complete MQL4-style order model on top of the native MQL5 Position, Order, Deal, and History APIs. This design allows legacy MQL4 Expert Advisors to operate with minimal code changes while preserving MQL5.

Tüm enstrümanlarda doğru pip değeri hesaplaması ve dinamik lot büyüklüğü belirleme için tasarlanmış, otomatik çapraz döviz kuru dönüştürme ve broker hacim normalizasyonu özelliklerine sahip, hafif ve OOP uyumlu bir MQL5 başlık sınıfı (.mqh).

Aracı kurumun buna ne ad verdiği fark etmeksizin altın sembolünü algılar, sözleşme şartlarını varsaymak yerine terminalden okur ve hesap para birimindeki riski, o aracı kurum için doğru olan lot büyüklüğüne dönüştürür.

Look after open positions in an Expert Advisor: break-even, trailing stop, two partial closes, and a stop and target for positions that have none. It never opens a trade.

A small include file for Expert Advisors and trade managers. It turns your risk rules into yes/no answers: how many lots does this stop allow, is the daily loss limit reached, is the maximum drawdown (static or trailing) reached, how much is at risk across all open positions, and are spread and session acceptable. The lot is never rounded up: if the broker minimum lot would risk more than allowed, the trade is skipped and the reason is returned. Limits survive a terminal restart. The library only measures: it sends no order. Includes a demo account guard (no trading by default) and a self-test with 78 checks.

A real economic-calendar news filter that also works in backtests. Export the events once with a script, then block new entries around news both live and in the Strategy Tester. Fixes the one-hour DST shift of historical calendar times.

Scores every setup type in your EA on its own record instead of lumping them into one equity curve. Rebuilds itself from the account's deal history on init so a restart cannot wipe the record. Prints a Wilson score lower bound next to the raw win rate so a three trade hot streak stops looking like an edge.

Position size from a risk amount, computed from the symbol's real tick value, tick size and volume step rather than an assumed pip value. It always rounds volume down, and when your risk is smaller than the minimum lot it says so and reports what that lot actually costs. No terminal state, so the sizing logic is testable offline - a 41-assertion test script is included.

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.

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.

Kanal tabanlı göstergeler için yakınlık sinyallerini almak üzere tasarlanmış bir kütüphane

MQL5’e Rust tarzı bir Result türü getiren, küçük ve bağımlılık sayısı az olan bir kütüphane. İşlevler, küresel GetLastError() durumuna güvenmek yerine tek bir değer-veya-hata nesnesi döndürür; böylece hatalar açıkça belirtilir ve göz ardı edilmesi imkânsız hale gelir. ResultValue (değer türleri) ve Result (işaretçi tarafından tutulan nesneler), bir Error yapısı, erken dönüş makroları (TRY, RETURN_ON_ERROR, ...) ve isteğe bağlı Then/Match/MapError geri çağırma işlevlerini içerir.

Advanced MQL5 risk management class providing deterministic lot sizing, auto-suffix detection, and cross-currency triangular conversion.

MQTTFive — MQL5 için tam özellikli bir MQTT 5.0 istemcisi. Özellikler: • MQTT v5.0 — tüm paket türleri, özellikler, QoS 0/1/2 • Yerel MQL5 Socket API üzerinden TCP + TLS • Özellikler içeren Will mesajları (will_delay_interval, payload_format, message_expiry) • Giden PUBLISH mesajları için Konu Takma Adı • Akış Kontrolü (Alım Maksimumu) • Abonelik Seçenekleri (no_local, retain_as_published, retain_handling) • İkili ve UTF-8 yükleri • QoS 1/2 için otomatik yeniden deneme • Sıfır DLL bağımlılığı — saf MQL5 Mosquitto 5.0 ile test edilmiştir (15 test, hepsi PASS). Belgeler: https://github.com/chekh/MQTTFive Lisans: MIT

MetaTrader 5 için kurumsal destek firması koruma kütüphanesi.

Statik perakende risk modellerini kurumsal Volatilite Ayarlı Pozisyon Boyutlandırma (VAPS) ve Kelly Kriteri matematiği ile değiştiren nesne yönelimli bir MQL5 kütüphanesi (.mqh).

ASQ Order Executor — Institutional order execution wrapper for MQL5 EAs ASQ Order Executor provides institutional-grade order execution with automatic retry logic, slippage monitoring, partial fill handling, requote management, and comprehensive execution statistics. Drop it into any EA for production-ready trade execution.

Depozito yüzdesinden lot hesaplama fonksiyonu

Teknik Detaylar Mevcut Alış/Alış fiyatlarında anında piyasa kapanışı için TRADE_ACTION_DEAL ile MQL5'in OrderSend özelliğini kullanır. Kayma toleransı (10 puan), uygun hacim eşleştirme ve sihirli sayı korumasını içerir. Yürütme sırasında endeksin kaymasını önlemek için pozisyonlar arasında geriye doğru döngüler.

Institutional-grade forex session detection and analysis library for MetaTrader 5.

Economic calendar trading guard library for MetaTrader 5 with live MQL5 Calendar API integration.

A comprehensive stop-loss and trade management module offering multiple stop-loss methods (Fixed Pips, ATR-based, Swing High/Low, and Percentage) and trailing stop options (Fixed, ATR, Step, and Breakeven). It includes automatic broker stop-level adjustment, risk-reward–based take profit calculation, and visual stop-loss lines on the chart. The code follows a clean, structured architecture with a dedicated `CStopLossManager` class, standardized enums and structures, and fully documented English comments for clarity and maintainability.

Intelligent anti-tilt risk management library for MetaTrader 5.

Professional Telegram integration library for MetaTrader 5 EAs.

Runtime trade frequency adjustment library for MetaTrader 5.

Institutional risk analysis library for MetaTrader 5. Zero external dependencies. Pure MQL5 mathematics.

Centralized indicator handle management library for MetaTrader 5 EAs.

Complete deep learning library in pure MQL5. Build, train and deploy neural networks natively in MetaTrader 5. No DLLs, no Python, no external APIs.

Ticaret işlemlerinden önce birleşik terminal ping + yürütme gecikmesini doğrulayan sınıfı dahil edin. Eşik aşılırsa false döndürür.

A professional object-oriented MQL5 library designed for quantitative developers. It provides asynchronous order execution and dynamic slippage control to prevent terminal freezing during high-frequency algorithmic trading.

LLM'lerin yoğun kullanımı ve daha düşük gecikme süresi için tasarlanmış bir JSON kütüphanesi.

Bellek tüketiminin izlenmesi.

Include-file class that measures inter-tick latency, filters false alarms via a self-normalising ATR volatility gate, and broadcasts persistent lag alerts to other EAs via GlobalVariable IPC.

Uzman Danışman koduna erişiminiz varsa, bu kütüphaneden ek kod ekleyerek denge ve öz sermaye grafiklerini kaydedebilir ve ek optimizasyon kriterlerini hesaplayabilirsiniz.

EA'nın koşullara bağlı olarak grafikte yinelenen EA'lar olup olmadığını belirlemesine izin verin.

Filter trades by trading sessions (London, NY, Tokyo, Sydney)

Açık pozisyonları ve bekleyen emirleri değiştirme işlevi

1234567891011