Skip to main content
Glama

metatrader-mcp-server

close_all_positions.py605 B
from .get_all_positions import get_all_positions from .close_position import close_position def close_all_positions(connection): """ Close all open positions. Args: connection: The connection object to the MetaTrader platform. Returns: A dictionary containing an error flag, a message, and the number of positions closed. """ positions = get_all_positions(connection) count = 0 for id in positions["id"]: close_position(connection, id) count += 1 return { "error": False, "message": f"Close {count} positions success", "data": None }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ariadng/metatrader-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server