Skip to content
All library documents

N-Trade Martingale with Equity-Based Reset

Article MQL5 code base

Summary

The document describes an expert advisor that adjusts position size across fixed-size groups of trades. After a group ends with consecutive losses, it scales the lot size upward by a configured factor; after a group of consecutive wins, it resets sizing. Groups with mixed outcomes leave the lot size unchanged. The suggested rationale is that larger groups may make the approach safer, though no evidence is given to establish that claim.

A second version closes trades and resets after equity rises above its previous high by a configurable amount. The text gives USDJPY as the example market and mentions a test spanning 2016 to 2019 with starting equity of $2,000, but provides no performance statistics or detailed test conditions. It also suggests experimenting with group size, currency pair, and take-profit/stop-loss settings. Martingale sizing can increase exposure after losses, and the document does not quantify drawdowns, execution costs, or the risk of account loss.

Key ideas

  • The advisor groups trades into a configurable number of outcomes before changing position size.
  • Consecutive losing outcomes increase lot size by the chosen scaling factor.
  • A group of consecutive wins resets sizing, while mixed results retain the prior lot size.
  • An alternative version closes trades and resets after equity exceeds its previous high by a configured amount.
  • The document offers test settings but no performance metrics or quantified risk analysis.

Tags

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