Skip to content
All library documents

Monitoring Swap Rates and Position Swap Changes

Article MQL5 code base

Summary

This document describes a service that periodically checks swap rates for specified trading symbols and records changed values in monthly CSV files. Each record contains a timestamp and the long and short swap values, creating a history that traders can consult when evaluating the financing costs of holding positions. The service also checks open positions and alerts the user when their swap rates change.

The document explains that the program is packaged as a script because the code base does not support services as a program type, while its source can run on a chart if the service directive is disabled. It recommends installing the program as a service. No sample data, performance evidence, or method for analyzing the resulting records is provided. The utility is therefore operational: it helps track changing swap costs and notify users, but it does not specify how to incorporate those changes into a trading strategy or assess their effect on returns.

Key ideas

  • The service records changed long and short swap rates for selected symbols in monthly files.
  • Each saved observation includes a datetime and both swap values.
  • It can alert users when swap rates on existing positions change.
  • The program is distributed as a script because its code base does not support services as a program type.

Tags

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