place_limit_order
Execute buy or sell orders at a specific price or better to control trade entry and exit points in financial markets.
Instructions
Place a limit order to buy or sell at a specified price or better
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | Yes | The ticker symbol of the instrument | |
| quantity | Yes | The quantity to buy (positive) or sell (negative) | |
| limitPrice | Yes | The limit price for the order | |
| timeValidity | No | Time validity of the order | DAY |
Implementation Reference
- src/index.ts:656-667 (handler)The handler implementation for the 'place_limit_order' tool in src/index.ts. It parses arguments using LimitOrderRequestSchema and calls the client's placeLimitOrder method.
case 'place_limit_order': { const validated = LimitOrderRequestSchema.parse(args); const order = await client.placeLimitOrder(validated); return { content: [ { type: 'text', text: JSON.stringify(order, null, 2), }, ], }; } - src/client.ts:178-187 (handler)The API client implementation of placeLimitOrder, which performs the actual HTTP POST request to the Trading 212 API.
async placeLimitOrder(order: LimitOrderRequest): Promise<Order> { return this.request( '/equity/orders/limit', { method: 'POST', body: JSON.stringify(order), }, OrderSchema, ); } - src/index.ts:177-203 (registration)Tool registration and schema definition for 'place_limit_order'.
name: 'place_limit_order', description: 'Place a limit order to buy or sell at a specified price or better', inputSchema: { type: 'object', properties: { ticker: { type: 'string', description: 'The ticker symbol of the instrument', }, quantity: { type: 'number', description: 'The quantity to buy (positive) or sell (negative)', }, limitPrice: { type: 'number', description: 'The limit price for the order', }, timeValidity: { type: 'string', enum: ['DAY', 'GOOD_TILL_CANCEL'], description: 'Time validity of the order', default: 'DAY', }, }, required: ['ticker', 'quantity', 'limitPrice'], }, },