Entry logic decides when a system would like to trade. Risk logic decides whether it is allowed to trade, how much it may expose, and when that permission ends. Treating these as one mixed block makes both harder to test.
Our archive contains twenty-nine records centred on risk and trade management. The recurring requests include percentage-based sizing, stop and break-even rules, equity and drawdown protection, trailing logic, session limits, and separate management tools. Together they point to a layered design rather than one universal stop setting.
How risk control works
Protection is applied in order: position size, trade protection, strategy exposure, session limits, and finally account-level safety.
- 01PositionCalculate volume from the intended loss distance and verified symbol properties.
- 02TradeDefine protective stop, target, break-even, trailing, and invalidation rules.
- 03StrategyLimit simultaneous trades, direction, symbol concentration, and repeated entries.
- 04SessionApply daily or weekly loss, trade-count, time, spread, and event limits.
- 05AccountGive equity, margin, connectivity, and emergency controls final authority.
Size from the loss
A fixed lot can represent very different risk when the stop distance, tick value, contract size, quote currency, or account currency changes. Risk-based sizing therefore begins with the amount the account is allowed to lose and works backward through the protective distance and the symbol specification.
The result still needs normalization to broker volume steps, minimum and maximum volume, available margin, and any portfolio cap. If a valid size cannot be calculated, the safer result is no trade with a clear reason—not a silent fallback to an arbitrary lot.
Define the protective path
A stop-loss is one control inside a longer position lifecycle. The EA may also move to break-even, trail behind price or structure, scale out, close on time, or exit when the original setup is invalid. Each action needs a trigger, a new state, and a clear rule for whether it may loosen protection.
Risk rules should also account for failed modifications. A requested stop update is not a completed stop update. The system needs to check the broker response, record the failure, and decide whether to retry, close, or suspend further action.
Control combined exposure
Maximum trades is not the same as maximum risk. Several positions can share the same currency, market direction, or underlying factor. A strategy-level control may limit total open risk, same-direction exposure, risk per symbol, or the number of setups that can be armed at once.
When several EAs share an account, the calculation must define ownership. Magic numbers and comments help identify positions, but portfolio controls may still need to see the whole account. The signal EA should not assume that unused margin belongs only to it.
Set daily authority
Daily and weekly controls are useful because a valid individual trade can still occur inside an unacceptable sequence. Loss limits, profit locks, trade-count limits, time windows, spread filters, and event blocks define when the strategy must stop requesting new exposure.
The reset boundary must be explicit. Broker time, UTC, and the trader’s local day are not always the same. The system should also say whether a daily stop blocks new entries only or closes current positions, and whether manual reopening is allowed.
Make failure controlled
Account protection includes conditions that are not visible in a normal backtest: stale prices, missing history, abnormal spread, rejected orders, invalid stops, low margin, terminal restart, and loss of an external dependency. These states should fail closed whenever continuing would create unknown exposure.
A practical risk system explains its action. The log or dashboard should show which layer blocked trading, the threshold or state that was reached, the reset policy, and whether current positions remain supervised. A safety rule that cannot be understood is difficult to trust and difficult to test.
- Calculate position size from risk, protective distance, and current symbol properties.
- Place and verify protective orders; do not treat a request as a confirmed broker result.
- Limit combined exposure, not only the number of tickets.
- Define daily and weekly stop authority, timezone, and reset behaviour.
- Use a final emergency state for unreliable data, margin, execution, or connectivity.
Questions you may have
Is a stop-loss enough for EA risk management?
No. It limits one position under stated assumptions. Sizing, combined exposure, sequence limits, broker execution, and account-level authority remain separate questions.
Should a daily loss limit close open trades?
That depends on the mandate. The rule must explicitly choose between blocking new entries, reducing exposure, or closing positions, and it must define the reset boundary.
Can risk controls guarantee a maximum loss?
No. Gaps, slippage, order rejection, outages, and market conditions can exceed intended limits. Controls reduce and organize risk; they do not remove it.