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
close_position.md•505 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!