MQL5 Lot Size Calculation: Risk-Based Position Sizing for Expert Advisors

目次

1. What Is Lot Size Calculation in MQL5?

Conclusion:
Lot size is the most important parameter for deciding how much risk you take on a single trade.
Unless it is calculated properly, even a strong EA will struggle to survive over the long term.

1.1 Definition of Lot Size

Conclusion:
Lot size is the trading volume specified when placing an order, and it directly determines the size of profit and loss.

Definition:
Lot size is the unit that represents how much of a currency pair or CFD you buy or sell. In MQL5, it is specified as volume.

Examples:

  • 1.00 lot: a standard trading volume, such as 100,000 currency units
  • 0.10 lot: one-tenth of that amount
  • 0.01 lot: the minimum unit, depending on the broker

Key points:

  • Larger lot size means both larger profit and larger loss
  • Smaller lot size reduces risk

A common beginner misunderstanding:

  • Lot size is not a setting for increasing profit
  • Correctly, lot size is a setting for controlling loss

This difference in perspective is a major reason drawdown, or account decline, becomes larger than expected.

MQL5 also has the following restrictions:

  • Minimum lot: SYMBOL_VOLUME_MIN
  • Maximum lot: SYMBOL_VOLUME_MAX
  • Lot step: SYMBOL_VOLUME_STEP

If you ignore these rules, an invalid volume error will occur.


1.2 Why Lot Size Matters

Conclusion:
Lot size does not decide whether you can win. It decides whether your account can survive.

The reason is simple.

Loss is determined by:

  • Lot size
  • Stop loss distance
  • Pip value, or the value of price movement

In other words, lot size is directly tied to the maximum loss amount.

Example:

  • Lot: 1.0
  • Stop loss: 50 pips

The loss becomes very large.

On the other hand:

  • Lot: 0.1
  • Stop loss: 50 pips

The loss becomes one-tenth as large.

This difference becomes critical in long-term operation.

Another important point is reproducibility.

In discretionary trading:

  • Lot size changes based on emotion
  • Decisions vary depending on the situation

In an EA, or automated trading system:

  • Same conditions mean the same lot size
  • Test results can be reproduced as designed

This reproducibility supports the reliability of backtesting and forward testing.


Common Practical Mistakes

Typical mistakes related to lot size include:

  • Using a fixed lot size
    This cannot adapt to account growth or decline
  • Ignoring the stop loss
    The risk is not defined
  • Ignoring the spread
    Actual loss becomes larger than expected
  • Ignoring slippage
    Execution price differences increase risk
  • Judging only by margin
    This confuses leverage with risk

Beginners especially tend to misunderstand this point:

“If I can enter the trade, it must be safe.”

These are completely different issues.


Why It Is Required in an EA

In an EA, lot size calculation is not optional. It is required.

Reasons:

  • Automated trading places trades repeatedly
  • Small risk differences accumulate
  • They affect the probability of ruin over the long term

For this reason, practical EA design usually starts with:

  • 1% to 2% risk per trade
  • Smaller lot size during drawdown
  • Adjustments based on market conditions, such as spread and volatility

An EA without this design may win in the short term, but it is likely to break down over the long term.

2. Basic Steps for Lot Size Calculation

Conclusion:
Lot size can be calculated as acceptable loss amount divided by stop loss distance times pip value.
If this process is implemented directly in MQL5, reproducible risk management becomes possible.


2.1 Basic Manual Calculation Steps

Conclusion:
Lot size is easier to calculate when you decide risk first, then stop loss, then pip value.

Basic practical steps:

  • 1. Decide the acceptable risk, either as a percentage or a fixed amount
  • 2. Decide the stop loss distance in pips
  • 3. Check the value of 1 pip
  • 4. Calculate the lot size

Example:

  • Account balance: $100,000
  • Risk: 1%, or $1,000
  • Stop loss: 50 pips

Calculate the lot size that would lose $1,000 if price moves 50 pips against the trade.

This order matters.

Common mistakes:

  • Deciding lot size first
  • Adding the stop loss afterward

This makes the risk unclear and dangerous.

MQL5 lot size calculation based on risk percentage, showing how to compute position volume from account balance, risk %, stop loss pips, and pip value, with code example, execution flow arrows, and trading chart illustrating entry, stop loss, and take profit for risk management in MetaTrader 5 Expert Advisor development.

