INNER CODE UNIT · Python
default_volume_split
codedpro/mt5-trade-split-manager · server.py:94
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:
"""One in-flight command plus the machinery to deliver its response back to
exactly the request that issued it."""
__slots__ = ("cmd", "event", "result", "abandoned")
def __init__(self, cmd: dict):
self.cmd = cmd
self.event = threading.Event()
self.result = None