Skip to content
All library documents

How Martingale and Anti-Martingale Change Trade Size After Wins and Losses

Article MQL5 code base

Summary

The document describes an Expert Advisor intended to test two ways of changing position size after a trade closes. In its martingale mode, a stop loss leads to a larger position in the opposite direction, while a take profit resets size and continues in the same direction. The stated aim is for a later winning trade to recover losses from the sequence and leave a small additional gain. In anti-martingale mode, a win increases the next position and a loss resets it to the base size, with a limit on consecutive increases advised.

The document emphasizes that martingale does not create a trading edge: it shifts the payoff toward frequent small gains and infrequent large losses. It lists configurable direction, base lot, stop loss, take profit, multiplier, and trade identifier settings. No performance evidence is provided, and the described sizing logic depends on a favorable recovery trade arriving before position sizes or losses become unmanageable.

Key ideas

  • Martingale sizing increases after a loss and resets after a take profit.
  • Anti-martingale sizing increases after a win and resets after a loss.
  • Martingale redistributes returns but does not provide a trading advantage.
  • A cap on consecutive anti-martingale increases can limit position escalation.
  • The Expert Advisor exposes trade direction, lot size, stop loss, take profit, and trade identification settings.

Tags

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