2.2 Basic Formula

Conclusion:
The correct approach is to work backward from the loss amount.

Basic formula:

Lot = Acceptable loss amount / (stop loss distance * 1 pip value)

Or:

Lot = (account balance * risk %) / (SL distance * pip value)

Key points:

  • Think from loss, not profit
  • Pip value differs by currency pair
  • JPY pairs are more prone to calculation errors

Additional notes:

  • EURUSD: pip value is relatively stable
  • USDJPY: pip value changes with the exchange rate

If you ignore this difference, calculation errors occur.


2.3 MQL5 Implementation Example

Conclusion:
In MQL5, you can get the required values with AccountInfoDouble() and SymbolInfoDouble().

Basic code example:

double CalculateLot(double risk_percent, double stoploss_pips)
{
    double balance = AccountInfoDouble(ACCOUNT_BALANCE);
    double risk_amount = balance * (risk_percent / 100.0);

    double tick_value = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);
    double tick_size  = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);

    double pip_value = tick_value / tick_size;

    double lot = risk_amount / (stoploss_pips * pip_value);

    return lot;
}

Usage points:

  • ACCOUNT_BALANCE: account balance
  • SYMBOL_TRADE_TICK_VALUE: value of one tick
  • SYMBOL_TRADE_TICK_SIZE: price movement unit

Important notes:

  • Values differ by broker
  • CFDs and indices may use different calculation logic
  • The test environment and live environment may differ

2.4 Practical Template for Automatic Calculation

Conclusion:
In practice, lot size becomes safe only after minimum lot and lot step adjustments are included.

Improved template:

double NormalizeLot(double lot)
{
    double minLot  = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN);
    double maxLot  = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX);
    double stepLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);

    lot = MathMax(minLot, lot);
    lot = MathMin(maxLot, lot);

    lot = MathFloor(lot / stepLot) * stepLot;

    return lot;
}

double CalculateLotSafe(double risk_percent, double stoploss_pips)
{
    double rawLot = CalculateLot(risk_percent, stoploss_pips);
    return NormalizeLot(rawLot);
}

Using this helps with:

  • Avoiding invalid volume errors
  • Handling broker restrictions
  • Generating tradable lot sizes for live use

Common Practical Mistakes

  • Miscalculating pip value
    Ignoring currency-pair dependency
  • Not normalizing lot size
    Order errors occur
  • Ignoring spread
    The effective stop loss becomes narrower
  • Ignoring slippage
    Execution increases risk
  • stoploss_pips is 0
    Calculation becomes impossible, which is critical

Why This Procedure Matters

This procedure is designed to control the probability of ruin.

By contrast:

  • Fixed lot size
  • Intuitive settings

These may work in the short term, but they break down over the long term.

3. How Lot Size Calculation Works

Conclusion:
Lot size calculation simply works backward from the formula that breaks down the loss amount.
If you understand this structure, you can apply it even when the currency pair or broker changes.


3.1 Working Backward from the Loss Amount

Conclusion:
Loss is determined by lot size times price movement times value, so lot size can be calculated backward from that relationship.

Basic structure of loss:

Loss amount = lot * stop loss distance (pips) * 1 pip value

Solving this for lot size gives:

Lot = loss amount / (stop loss distance * pip value)

In other words, the formula in the previous section is just this simple rearrangement.

Key points:

  • Lot size is the result, not the starting input
  • The first thing to decide is the loss amount

Specific flow:

  • Decide the acceptable loss, such as $1,000
  • Decide the SL distance, such as 50 pips
  • The lot size is then determined automatically

Following this order keeps risk consistent.


3.2 Differences by Currency Pair

Conclusion:
Pip value differs by currency pair, so risk changes even with the same lot size.

Common differences:

  • Pairs such as EURUSD, or dollar majors
    Pip value is relatively stable
  • Pairs such as USDJPY, or yen pairs
    Pip value changes with the exchange rate

Example:

  • USDJPY at 100: pip value is smaller
  • USDJPY at 150: pip value is larger

In short:

  • The loss amount changes even with the same lot size

This is why fixed lot sizing is considered risky.

In MQL5, get it with:

SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);

Important notes:

  • The calculation method differs by broker
  • CFDs, indices, and gold may require different logic

3.3 Differences in Digits and Price Format

Conclusion:
Differences such as 5-digit and 3-digit pricing change the definition of a pip, which can cause calculation mistakes.

