Skip to content

@livefolio/sdk / CloseOrder

Type Alias: CloseOrder

CloseOrder = object

Defined in: orders/types.ts:54

Closes an existing position identified by positionId. If quantity is supplied, only that many shares are closed (partial close); omitting quantity closes the entire position.

Example

ts
import type { CloseOrder } from '@livefolio/sdk';

const order: CloseOrder = {
  id:         'ord_002',
  kind:       'close',
  positionId: 'pos_1',
};

Properties

id

id: string

Defined in: orders/types.ts:56

Caller-supplied identifier carried back on the resulting Fill via orderRef.


kind

kind: "close"

Defined in: orders/types.ts:57


positionId

positionId: PositionId

Defined in: orders/types.ts:59

ID of the Position to close.


quantity?

optional quantity?: number

Defined in: orders/types.ts:64

Shares to close. Omit to close the full position. Must not exceed the position's current quantity.

Released under the MIT License.