목적
이 포함 파일은 MQL5용 '값 또는 오류' 반환 유형을 제공하므로, 함수는 전역 변수인 GetLastError() / ResetLastError() 상태를 통해 처리하는 대신 성공 또는 실패를 명시적으로 보고할 수 있습니다. 전역 변수 방식은 잊어버리기 쉽고, 덮어쓰기 쉬우며, 아웃 매개변수와 "마법 같은" 반환 값을 강제로 사용해야 하는 단점이 있습니다.
기능
함수는 값을 포함하거나 오류를 포함하는 하나의 객체를 반환하며, 호출자는 값을 사용하기 전에 이를 확인해야 합니다.
액세서: Value (), ValueOr (fallback), CurrentError (), IsError ().
사용법
// 스테이지 함수 (최상위 수준 — MQL5에는 클로저가 없음) ResultValue<double> EnsurePositive(const double &value) { if (value <= 0.0) { return ResultValue<double>::Fail("price must be positive"); } return ResultValue<double>::Ok(value); } ResultValue<double> ToPips(const double &price) { return ResultValue<double>::Ok(price / _Point); } Error Describe(const Error &error) { return Error::Create(error.code, "pipeline failed: " + error.description); } void OnOk(const double &value) { PrintFormat("[pipeline] result = %.1f pips", value); } void OnFail(const Error &error) { PrintFormat("[pipeline] %s", error.description); } // 파이프라인: 읽기 -> 유효성 검사 -> 변환 -> (오류 주석 달기) -> 처리 void RunPipeline() { SymbolDouble("EURUSD", SYMBOL_BID) .Then(EnsurePositive) .Then(ToPips) .MapError(Describe) .Match(OnOk, OnFail); }
MetaQuotes Ltd에서 영어로 번역함.
원본 코드: https://www.mql5.com/en/code/74427
Mediana Trendline
Draws parallel trend channels (Median, High, Low) on the current chart based on the last two closed candles of up to 7 higher timeframes (MN1, W1, D1, H4, H1, M30, M15), with individually configurable colors and line styles for each timeframe.
Advanced Risk Manager: Auto Suffix Detection Multi Currency Lot Sizer
Advanced MQL5 risk management class providing deterministic lot sizing, auto-suffix detection, and cross-currency triangular conversion.
Pip Value Calculator
실시간 PIP 값, 리스크 기반 로트 크기 설정, 맞춤형 거래량 리스크 분석 및 미결제 포지션 손익 — 이 모든 기능을 하나의 패널에서 확인하세요.
SniperGold SMC ProPlus (Institutional Smart Money Concepts)
SMC chart indicator: market structure (BOS/CHoCH), volume weighted order blocks, multi timeframe FVG, equal highs/lows, liquidity sweeps, premium/discount zones, a 3 time frame bias panel and an optional trade setup readout. Closed bar logic only (no repaint). It draws and alerts, it does not place trades.