라이브러리는 특정 기능을 포함하는 작은 하위 프로그램으로, 새로운 응용 프로그램을 개발하는 데 사용될 수 있습니다. 일단 작성되고 철저히 점검되면, 사용자는 라이브러리를 통해 새로운 MQL5 응용 프로그램의 개발 속도를 높일 수 있습니다. 예시 중 하나는 여러 수치 분석 함수를 포함하는 ALGLIB 라이브러리입니다.
MetaEditor에서 거래전략 개발 시 라이브러리 소스 코드를 다운로드하여 사용할 수 있습니다. 그것들은 MetaTrader 5에서는 독립적으로 실행할 수 없습니다.
위험 금액을 기준으로 한 포지션 규모는, 가정된 핍(pip) 값이 아닌 해당 종목의 실제 틱 값, 틱 크기 및 거래량 단위를 바탕으로 계산됩니다. 거래량은 항상 아래로 반올림되며, 위험 금액이 최소 랏보다 작을 경우 이를 알리고 해당 랏의 실제 비용을 보고합니다. 터미널 상태가 아니므로 포지션 크기 산정 로직을 오프라인에서 테스트할 수 있으며, 41개의 어설션으로 구성된 테스트 스크립트가 포함되어 있습니다.
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.
24개의 MQL5 클래스로 구성된 라이브러리로, 특정 계좌에 대해 프로프 펌의 규칙집(드로우다운, 일일 손실, 수익 지급 일관성, 최소 거래 일수, 뉴스 블랙아웃 등)을 모니터링하며, 규칙 위반 시 자체 포지션을 개설하지 않고 즉시 거래를 중단합니다.
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.
모든 금융 상품에 걸쳐 정확한 핍 값 계산과 동적 랏 크기 조정이 가능한, 가볍고 OOP를 준수하는 MQL5 헤더 클래스(.mqh)로, 자동 통화 간 환율 변환 및 브로커 거래량 정규화 기능을 갖추고 있습니다.
브로커가 어떤 명칭으로 부르든 상관없이 ‘골드’ 심볼을 감지하고, 계약 사양을 임의로 가정하지 않고 터미널에서 직접 읽어오며, 계좌 통화로 표시된 위험 금액을 해당 브로커에 맞는 정확한 랏 크기로 변환합니다.
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.
MQL5에 Rust 스타일의 Result 타입을 도입하는, 크기가 작고 의존성이 적은 라이브러리입니다. 함수는 전역 GetLastError() 상태에 의존하는 대신 단일 값 또는 오류 객체를 반환하므로, 오류가 명확하게 드러나 무시할 수 없습니다. 이 라이브러리에는 ResultValue(값형) 및 Result(포인터로 참조되는 객체), Error 구조체, 조기 반환 매크로(TRY, RETURN_ON_ERROR 등)와 선택적 Then/Match/MapError 콜백이 포함되어 있습니다.
Advanced MQL5 risk management class providing deterministic lot sizing, auto-suffix detection, and cross-currency triangular conversion.
MQTTFive — MQL5용 MQTT 5.0 클라이언트의 완전한 구현체입니다. 기능: • MQTT v5.0 — 모든 패킷 유형, 속성, QoS 0/1/2 • 네이티브 MQL5 소켓 API를 통한 TCP + TLS • 속성(will_delay_interval, payload_format, message_expiry)이 포함된 Will 메시지 • 발신 PUBLISH용 Topic Alias • 흐름 제어(수신 최대값) • 구독 옵션(no_local, retain_as_published, retain_handling) • 바이너리 및 UTF-8 페이로드 • QoS 1/2에 대한 자동 재시도 • DLL 의존성 없음 — 순수 MQL5 Mosquitto 5.0에서 테스트 완료 (15회 테스트, 모두 통과). 문서: https://github.com/chekh/MQTTFive 라이선스: MIT
정적 리테일 리스크 모델을 기관용 변동성 조정 포지션 크기 조정(VAPS) 및 켈리 기준 수식으로 대체하는 객체 지향 MQL5 라이브러리(.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.
기술적 세부 사항 현재 매수/매도 호가로 즉시 시장가 청산을 위해 TRADE_ACTION_DEAL과 함께 MQL5의 OrderSend를 사용합니다. 슬리피지 허용 오차(10포인트), 적절한 거래량 매칭, 매직넘버 보존 기능이 포함되어 있습니다. 실행 중 지수 이동을 방지하기 위해 포지션을 역순으로 반복합니다.
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.
Institutional risk analysis library for MetaTrader 5. Zero external dependencies. Pure MQL5 mathematics.
Complete deep learning library in pure MQL5. Build, train and deploy neural networks natively in MetaTrader 5. No DLLs, no Python, no external APIs.
거래 작업 전에 터미널 핑 + 실행 대기 시간을 결합하여 검증하는 클래스를 포함합니다. 임계값을 초과하면 false를 반환합니다.
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.
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.
Expert Advisor 코드에 액세스할 수 있는 경우 이 라이브러리에서 코드를 추가하여 잔고 및 주식 차트를 저장하고 최적화 기준을 추가로 계산할 수 있습니다.