MetaTrader 5 için MQL5 Kütüphane Kaynak Kodları - 2

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

Fits GARCH(1,1), GJR-GARCH and EGARCH with normal, Student t or GED shocks by maximum likelihood, with robust standard errors and variance forecasts.

Geriye dönük testlerde de çalışan gerçek bir ekonomik takvim haber filtresi. Bir komut dosyası yardımıyla olayları tek seferde dışa aktarın, ardından hem canlı ortamda hem de Strateji Testçisi’nde haberler etrafındaki yeni girişleri engelleyin. Tarihsel takvim saatlerinde görülen bir saatlik yaz saati uygulaması kaymasını düzeltir.

Portfolio weights from the returns of symbols or Expert Advisors: inverse volatility, risk parity, hierarchical risk parity, minimum variance, maximum diversification, Ledoit-Wolf covariance.

Reads a Strategy Tester report saved as HTML into its deals, closed trades, net profit and balance drawdowns, for comparing, combining or exporting backtests.

Single-header account lock for MT5 EAs: licensed account numbers, optional demo allowance, expiry date, tester bypass. Licence compiled in with #define. No DLL.

EA’nızdaki her bir pozisyon türünü tek bir sermaye eğrisine toplu olarak dahil etmek yerine, her birini ayrı bir kayıtta puanlar. Başlatma sırasında hesabın işlem geçmişinden kendini yeniden oluşturur; böylece yeniden başlatma işlemi kayıtları silemez. Ham kazanma oranının yanına bir Wilson puanı alt sınırı gösterir; böylece üç işlemlik bir galibiyet serisi artık bir avantaj gibi görünmez.

AttachExpert.mqh attaches an Expert Advisor to a chart from MQL5 code, with the inputs you choose and with "Allow Algo Trading" on or off.

Farklı işlevlere sahip üç pozisyon büyüklüğü koruma mekanizması; bunların birbiriyle karıştırılması, pek çok hesabın tamamen silinmesine neden olmaktadır: - merdiven: bakiyenin her X birimi başına bir kontrat; manuel lot belirleme durumunda bile her zaman bir üst sınır (CAP) olarak uygulanır; - floor: minimum sermayenin altına düştüğünde işlem yapmaz; yeni bir para yatırımı gerekir; - breaker: hesap büyüklüğü ne olursa olsun, zirvenin X% altına düştüğünde durur ve kendi kendine yeniden etkinleşmez. Bu kütüphanenin çözdüğü ve neredeyse hiçbirinin çözemediği sorun: para yatırımı kâr değildir ve para çekme işlemi de zarar değildir. Breaker, düşüşü bakiye zirvesine göre ölçer. Bu durum dikkate alınmazsa, bir düşüş SIRASINDA yapılan para yatırma işlemi hem bakiyeyi hem de zirveyi yükseltir ve koruma, tam da yardımcı olacağı anda düşüşü algılamayı durdurur. Burada para yatırma ve çekme işlemleri, zirveyi aynı miktarda kaydırır. Zirve değeri bir dosyaya kaydedilir: terminal yeniden başlatıldığında zirve değerini unutan bir kırıcı, gerçek bir kırıcı değildir. Demo, düşüşün en dip noktasında yapılan bir para yatırma işlemini simüle eder. Para yatırma seçeneğini açık ve kapalı olarak çalıştırın ve "düşüş" sütununu karşılaştırın.

Pozisyon büyüklüğü, varsayılan bir pip değeri yerine, sembolün gerçek tik değeri, tik büyüklüğü ve hacim adımı temel alınarak hesaplanan risk tutarına göre belirlenir. Hacim her zaman aşağı yuvarlanır; risk tutarınız minimum lot büyüklüğünden daha küçükse bunu belirtir ve söz konusu lotun gerçek maliyetini bildirir. Terminal durumu bulunmadığından, pozisyon büyüklüğü hesaplama mantığı çevrimdışı olarak test edilebilir; 41 onaylamadan oluşan bir test komut dosyası dahildir.

Calculates the Strategy Tester report statistics from the deal history, including Z-Score, AHPR, GHPR, LR Correlation and LR Standard Error, which TesterStatistics() does not return. Checked value by value against the tester.

An include file that writes real Excel workbooks (.xlsx) from MQL5 without DLLs: several sheets, numbers, text and real Excel dates, a frozen bold header and filters. Example script: the account deals and the daily results to Excel.

A small include file that tells your Expert Advisor when it is inside a news window, using the economic calendar built into MetaTrader 5. No web requests and no DLL.

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.

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.

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.

123456789...12