52 lines
763 B
Python
52 lines
763 B
Python
from enum import Enum
|
|
|
|
|
|
class OrderStatus(Enum):
|
|
NEW = 1
|
|
PENDING_NEW = 2
|
|
PARTIALLY_FILLED = 3
|
|
FILLED = 4
|
|
CANCELED = 5
|
|
REJECTED = 6
|
|
|
|
|
|
class ExecType(Enum):
|
|
NEW = 1
|
|
PENDING_NEW = 2
|
|
PARTIAL_FILL = 3
|
|
FILL = 4
|
|
CANCELED = 5
|
|
REJECTED = 6
|
|
|
|
|
|
class OrderType(Enum):
|
|
LIMIT = 1
|
|
MARKET = 2
|
|
ICEBERG = 3
|
|
SPREADER = 4
|
|
|
|
@staticmethod
|
|
def parse(s: str):
|
|
return OrderType.__members__[s]
|
|
|
|
|
|
class TimeInForce(Enum):
|
|
FOK = 1
|
|
GTC = 2
|
|
IOC = 3
|
|
DAY = 4
|
|
|
|
@staticmethod
|
|
def parse(s: str):
|
|
return TimeInForce.__members__[s]
|
|
|
|
|
|
class SecurityType(Enum):
|
|
SPOT = 1
|
|
FUTURE = 2
|
|
OPTION = 3
|
|
|
|
@staticmethod
|
|
def parse(s: str):
|
|
return SecurityType.__members__[s]
|