MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / OrderType

Class OrderType

projects/Python/proto/protoex.py:119–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119class OrderType(enum.IntEnum, metaclass=fbe.DefaultEnumMeta):
120 market = int(0) + 0
121 limit = int(0) + 1
122 stop = int(0) + 2
123 stoplimit = int(0) + 3
124 unknown = ~0
125
126 __slots__ = ()
127
128 def __format__(self, format_spec):
129 return self.__str__()
130
131 def __str__(self):
132 if self.value == OrderType.market:
133 return "market"
134 if self.value == OrderType.limit:
135 return "limit"
136 if self.value == OrderType.stop:
137 return "stop"
138 if self.value == OrderType.stoplimit:
139 return "stoplimit"
140 return "<unknown>"
141
142 @classmethod
143 def _missing_(cls, value):
144 return OrderType.unknown
145
146 @staticmethod
147 def __from_json__(value):
148 if value is None:
149 return None
150 return OrderType(value)
151
152
153# Fast Binary Encoding OrderType field model

Callers 5

__from_json__Method · 0.70
getMethod · 0.70
getMethod · 0.70
__init__Method · 0.70
get_fieldsMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected