Skip to content
All library documents

MQL5 Hedging Class for Managing Orders, Exposure, and Stops

Article MQL5 code base

Summary

This document inventories the interface of an MQL5 class intended to manage a hedging strategy. It describes parameters for target profit, starting lot size, desired gain per lot, buy and sell levels, order spacing, and a hard stop loss. Read-only methods report long and short position volume, pending volume, trade count, and the prices associated with the latest long and short entries. Operational methods start or stop the system, report whether it is running, process tick updates, build positions within specified price levels, and add tickets to a managed batch.

The material is an API overview rather than a complete trading specification. It indicates that the class can manage activity on both sides of the market and provides a fixed stop setting, but it does not explain the entry logic, how opposing exposure is controlled, or how target profit and order spacing interact. No code body, backtest evidence, or performance statistics are included, so the listed functions alone do not establish profitability or the risks of a particular configuration.

Key ideas

  • The class exposes configurable profit, volume, price-level, spacing, and hard stop parameters.
  • It tracks open and pending long and short volumes separately.
  • Its methods support starting, stopping, ticking, and querying the strategy's running state.
  • A position-building method accepts volume and buy and sell price levels.
  • The interface list does not reveal the full strategy logic or provide performance evidence.

Tags

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