거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

Advanced Risk Manager: Auto Suffix Detection Multi Currency Lot Sizer - MetaTrader 5용 라이브러리

조회수:
180
평가:
(1)
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Purpose of the File

This professional MQL5 include file (.mqh) is engineered as a reusable, self-contained component designed specifically for advanced risk management and precise position sizing across diverse trading assets.

The Underlying Strategy and Core Concept

Many commercial Expert Advisors fail unexpectedly when deployed on trading accounts with non-USD base currencies (such as EUR, GBP, or JPY) or when trading under brokers that append custom suffixes (e.g., .pro, .ecn) to asset symbols. This library solves these multi-broker infrastructure issues by introducing a dynamic exchange rate engine that ensures deterministic risk calculations under any market environment.

The core architecture utilizes a high-performance triangular currency conversion algorithm to map the profit currency of the target asset directly to the trader's account currency. By scanning direct, inverse, and USD cross-pairs in fractions of a millisecond, the module calculates the exact current tick value, completely eliminating the risk of over-leveraging due to currency mismatches.




Key Architecture Components and Methods

- CalculateLotSize: Dynamically computes the deterministic volume size based on a strict user-defined risk percentage of the account balance and the exact stop-loss distance.
- GetConversionRate: Automatically resolves exchange rate conversion paths, switching between direct asset evaluation and triangular cross-currency calculations.
- ExtractSuffix: Programmatically identifies and strips broker-specific naming extensions to prevent "Symbol Not Found" errors during server lookup processes.
- CheckDrawdownLimit: Provides enterprise-grade capital protection by evaluating real-time equity drawdown and preventing new executions if safety limits are breached.

How to Integrate

To deploy this module, simply place the file inside your MQL5\Include\ directory, include the header at the top of your Expert Advisor, and instantiate the class object. Initialize the framework in your OnInit() handler and invoke the lot sizing algorithm immediately prior to constructing your trade requests.
Channel Sun Signals Channel Sun Signals

Overview Channel Sun Signals plots an adaptive, triangular-weighted moving-average channel (a center line plus an upper and lower band) around price, and marks potential reversal points where price pierces a band and then closes back inside it. It is built on the same "band-break-then-reversal" logic used by classic TMA/CG-style channel indicators, but rewritten natively for MT5 — including its own multi-timeframe engine that does not rely on iCustom() or an external .ex5 file, so the indicator works standalone once compiled.

SimpleTradeStats SimpleTradeStats

Statistics on closed trades. The indicator shows trading results, filtered by magic number.

Mediana Trendline 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.

Clock (Spread) Clock (Spread)

What this indicator does Clock (Spread).mq5 is a MetaTrader 5 chart indicator that displays a small text label in the corner of the chart showing: Countdown timer until the current candle closes (in HH:MM:SS or MM:SS format, depending on timeframe) Current spread (Ask − Bid, in points), shown in parentheses next to the timer