MQL5 Algo Trading
Photo
click to show
click to show
Most MQL5 position sizers ask for a risk number that is independent of strategy quality. Fixed percent rules size the same whether win rate and payoff are favorable or not.
Kelly sizing derives the risk fraction from the strategy edge: win probability and average win versus loss. A CKelly class can measure these from closed deal history (net of costs), refuse to act on small samples, and return zero sizing when no edge is detected.
Monte Carlo sweeps show the key trade-off: growth peaks at full Kelly, while drawdown and large-loss frequency keep rising. Fractional Kelly, often half or quarter, retains most growth while materially reducing drawdown and ruin risk.
The code is native MQL5: one reusable class plus a sweep script that outputs CSV. Limits remain: edge is estimated, non-stationary, and correlation or overlapping positions are not covered.
👉 Read | AppStore | @mql5dev
7 · 6.7K ·