Skip to content
All library documents

Expert Advisor for Closing All, Profitable, or Losing Positions

Article MQL5 code base

Summary

This short description covers an Expert Advisor designed to close open positions according to a selected scope: all positions, only positions currently in profit, or only positions currently at a loss. The note credits the original idea to James Malwitz and identifies the MQL5 code author. The tool is an operational position-management utility rather than a signal-generation or asset-selection strategy.

The document does not specify how profit or loss is calculated, whether positions are filtered by symbol or trade identifier, or what event triggers the close action. It also provides no test results, execution details, or safeguards for partial fills and changing market prices. Traders considering such a utility would need to review those behaviors in its implementation and evaluate how its close rules fit their risk controls; the description alone does not establish execution quality or suitability.

Key ideas

  • The Expert Advisor can close every open position, only profitable positions, or only losing positions.
  • The described tool manages existing positions rather than generating entry signals.
  • The note credits James Malwitz with the idea and names the MQL5 code author.
  • Trigger behavior, profit calculation, execution handling, and test evidence are not described.

Tags

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