MQL · Python · Risk Engineering

Capital & Risk Management — Position Sizing, Drawdown Control and Safety Limits

We add a dedicated risk layer to your bot or manual trading: exact lot sizing from stop distance, hard loss limits, and automatic protection that works even when the strategy is wrong.

5–10
Days typical delivery
%Risk
Sizing by stop distance
DD
Drawdown limits
Multi
Account support
Quick answer

A risk management system controls how much you can lose: it sizes each trade from a fixed risk percent and the stop-loss distance, caps daily and total drawdown, limits open exposure, and manages trailing stops automatically. ExpertNevees builds these as modules for existing Expert Advisors, standalone MetaTrader panels, or Python services that watch several accounts, typically in 5–10 days.

Risk Controls We Implement

⚖️

Risk-percent sizing

Lot size is calculated so that hitting the stop-loss loses exactly the percent of balance you chose, on any symbol.
📉

Drawdown limits

Stops new trades, or closes everything, when daily, weekly or total drawdown reaches your limit.
🧮

Exposure caps

Maximum open trades, total lots, and correlated-symbol exposure limits.
🎯

Trailing and break-even

ATR-based, step and break-even trailing with minimum-distance checks against the broker’s stop level.
📊

Scaling rules

Controlled position scaling in profit, and strictly capped averaging if your strategy needs it.
🚨

Kill-switch and alerts

Manual and automatic emergency stop, with alerts to your phone when a limit is hit.

Position Sizing Models Compared

ModelHow it worksStrengthWeakness
Fixed lotSame lot every tradeSimpleRisk changes with stop distance and account size
Fixed risk %Lot from balance × risk% ÷ stop-loss costConstant risk per tradeNeeds a defined stop-loss
Volatility-adjustedStop distance from ATR, then fixed risk %Adapts to market conditionsATR settings need validation
Fractional KellyFraction of the Kelly criterion from win rate and payoffMathematically grounded growthVery sensitive to estimation errors, so use a small fraction

Risk-Percent Position Sizing in Python

Python · Position sizing
import math

def position_size(balance: float, risk_pct: float, sl_distance: float,
                  tick_size: float, tick_value: float,
                  vol_step: float, vol_min: float, vol_max: float) -> float:
    """Lots such that a stop-out loses ~risk_pct of balance. Returns 0.0 if it cannot be done safely."""
    risk_money = balance * risk_pct / 100.0
    loss_per_lot = sl_distance / tick_size * tick_value      # money lost per 1.0 lot at the stop
    if loss_per_lot <= 0:
        return 0.0
    lots = math.floor(risk_money / loss_per_lot / vol_step) * vol_step
    if lots < vol_min:                                       # never round UP into more risk than allowed
        return 0.0
    return min(lots, vol_max)

# Example: 10,000 balance, 1% risk, 30-pip stop on a 5-digit pair
print(position_size(10_000, 1.0, 0.0030, 0.00001, 1.0, 0.01, 0.01, 100.0))   # 0.33

The sign of good risk code is what it refuses to do: it returns zero rather than rounding up into a trade riskier than you allowed.

How a Daily-Loss Guard Behaves in Practice

  1. Record the day’s starting equity

    At the start of your trading day (broker or custom time), the system stores equity as the reference.

  2. Monitor equity continuously

    Floating profit and loss are included, not only closed trades, so open losses count.

  3. Trigger at your limit

    At the daily loss limit, the guard blocks new entries and, if configured, closes open positions.

  4. Alert and lock

    You get an alert and trading stays locked until the next day or a manual reset.

Using Risk Controls for Prop-Firm Challenges

What these systems help with
  • ●
    Daily and maximum drawdown rules are enforced automatically instead of by discipline.
  • ●
    Position sizes are consistent, which avoids a single oversized trade ending a challenge.
  • ●
    Rules differ per firm (balance-based or equity-based, trailing or static). We implement the exact rule set you are subject to; always check your firm’s current terms.

Delivery, Support & Guarantee

5–10 days
Typical delivery
MT4 · MT5 · Python
Platforms
Multi-account capable
Accounts
Included
Support

Timelines are indicative. The exact price and delivery date are confirmed in writing before work starts, with no hidden costs. Payment: 50% advance, 50% after your approval (USDT or bank wire).

Frequently Asked Questions

Can you add risk management to my existing Expert Advisor?

Yes. We add sizing, drawdown and trailing modules to EAs you already own, or build a separate panel that protects the account regardless of which EA is trading.

What is the right risk per trade?

It depends on your strategy’s edge, drawdown tolerance and account goals. Many traders use between 0.25% and 2% per trade. We implement the percent you choose and can show how drawdown behaves for different values in a backtest.

Does the system work with several MetaTrader accounts?

Yes. A Python service can monitor multiple accounts and enforce limits across them, and MetaTrader panels can be installed on each terminal.

Can it close trades automatically when drawdown is hit?

Yes. You choose whether the guard only blocks new trades, closes all positions, or just alerts you.

Does it replace a stop-loss?

No. It complements it. Every trade should still have a protective stop. The system calculates size from the stop and adds portfolio-level limits above it.

How is this different from the EA service?

Risk management is the protective layer that can sit on top of any strategy. See Expert Advisor Development for full strategy automation.

Official Documentation & Sources

  • MetaQuotes Ltd.MQL5 Reference — Trade Functions and Account InfoMQL5.com
    View Docs ↗
  • MetaQuotes Ltd.MetaTrader 5 Python IntegrationMQL5.com
    View Docs ↗

Protect Your Account With Rules That Never Get Emotional

Tell us your limits and platform. We build the guard and test it before delivery.