MCPcopy Create free account
hub / github.com/ccxt/ccxt / is_post_only

Method is_post_only

python/ccxt/base/exchange.py:7188–7211  ·  view source on GitHub ↗

@ignore :param str type: Order type :param boolean exchangeSpecificParam: exchange specific postOnly :param dict [params]: exchange specific params :returns boolean: True if a post only order, False otherwise

(self, isMarketOrder: bool, exchangeSpecificParam, params={})

Source from the content-addressed store, hash-verified

7186 return self.handle_trigger_and_params(params)
7187
7188 def is_post_only(self, isMarketOrder: bool, exchangeSpecificParam, params={}):
7189 """
7190 @ignore
7191 :param str type: Order type
7192 :param boolean exchangeSpecificParam: exchange specific postOnly
7193 :param dict [params]: exchange specific params
7194 :returns boolean: True if a post only order, False otherwise
7195 """
7196 timeInForce = self.safe_string_upper(params, 'timeInForce')
7197 postOnly = self.safe_bool_2(params, 'postOnly', 'post_only', False)
7198 # we assume timeInForce is uppercase from safeStringUpper(params, 'timeInForce')
7199 ioc = timeInForce == 'IOC'
7200 fok = timeInForce == 'FOK'
7201 timeInForcePostOnly = timeInForce == 'PO'
7202 postOnly = postOnly or timeInForcePostOnly or exchangeSpecificParam
7203 if postOnly:
7204 if ioc or fok:
7205 raise InvalidOrder(self.id + ' postOnly orders cannot have timeInForce equal to ' + timeInForce)
7206 elif isMarketOrder:
7207 raise InvalidOrder(self.id + ' market orders cannot be postOnly')
7208 else:
7209 return True
7210 else:
7211 return False
7212
7213 def handle_post_only(self, isMarketOrder: bool, exchangeSpecificPostOnlyOption: bool, params: Any = {}):
7214 """

Callers 15

create_order_requestMethod · 0.80
create_order_requestMethod · 0.80
create_orderMethod · 0.80
create_order_requestMethod · 0.80
create_order_requestMethod · 0.80
create_order_requestMethod · 0.80
order_requestMethod · 0.80
create_order_requestMethod · 0.80
create_orderMethod · 0.80
create_orderMethod · 0.80

Calls 3

safe_string_upperMethod · 0.95
safe_bool_2Method · 0.95
InvalidOrderClass · 0.90

Tested by

no test coverage detected