Skip to content

@livefolio/sdk / OpenOrder

Type Alias: OpenOrder

OpenOrder = object

Defined in: orders/types.ts:24

Opens a new position in asset. The executor creates a fresh Position entry and debits cash by quantity * fillPrice + fees.

Example

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

const order: OpenOrder = {
  id:       'ord_001',
  kind:     'open',
  asset:    { kind: 'equity', id: 'AAPL', symbol: 'AAPL' },
  side:     'long',
  quantity: 100,
  tag:      'momentum-entry',
};

Properties

asset

asset: Asset

Defined in: orders/types.ts:29

The instrument to buy (long) or sell short.


id

id: string

Defined in: orders/types.ts:26

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


kind

kind: "open"

Defined in: orders/types.ts:27


quantity

quantity: number

Defined in: orders/types.ts:33

Number of shares (or units) to transact. Must be positive.


side

side: "long" | "short"

Defined in: orders/types.ts:31

'long' to buy; 'short' to sell short.


tag?

optional tag?: string

Defined in: orders/types.ts:35

Optional label propagated to the resulting Position for analysis.

Released under the MIT License.