Fixed-Lot vs Martingale : Coding the 2 Risk Profiles, Not Just the Strategy

When people talk about Expert Advisors, the conversation usually starts with the entry logic.

Which indicator gives the signal?
What happens when price breaks a level?
When should the EA open a trade?

Position sizing often gets much less attention. It is treated as a simple input — 0.10 lots, 0.50 lots, or whatever the trader prefers.

But in an EA, lot sizing is not just another setting.

It is part of the risk engine.

The same entry strategy can behave completely differently depending on whether it uses fixed lots or martingale sizing. The entries may be identical, but the drawdown, margin usage, and worst-case exposure can be dramatically different.

That is why sizing logic should be designed, coded, and tested separately from the entry logic.

Here is how the three approaches differ from an implementation point of view.

Fixed-Lot: The Simple Baseline

With fixed-lot sizing, every trade uses the same volume regardless of what happened previously.

double GetLotSize()
{
   return FixedLotSize; // e.g. 0.10
}

This is the easiest model to understand.

If the EA always trades 0.10 lots, the position size does not increase after a loss or because price has moved further against the trade.

That makes the risk profile relatively predictable.

However, there is an important distinction between fixed lot size and fixed percentage risk.

A 0.10-lot trade on a $1,000 account does not represent the same percentage risk as a 0.10-lot trade on a $10,000 account.

So if the goal is to keep risk proportional to account equity, the lot size needs to be calculated dynamically.

For example:

double GetLotSize(double riskPercent,
                  double slDistancePoints,
                  string symbol)
{
   double equity = AccountInfoDouble(ACCOUNT_EQUITY);
   double riskAmount = equity * (riskPercent / 100.0);

   double tickValue =
      SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_VALUE);

   double lots = riskAmount /
                 (slDistancePoints * tickValue);

   return NormalizeLotSize(lots, symbol);
}

The NormalizeLotSize() part is important.

The broker defines the minimum volume, maximum volume, and volume step. The EA needs to respect those values.

Typically, that means working with:

  • SYMBOL_VOLUME_MIN
  • SYMBOL_VOLUME_MAX
  • SYMBOL_VOLUME_STEP

Without proper normalization and limits, the EA can send invalid volumes or end up with sizing that is different from what the developer intended.

So even the simplest sizing method deserves proper validation.

Martingale: The Loss Streak Changes Everything

Martingale sizing is fundamentally different.

Instead of keeping the lot size constant, the EA increases it after a losing trade. The classic example is doubling the lot size after every loss and returning to the base lot after a winning trade.

The calculation itself is straightforward:

double GetMartingaleLot(double baseLot,
                        int consecutiveLosses,
                        double multiplier)
{
   return baseLot *
          MathPow(multiplier, consecutiveLosses);
}

For a 0.01 base lot and a multiplier of 2:

  • 0 losses → 0.01
  • 1 loss → 0.02
  • 2 losses → 0.04
  • 3 losses → 0.08
  • 4 losses → 0.16

The problem is not the formula.

The problem is what happens when the losing streak continues.

After enough losses, the lot size can become larger than the account can safely support.

Put a hard limit on escalation

A martingale EA should never rely on the assumption that a losing streak will eventually end before the next lot size becomes dangerous.

There should be an explicit ceiling.

double GetMartingaleLot(double baseLot,
                        int consecutiveLosses,
                        double multiplier,
                        double maxLot)
{
   double lot = baseLot *
                MathPow(multiplier, consecutiveLosses);

   return MathMin(lot, maxLot);
}

The maximum lot is one possible limit. Another option is to limit the number of consecutive losses allowed before the EA stops opening new trades.

The important part is that the limit exists and is enforced by the code.

The loss counter must survive restarts

This is another detail that is easy to miss.

Suppose the EA has suffered three consecutive losses. The next trade should use the lot size corresponding to three losses.

Now imagine the terminal is restarted.

If the loss counter only exists as an in-memory variable, it may return to zero when the EA starts again.

That means the EA could suddenly behave as if the losing sequence never happened.

For a martingale system, state persistence matters.

The counter can be stored using terminal global variables or another suitable persistence mechanism, depending on how the EA is designed.

The key is that a restart should not unintentionally change the risk state.

A normal backtest is not enough

Martingale strategies have another problem: the dangerous scenario is usually a losing streak longer than the one seen in the test period.

A backtest may show that the strategy survived every historical losing streak.

That does not mean it can survive the next one.

If the historical data contained a maximum of eight consecutive losses, what happens with nine? Or ten?

That is where Monte Carlo testing becomes useful.

Instead of relying on one historical sequence, the trades can be reshuffled thousands of times to see how different sequences affect drawdown and losing streaks.

For a martingale EA, this can reveal how often the strategy reaches its maximum lot, maximum loss count, or account-level risk limit.

The Important Difference Between the Three

The three approaches may all be used with exactly the same entry signal, but they create very different risk profiles.

Method What changes exposure? Main risk
Fixed-lot Nothing Repeated losses
Martingale Consecutive losses Rapid lot-size escalation

Fixed-lot is the easiest to understand because the position size remains stable.

Martingale introduces path dependency. The size of the next trade depends on what happened before it.

None of these automatically makes a strategy good or bad.

The problem starts when the risk profile is not explicitly defined.

The Risk Logic Should Be a Separate Component

Grid vs Martingale vs Fixed-Lot risk engine flowchart logic

One useful way to design an EA is to treat the entry system and risk engine as two different components.

The entry logic answers:

Should I trade?

The sizing and risk logic answers:

How much should I trade, and am I still allowed to trade?

That second question should include the limits that protect the account.

Depending on the strategy, that might include:

  • Maximum lot size
  • Maximum total exposure
  • Maximum consecutive losses
  • Maximum drawdown
  • Margin-level protection
  • Maximum number of open positions
  • Persistent trading state after a restart

This separation also makes testing easier.

You can change the entry strategy without rewriting the entire risk engine. You can also test different sizing models against the same entry signals and see how much of the final performance actually comes from the entries and how much comes from the money-management rules.

Don’t Let the Backtest Hide the Risk

A profitable equity curve does not tell you enough about a sizing system.

With fixed lots, you should look at the maximum losing streak and the resulting drawdown.

With martingale, look at how quickly volume escalates during extended losing sequences.

The important numbers are often hidden behind the headline profit.

A strategy making 30% with a 10% drawdown tells a very different story from a strategy making 30% with a 45% drawdown — even if the final profit number looks identical.

Final Thoughts

The entry signal gets most of the attention when an EA is being developed.

But the sizing model often determines what happens when that signal is wrong.

Fixed-lot keeps exposure predictable. Martingale increases exposure as losses accumulate.

Each one can be coded.

Each one can be backtested.

But none should be treated as a simple lot-size input.

The risk model needs its own rules, limits, state management, and testing.

If you’re running a martingale EA, check one thing in particular: does the code enforce a hard exposure or lot limit even after a terminal restart?

If the answer is unclear, that is worth investigating before the next long losing sequence finds the gap for you.

If you want another pair of eyes on an existing EA, you can also use our free EA diagnosis.

← Previous Monte Carlo Simulation: Exposing the Hidden Risk in Your EA
← Back to All Articles
Live Support