Skip to content
All library documents

Using Swap Estimates for Carry-Aware EA Position Management

Article MQL5 articles

Summary

The article shows how an MQL5 expert advisor can incorporate overnight swap estimates into trade management. It describes reading long and short swap rates and the broker’s swap mode, converting supported modes into an estimated daily amount per lot in account currency, projecting carry over a planned holding period, and using that estimate in hold-or-close decisions and lot sizing. A Wednesday triple-swap heuristic is used for many forex brokers.

Examples illustrate how accumulated carry can offset part of a floating loss, particularly for positions held several days on positive-carry currency pairs. The proposed functions add carry awareness to position management without changing entry signals. Estimates have limits: broker conventions vary, some modes are unsupported or approximated, currency conversion may be needed, and the triple-swap weekday can differ. Swap estimates should therefore be checked against the symbol and broker before use; carry does not ensure that a trade will be profitable.

Key ideas

  • Swap rates can be positive or negative and affect the net result of positions held through rollover.
  • MQL5 exposes swap direction and mode, and conversion to account currency depends on the broker’s swap convention.
  • Projected carry over a holding window can inform whether to hold a position and how to size it against risk.
  • A Wednesday triple-swap assumption is a heuristic that may need replacement with broker-specific day multipliers.
  • Unsupported modes and missing currency conversion can make estimated carry inaccurate.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.