Examples:

  • EURUSD
    • 1.10000 uses 5 digits
    • 1 pip = 0.0001
  • USDJPY
    • 150.000 uses 3 digits
    • 1 pip = 0.01

Common mistakes:

  • Confusing pips and points
  • Creating a 10x error

In MQL5:

  • Point: the minimum unit, or point
  • A pip must be converted manually

Countermeasure:

double pip = (_Digits == 3 || _Digits == 5) ? 10 * _Point : _Point;

Without this process, lot calculation breaks down.


3.4 Relationship Between Leverage and Lot Size

Conclusion:
Leverage only increases the amount you can trade. Risk itself is determined by lot size and SL.

A common misunderstanding:

  • Higher leverage means higher risk
    More accurately, it only means you can increase lot size

Actual risk is determined by:

  • Lot size
  • Stop loss distance

Examples:

  • Even 1x leverage is dangerous if the lot size is large
  • Even 100x leverage can be controlled if the lot size is small

In short:

  • Leverage is the trading environment
  • Lot size is the decision

Common Practical Mistakes

  • Treating pip value as a fixed value
    This ignores currency-pair differences
  • Confusing point and pip
    This creates a 10x error
  • Judging risk by leverage
    This is fundamentally incorrect
  • Treating CFDs the same as FX
    Loss calculation becomes inaccurate

Why This Understanding Matters

If you do not understand this structure:

  • You can calculate, but you cannot adapt
  • The system breaks when market conditions change

If you do understand it:

  • You can handle any currency pair
  • You can support multi-symbol EAs
  • You can include spread and slippage

4. Comparison with Other Position Sizing Methods

Conclusion:
There are several methods for calculating lot size, but fixed risk percentage sizing offers the best balance of reproducibility and survival rate.
Fixed lots and martingale methods may work in the short term, but their long-term failure risk is high.


4.1 Difference Between Fixed Lot and Fixed Risk

Conclusion:
Fixed lot sizing is simple, but it cannot adapt to account changes. Fixed risk sizing keeps risk consistent.

Comparison table:

MethodFeatureAdvantageDisadvantage
Fixed lotTrades with the same lot size every timeEasy to implementDoes not adapt to account growth or decline; drawdown can expand
Fixed risk (%)Lot size changes based on account balanceKeeps risk consistentRequires calculation
Fixed amountUses the same loss amount every timeEasy to manageCompounding effect is weaker

Key points:

  • Fixed lot sizing becomes more dangerous as the account balance falls
  • Fixed risk sizing adjusts naturally based on account size

Example:

  • $1,000,000 account: 1 lot
  • $500,000 account: still 1 lot

The effective risk doubles, which is dangerous.


4.2 Difference from Martingale

Conclusion:
Martingale is designed to recover losses, but the probability of ruin rises sharply.

Features:

  • Lot size increases after each loss
  • The design assumes one win can recover prior losses

Advantage:

  • It can appear to have a high win rate in the short term

Disadvantages:

  • Drawdown increases exponentially
  • The strategy ends with insufficient margin or a margin call

Structural problem:

Lot: 1 -> 2 -> 4 -> 8 -> 16 -> ...

After only a few consecutive losses, the account can no longer withstand the exposure.

Practical judgment:

  • It can look excellent in testing
  • It is extremely dangerous in live operation

4.3 Volatility-Based Sizing, or ATR-Based Sizing

Conclusion:
Lot adjustment using ATR, or average price movement, is a highly adaptive method for changing market conditions.

How it works:

  • High volatility means reducing lot size
  • Low volatility means increasing lot size

Examples:

  • Large ATR means volatile price movement, so use a smaller lot
  • Small ATR means stable movement, so a larger lot may be possible

Advantages:

  • Risk control based on market conditions
  • Drawdown reduction

Disadvantages:

  • Implementation is more complex
  • There is a risk of overfitting

In MQL5:

  • It can be obtained with iATR()
  • It is commonly designed together with SL distance

4.4 Best Practical Choice

Conclusion:
In practice, use fixed risk percentage sizing as the base, then combine it with volatility adjustment when needed.

Recommended structure:

  • Base: 1% risk per trade
  • Conditional:
    • Wider spread means reducing lot size
    • Higher slippage means avoiding entry
    • High volatility means reducing lot size

This balances:

  • Reproducibility
  • Stability
  • Market adaptability

