Place a buy or sell order using a specific account and connector.
Args: trade_request: Trading request with account, connector, trading pair, type, amount, etc. accounts_service: Injected accounts service
Returns: TradeResponse with order ID and trading details
Raises: HTTPException: 400 for invalid parameters, 404 for account/connector not found, 500 for trade execution errors
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Request model for placing trades
Name of the account to trade with
Name of the connector/exchange
Trading pair (e.g., BTC-USDT)
Whether to buy or sell
BUY, SELL Amount to trade
x > 0Type of order
LIMIT, MARKET, LIMIT_MAKER Price for limit orders
Position action for perpetual contracts (OPEN/CLOSE)
OPEN, CLOSE Successful Response
Response model for trade execution
Client order ID assigned by the connector
Account used for the trade
Connector used for the trade
Trading pair
Trade type
Trade amount
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Order type
Order price
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Order status