Trading models

class lime_trader.models.trading.CancelOrderResponse(success: bool, data: str)[source]

Order cancellation response

success

Indicator if cancel was success

Type:

bool

data

Cancellation request id

Type:

str

class lime_trader.models.trading.Order(account_number: str, symbol: str, quantity: Decimal, exchange: str = 'auto', price: Decimal | None = None, time_in_force: TimeInForce = TimeInForce.DAY, order_type: OrderType = OrderType.MARKET, side: OrderSide = OrderSide.BUY)[source]

Represents order

account_number

Account number this order belongs to.

Type:

str

symbol

The security symbol, stocks in Nasdaq CMS convention, options in OCC.

Type:

str

quantity

The positive decimal, number of shares or contracts.

Type:

decimal.Decimal

exchange

Optional, auto by default. The routing instructions for order execution. The actual values are dynamic and depend on the account settings. Some of the possible values are NASDAQ or ARCA

Type:

str

price

Positive decimal if the order_type is limit or stop_limit

Type:

decimal.Decimal | None

time_in_force

Optional, day by default. Specifies how long the order remains in effect

Type:

lime_trader.models.trading.TimeInForce

order_type

Optional, market by default

Type:

lime_trader.models.trading.OrderType

side

Optional, buy by default. Available values are buy and sell. Buy opens long position, sell closes the position. The system will determine the proper side according to the current position, but you are still required to place two orders to revert the position from long to short and the other way around

Type:

lime_trader.models.trading.OrderSide

class lime_trader.models.trading.OrderDetails(account_number: str, client_id: str, exchange: str, quantity: Decimal, executed_quantity: Decimal, order_status: OrderStatus, price: Decimal, time_in_force: TimeInForce, order_type: OrderType, order_side: OrderSide, symbol: str, stop_price: Decimal | None = None)[source]

Represents order details after order has been submitted

account_number

Account number this order belongs to

Type:

str

client_id

Order id

Type:

str

exchange

The routing instructions

Type:

str

quantity

Number of shares or contracts requested by the order

Type:

decimal.Decimal

executed_quantity

Number of shares or contracts executed by this time

Type:

decimal.Decimal

order_status

Order status

Type:

lime_trader.models.trading.OrderStatus

price

Limit price if applicable

Type:

decimal.Decimal

stop_price

Stop price if applicable

Type:

decimal.Decimal | None

time_in_force

Order duration instructions

Type:

lime_trader.models.trading.TimeInForce

order_type

Type of the order

Type:

lime_trader.models.trading.OrderType

order_side

Side of the order

Type:

lime_trader.models.trading.OrderSide

symbol

Security symbol

Type:

str

class lime_trader.models.trading.OrderFee(amount: Decimal, type: str)[source]

Order fee

amount

Dollar amount

Type:

decimal.Decimal

type

Charge description

Type:

str

class lime_trader.models.trading.OrderSide(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
class lime_trader.models.trading.OrderStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
class lime_trader.models.trading.OrderType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
class lime_trader.models.trading.PlaceOrderResponse(success: bool, data: str)[source]

Order place response

success

Indicator if order place was success

Type:

bool

data

ID that is assigned to the order

Type:

str

class lime_trader.models.trading.TimeInForce(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
class lime_trader.models.trading.ValidateOrderResponse(is_valid: bool, validation_message: str | None = None)[source]

Order validation response

is_valid

Status of validation

Type:

bool

validation_message

Optional reject reason

Type:

str | None