Common Practical Mistakes

  • Leaving fixed lot sizing unchanged
    The strategy can fail when the account balance declines
  • Overtrusting martingale
    The account can be wiped out in one severe sequence
  • Over-optimizing ATR
    The system becomes dependent on backtest conditions
  • Ignoring spread and execution conditions
    Live results diverge from tests

Summary of Each Method’s Role

  • Fixed lot: for beginners and learning
  • Fixed risk: practical standard
  • ATR-based sizing: for advanced users
  • Martingale: not recommended

5. Common Mistakes and Important Notes

Conclusion:
Lot size calculation errors usually come from three areas: pip value, lot restrictions, and execution conditions such as spread and slippage.
If you ignore these, theoretical risk and actual loss will diverge.


5.1 Miscalculating Pip Value

Conclusion:
If you treat pip value as fixed, loss calculation becomes inaccurate because of currency-pair and price changes.

Typical mistakes:

  • Using a fixed assumption such as “1 pip = $10”
  • Calculating USDJPY and EURUSD the same way

In reality:

  • Pip value depends on the currency pair
  • It changes with the exchange rate

MQL5 example:

double tick_value = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);
double tick_size  = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);
double pip_value  = tick_value / tick_size;

Important notes:

  • Specifications differ by broker
  • CFDs, gold, and indices may require different logic

5.2 Ignoring Minimum Lot and Lot Step

Conclusion:
Lot size cannot be specified freely. It must satisfy broker restrictions.

Important parameters:

  • SYMBOL_VOLUME_MIN, minimum lot
  • SYMBOL_VOLUME_MAX, maximum lot
  • SYMBOL_VOLUME_STEP, lot step

Failure examples:

  • 0.013 lots causes an order error
  • A lot size outside the allowed range causes invalid volume

Countermeasure code:

double NormalizeLot(double lot)
{
    double minLot  = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN);
    double maxLot  = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX);
    double stepLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);

    lot = MathMax(minLot, lot);
    lot = MathMin(maxLot, lot);
    lot = MathFloor(lot / stepLot) * stepLot;

    return lot;
}

5.3 Ignoring Spread

Conclusion:
If you do not account for spread, the effective stop loss becomes narrower.

Example:

  • SL: 50 pips
  • Spread: 2 pips

The effective SL becomes 48 pips.

Impact:

  • The trade may hit the stop loss earlier than expected
  • Risk is underestimated

Countermeasures:

  • Add spread to the SL buffer
  • Or adjust during lot calculation

5.4 Ignoring Slippage

Conclusion:
Slippage affects lot calculation as a hidden risk.

When it occurs:

  • News releases
  • Lower liquidity
  • Execution delays

Results:

  • The order is filled at a worse price than expected
  • Actual loss increases

Countermeasures:

  • Reduce lot size during high volatility
  • Set acceptable slippage
  • Avoid trading during specific time periods

5.5 No Stop Loss

Conclusion:
Lot calculation does not work without a stop loss.

Reasons:

  • The risk amount cannot be defined
  • The formula cannot be applied

Failure examples:

  • Averaging-down EAs
  • Unlimited holding strategies

These strategies may:

  • Win temporarily
  • Fail over the long term

5.6 Confusing Point and Pip

Conclusion:
Confusing point and pip can create a 10x error in lot calculation.

Example:

  • 5-digit broker
    • point = 0.00001
    • pip = 0.0001

Mistake:

  • Using point directly as pips

Countermeasure:

double pip = (_Digits == 3 || _Digits == 5) ? 10 * _Point : _Point;

Practical Checklist

Check these before lot calculation:

  • Is the pip value correct?
  • Is SL set?
  • Does the lot size meet broker restrictions?
  • Are spread and slippage considered?
  • Are differences between currency pairs handled?

If you skip this checklist, backtesting and live operation will diverge.


Why These Points Matter

All of these mistakes:

  • Look small at first
  • Accumulate over time

Results:

  • Unexpected drawdown
  • EA failure

In automated trading especially, exceptions accumulate.

6. Practical Use Cases

Conclusion:
Lot size calculation shows its real value when it is built into the EA as part of the overall risk-control logic, not as a standalone function.
In practice, the basic structure is fixed risk, condition filters, and dynamic adjustment.


6.1 Integration into a Fixed-Risk EA

