I need a small, well-structured API written in Python that focuses on trading operations, specifically the ability to close open positions programmatically. The goal is to integrate this into an existing trading workflow, so the interface should be clean, clear, and easy for other Python modules or external services to call. Core requirements • Build the API layer in Python (feel free to use FastAPI or Flask if REST makes sense, but I am open to alternative designs as long as the solution remains lightweight and maintainable). • Implement secure endpoints/methods whose sole task is to locate open trades on a connected brokerage/exchange account and close them quickly and reliably. • Include concise, inline docstrings plus a short README that explains authentication, expected request/response formats, and how to run a minimal demo. • Provide unit tests that prove the close-trade logic works against either a sandbox environment or mocked endpoints. Acceptance criteria – A single command (e.g., `python main.py --close-all`) or HTTP call closes sample open positions and returns success codes. – All critical paths covered by tests. – Code passes linting (PEP 8) and runs on Python 3.10+. If you can deliver robust, well-documented Python code that meets the above, I’d love to get started.