Order

# Import statement

from bcx.orders import Order
class Order(order_type: str, symbol: str, side: str, quantity: float, time_in_force: str, order_id: str = None)[source]

Base class for representing orders

Note

Although it is possible to use this class for creating orders, but it lack of order specific validation checks.

Parameters
order_type
symbol
side
quantity
time_in_force
order_id

Attributes

is_valid

Check if order has valid parameters

Methods

to_json(self)

Represent order as JSON dictionary

validate(self)

Validate order parameters

property is_valid

Check if order has valid parameters

to_json(self) → Dict[source]

Represent order as JSON dictionary

validate(self) → bool[source]

Validate order parameters