Conclusion:
The most reproducible design fixes the risk percentage per trade.

Basic policy:

  • 1% to 2% risk per trade
  • Lot size is calculated automatically every time
  • It is decided together with the stop loss

Implementation image:

double lot = CalculateLotSafe(1.0, stoploss_pips);

Points:

  • If the balance grows, lot size increases, creating compounding
  • If the balance falls, lot size decreases defensively

Advantages:

  • Drawdown control works naturally
  • Backtest and live results are less likely to diverge

Common mistakes:

  • Manually increasing lot size during a winning period
  • Intervening manually instead of letting the EA follow its rule

This breaks reproducibility.


6.2 Drawdown-Based Lot Adjustment

Conclusion:
Automatically reducing lot size when equity declines can greatly reduce the probability of ruin.

Concept:

  • Higher drawdown, or DD, means smaller lot size
  • As equity recovers, lot size is restored gradually

Example:

double equity = AccountInfoDouble(ACCOUNT_EQUITY);
double balance = AccountInfoDouble(ACCOUNT_BALANCE);

double dd = (balance - equity) / balance * 100.0;

double risk = 1.0;

if (dd > 10) risk = 0.5;
if (dd > 20) risk = 0.25;

double lot = CalculateLotSafe(risk, stoploss_pips);

Advantages:

  • Limits loss expansion during losing streaks
  • Keeps the account within a recoverable range

Disadvantages:

  • Recovery becomes slower
  • Poor design can make the system too defensive

6.3 Multi-Symbol Support

Conclusion:
If lot size is not optimized for each currency pair, results vary even under the same risk design.

Challenges:

  • EURUSD and USDJPY have different pip values
  • Volatility, or ATR, also differs

Countermeasures:

  • Calculate separately for each symbol
  • Retrieve pip value and tick value each time

Implementation image:

double lot = CalculateLotSafe(risk_percent, stoploss_pips);

Design it so it adjusts automatically based on _Symbol.

Applications:

  • Risk allocation by symbol
  • Risk control for the whole portfolio

6.4 Working with Filters

Conclusion:
Linking lot size to market conditions, or the execution environment, improves live trading robustness.

Common filters:

  • Spread
  • Slippage
  • Volatility, or ATR
  • Trading sessions, such as London and New York

Example:

double spread = SymbolInfoInteger(_Symbol, SYMBOL_SPREAD);

if (spread > max_spread)
{
    return; // Do not trade
}

Or:

if (spread > threshold)
{
    lot *= 0.5; // Cut lot size in half
}

Effects:

  • Avoids unfavorable execution
  • Reduces unexpected losses

6.5 Best Practices for Practical Design

Conclusion:
The best approach is to design lot calculation as part of the EA’s entire risk management layer, not as a standalone feature.

Recommended structure:

  • Base: fixed risk, such as 1% to 2%
  • Support:
    • DD-based adjustment
    • Spread filter
    • Volatility adjustment

Design image:

Lot = basic lot calculation
    * DD adjustment
    * volatility adjustment
    * execution adjustment

This layered structure allows:

  • Reproducibility
  • Stability
  • Live trading robustness

to work at the same time.


Common Practical Mistakes

  • Leaving lot calculation as a standalone feature
    It breaks down in live operation
  • Trading constantly with no filters
    Losses increase when spreads widen
  • No DD control
    A losing streak can destroy the account
  • Over-optimizing
    The system cannot reproduce results in live trading

Why This Much Design Is Necessary

An EA:

  • Trades repeatedly
  • Faces constantly changing market conditions

Therefore:

  • Static lot sizing is not enough
  • Dynamic risk control is required

Whether this is implemented is the dividing line between a backtest EA and a live-trading EA.

7. Frequently Asked Questions

Conclusion:
Most questions about lot size focus on the definition of risk, the calculation method, and the gap between testing and live operation.
Once these points are clear, even beginners can implement lot sizing without confusion.


7.1 What Lot Size Is Safe?

Conclusion:
In general, 1% to 2% risk per trade is considered a safer range.

Reasons:

  • The account is less likely to drop sharply during losing streaks
  • Drawdown, or DD, is easier to manage

Examples:

  • 1% risk leaves about 90% of the account after 10 consecutive losses
  • 5% risk reduces the account to about 60% under the same conditions

Important notes:

  • There is no absolutely safe value
  • It also depends on the strategy’s win rate and expected value

