Skip to content
All library documents

Adjusting Expert Advisor Lot Size After Account Withdrawals

Article MQL5 code base

Summary

The document describes adding withdrawal tracking to an existing Expert Advisor so position sizing can respond when account funds are removed. It identifies a limitation in recovery-style sizing systems: an EA may increase lot size after losses and retain that larger size, while being unable to tell whether a lower account balance reflects a loss or a withdrawal. If the reduction came from a withdrawal, keeping the prior lot size may leave the EA sizing trades against the account’s new balance.

The proposed purpose is to monitor withdrawals and allow the EA to adjust lot size to the reduced balance. The document provides no code, detailed method, tested example, or performance evidence, and does not explain how withdrawal detection should be distinguished from other balance changes. It presents the idea as a modification to existing EA logic rather than a complete position-sizing strategy.

Key ideas

  • The proposed code is intended to track withdrawals on the account where an Expert Advisor runs.
  • The described sizing issue occurs when an EA raises lot size after losses and does not reduce it after a withdrawal.
  • Withdrawal tracking could let the EA adapt lot size to the account’s reduced balance.
  • The document provides no implementation details or evidence that the adjustment improves results.
  • Withdrawal detection must be distinguished from balance changes caused by trading losses.

Tags

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