INNER CODE UNIT · Python
total
codedpro/mt5-trade-split-manager · server.py:86
total = sum(split)
if not 0.99 <= total <= 1.01:
raise ValueError(
f"volume_split must sum to ~1.0 within [0.99, 1.01] (got {total:.4f})"
)
return self
def default_volume_split(n: int) -> List[float]:
"""Legacy-compatible default split for N levels: N=1 -> [1.0]; otherwise
TP1 = 0.60 and each remaining level = 0.40 / (N-1). For N=5 this is the
original 60/10/10/10/10 weighting, so existing clients are unchanged."""
if n == 1:
return [1.0]
return [0.60] + [0.40 / (n - 1)] * (n - 1)
class Envelope: