POST Close Position

Closes a position by instrument. Returns a list of positions closed in the account for the specific instrument.

Close a specific position by instrument

POST /v1/api/accounts/{account}/positions/close

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Query Parameters

NameTypeRequiredDescription

account

string

Required

Name of account in NT8

Body

NameTypeRequiredDescription

instrument

string

Required

Name of underlying instrument

Code Examples (coming soon)

// Some code

Response

{
    "closedPositions": [
        {
            "type": "NinjaTrader.Cbi.Position",
            "account": "Sim101",
            "instrument": "ES 12-24",
            "instrumentType": "Future",
            "marketPosition": "Long",
            "quantity": 4,
            "averagePrice": 5779.8125,
            "marketPrice": 5797.0,
            "unrealizedProfitLoss": 3437.5
        }
    ],
    "success": true
}

Last updated