bfx_rest: change 'is not None' to '!= None'

This commit is contained in:
JacobPlaster
2020-01-10 14:06:50 +00:00
committed by Jacob Plaster
parent 972e05eacd
commit 0e313418bc

View File

@@ -531,19 +531,19 @@ class BfxRest:
flags = calculate_order_flags(hidden, close, reduce_only, post_only, oco) flags = calculate_order_flags(hidden, close, reduce_only, post_only, oco)
payload['flags'] = flags payload['flags'] = flags
# add extra parameters # add extra parameters
if price_trailing is not None: if price_trailing != None:
payload['price_trailing'] = price_trailing payload['price_trailing'] = price_trailing
if price_aux_limit is not None: if price_aux_limit != None:
payload['price_aux_limit'] = price_aux_limit payload['price_aux_limit'] = price_aux_limit
if oco_stop_price is not None: if oco_stop_price != None:
payload['price_oco_stop'] = str(oco_stop_price) payload['price_oco_stop'] = str(oco_stop_price)
if time_in_force is not None: if time_in_force != None:
payload['tif'] = time_in_force payload['tif'] = time_in_force
if gid is not None: if gid != None:
payload['gid'] = gid payload['gid'] = gid
if leverage is not None: if leverage != None:
payload['lev'] = str(leverage) payload['lev'] = str(leverage)
if aff_code is not None: if aff_code != None:
payload['meta']['aff_code'] = str(aff_code) payload['meta']['aff_code'] = str(aff_code)
endpoint = "auth/w/order/submit" endpoint = "auth/w/order/submit"
raw_notification = await self.post(endpoint, payload) raw_notification = await self.post(endpoint, payload)
@@ -583,19 +583,19 @@ class BfxRest:
@param leverage: the amount of leverage to apply to the order as an integer @param leverage: the amount of leverage to apply to the order as an integer
""" """
payload = {"id": orderId} payload = {"id": orderId}
if price is not None: if price != None:
payload['price'] = str(price) payload['price'] = str(price)
if amount is not None: if amount != None:
payload['amount'] = str(amount) payload['amount'] = str(amount)
if delta is not None: if delta != None:
payload['delta'] = str(delta) payload['delta'] = str(delta)
if price_aux_limit is not None: if price_aux_limit != None:
payload['price_aux_limit'] = str(price_aux_limit) payload['price_aux_limit'] = str(price_aux_limit)
if price_trailing is not None: if price_trailing != None:
payload['price_trailing'] = str(price_trailing) payload['price_trailing'] = str(price_trailing)
if time_in_force is not None: if time_in_force != None:
payload['time_in_force'] = str(time_in_force) payload['time_in_force'] = str(time_in_force)
if leverage is not None: if leverage != None:
payload["lev"] = str(leverage) payload["lev"] = str(leverage)
flags = calculate_order_flags( flags = calculate_order_flags(
hidden, close, reduce_only, post_only, False) hidden, close, reduce_only, post_only, False)