7.2 Can I Increase Lot Size When Leverage Is Higher?

Conclusion:
You can increase it, but risk also increases proportionally.

Important distinction:

  • Leverage means tradable amount
  • Lot size means actual risk

In other words:

  • Even with high leverage, risk can be controlled by reducing lot size
  • Even with low leverage, a large lot size is dangerous

7.3 How Should I Get Pip Value?

Conclusion:
In MQL5, the correct approach is to get it dynamically with SymbolInfoDouble().

Basic code:

double tick_value = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);
double tick_size  = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);
double pip_value  = tick_value / tick_size;

Important notes:

  • The value changes by currency pair
  • CFDs and indices may require different calculations

7.4 Is Fixed Lot Sizing Acceptable?

Conclusion:
It may be acceptable in the short term, but it is not suitable for long-term operation.

Reasons:

  • It cannot adapt to account growth or decline
  • Risk does not stay consistent

Example:

  • If the account balance is cut in half and the same lot size is used, risk doubles

Recommendation:

  • Learning stage: fixed lot
  • Live operation: fixed risk

7.5 Can Lot Size Be Calculated Without a Stop Loss?

Conclusion:
No. Lot calculation assumes a stop loss.

Reasons:

  • The risk amount cannot be defined
  • There is no upper limit on loss

Practical judgment:

  • No-SL strategies are high risk
  • They are not suitable for long-term operation

7.6 Should Spread and Slippage Be Considered?

Conclusion:
Yes. They are required. If ignored, actual losses can become larger than expected.

Impact:

  • Spread narrows the effective SL
  • Slippage shifts the execution price

Countermeasures:

  • Add a buffer to SL
  • Avoid trading when spreads are high
  • Use execution-condition filters

7.7 Which Is Better, Automatic Calculation or Manual Setting?

Conclusion:
For an EA, automatic calculation is required.

Reasons:

  • Reproducibility can be maintained
  • Human error can be removed
  • It matches the backtest design

Problems with manual settings:

  • Emotional inconsistency
  • Setting mistakes
  • Lack of consistency

7.8 Should Lot Size Be Optimized?

Conclusion:
Excessive optimization should be avoided.

Reasons:

  • It overfits past data
  • It may not reproduce results in live trading

Recommended approach:

  • Use simple rules
  • Prioritize reproducibility
  • Validate with forward testing

8. Summary

Conclusion:
Lot size calculation is not a mechanism for increasing profit. It is a mechanism for controlling loss.
In an EA, it is a required feature that determines reproducibility, stability, and survival rate.


8.1 Key Points of This Article

Conclusion:
Lot size comes down to one principle: calculate backward from risk.

Key points:

  • Lot size is the result, and the first thing to decide is the loss amount
  • The formula is loss amount divided by SL distance times pip value
  • Pip value differs by currency pair
  • Leverage does not determine risk

8.2 Best Design for Practical Use

Conclusion:
For live operation, the most stable design combines fixed risk with dynamic adjustment.

Recommended structure:

  • Base: 1% to 2% risk per trade
  • Support:
    • Drawdown-based adjustment
    • Spread and slippage filters
    • Volatility adjustment

Design image:

Lot = basic calculation
    * risk adjustment
    * market condition adjustment

8.3 The Core of Common Mistakes

Conclusion:
Lot calculation failures happen through the accumulation of small errors.

Typical patterns:

  • Misunderstanding pip value
  • Not handling lot restrictions
  • Ignoring execution conditions, such as spread and slippage
  • No stop loss

These may look small individually, but in an EA they accumulate and become critical.


8.4 The Most Important Concept

Conclusion:
Lot size is a parameter for controlling the probability of ruin, not expected value.

Summary:

  • The strategy determines expected value
  • The lot size determines survival rate

If you confuse these roles:

  • The system may win in the short term
  • But it can collapse over the long term

8.5 Implementation Priority

Conclusion:
In EA development, lot design should be finalized before entry logic.

Priority order:

  1. Lot size calculation
  2. Risk management design
  3. Entry logic

Reason:

  • If lot design is broken, any trading method becomes meaningless

8.6 Next Action

Conclusion:
The shortest path is to implement fixed 1% risk lot calculation first, then validate it with forward testing.

Recommended steps:

  • Implement a basic lot calculation function
  • Link it with the stop loss
  • Test it on a demo account
  • Move to live operation after validation