INNER CODE UNIT · Python
health
codedpro/mt5-trade-split-manager · server.py:226
async def health():
return {
"status": "healthy",
"tcp_host": TCP_HOST,
"tcp_port": TCP_PORT,
"auth_required": bool(API_KEY),
}
@app.post("/order", dependencies=[Depends(require_key)])
async def create_order(order: OrderCommand):
"""Place order on MT5 via TCP (split into 1-10 positions by the EA)."""
# The command sent to the EA always carries an explicit volume_split; when
# the client omits it we inject the legacy-compatible default here.
volume_split = order.volume_split
if volume_split is None:
volume_split = default_volume_split(len(order.tp_levels))
command = {