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

Class OrderType

projects/Python/proto/proto.py:115–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114
115class OrderType(enum.IntEnum, metaclass=fbe.DefaultEnumMeta):
116 market = int(0) + 0
117 limit = int(0) + 1
118 stop = int(0) + 2
119 unknown = ~0
120
121 __slots__ = ()
122
123 def __format__(self, format_spec):
124 return self.__str__()
125
126 def __str__(self):
127 if self.value == OrderType.market:
128 return "market"
129 if self.value == OrderType.limit:
130 return "limit"
131 if self.value == OrderType.stop:
132 return "stop"
133 return "<unknown>"
134
135 @classmethod
136 def _missing_(cls, value):
137 return OrderType.unknown
138
139 @staticmethod
140 def __from_json__(value):
141 if value is None:
142 return None
143 return OrderType(value)
144
145
146# 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