Skip to main content
Glama

metatrader-mcp-server

close_position.md505 B
# 🔒 close_position **Signature:** ```python def close_position(connection, id: Union[str, int]) ``` ## What does it do? 🛑 Closes a specific position by its ID. Ensures you can exit trades when you need to! ## Parameters - **connection**: MetaTrader 5 connection object - **id**: The unique position identifier ## Returns - A dictionary with error flag, message, and closed position data (if successful) ## Fun Fact 🏁 Perfect for risk management—close those positions before they get wild!

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