Discussing the article: "MetaTrader 5 Machine Learning Blueprint (Part 10): Bet Sizing for Financial Machine Learning"

 

Check out the new article: MetaTrader 5 Machine Learning Blueprint (Part 10): Bet Sizing for Financial Machine Learning.

Fixed fractions and raw probabilities misallocate risk under overlapping labels and induce overtrading. This article delivers four AFML-compliant sizers: probability-based (z-score → CDF, active-bet averaging, discretization), forecast-price (sigmoid/power with w calibration and limit price), budget-constrained (direction-only), and reserve (mixture-CDF via EF3M). You get a signed, bounded position series with documented conditions of use.

You have probability estimates from the classifier pipeline built across this series, and you need to translate them into position sizes a trading system can act on. Standard approaches fail in four concrete ways for this use case. A fixed fractional rule treats a 51% prediction identically to a 91% prediction, discarding the confidence information the model worked to produce. Using the raw probability as the position size ignores concurrency. If ten triple‑barrier labels are active and each is sized at 10% of capital, total exposure reaches 100% without any deliberate decision to lever up.

Continuous resizing of an averaged signal generates micro‑adjustments whose transaction cost exceeds their expected P&L contribution. None of these rules incorporate payoff asymmetry. A strategy that wins three dollars for every one it loses warrants a different allocation than a symmetric bet at the same probability. The Kelly criterion captures this; probability‑only methods do not. The measurable symptoms are systematic overexposure during periods of high signal density, erosion of edge by transaction costs, and position sizes that are either recklessly large or unnecessarily small depending on the payoff structure of each trade.

This article presents the full bet sizing toolkit from Chapter 10 of Marcos López de Prado's Advances in Financial Machine Learning, implemented in the afml.bet_sizing module. After reading, you will have a complete, runnable sizing system composed of four components:

  1. a probability‑based first‑stage sizer (bet_size_probability / get_signal) that converts classifier output into a confidence‑weighted signal. It corrects for label concurrency by averaging all active bets over time and discretizes updates to prevent overtrading;
  2. a dynamic forecast‑price sizer (bet_size_dynamic) with sigmoid and power functional forms, a closed‑form calibration procedure that sets the aggressiveness parameter from a target divergence and bet size, and a limit‑price output for execution systems;
  3. a budget‑constrained sizer (bet_size_budget) and a data‑driven reserve sizer (bet_size_reserve) for strategies producing only directional signals. The reserve method learns its sizing curve from the empirical distribution of concurrent position imbalance using the EF3M algorithm. The output is a signed position series in [−1, 1] with concurrency adjustment and per‑bar diagnostics.

    Author: Patrick Murimi Njoroge