ccxt 4.4.39__py2.py3-none-any.whl → 4.4.40__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -1
- ccxt/ascendex.py +9 -9
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +9 -9
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/aiohttp_client.py +2 -2
- ccxt/async_support/binance.py +13 -17
- ccxt/async_support/bingx.py +1 -2
- ccxt/async_support/bit2c.py +0 -1
- ccxt/async_support/bitbank.py +0 -1
- ccxt/async_support/bitbns.py +0 -1
- ccxt/async_support/bitfinex.py +15 -16
- ccxt/async_support/bitfinex1.py +0 -1
- ccxt/async_support/bitflyer.py +0 -1
- ccxt/async_support/bitget.py +1 -2
- ccxt/async_support/bithumb.py +0 -1
- ccxt/async_support/bitmart.py +3 -4
- ccxt/async_support/bitmex.py +5 -6
- ccxt/async_support/bitopro.py +4 -5
- ccxt/async_support/bitrue.py +5 -7
- ccxt/async_support/bitso.py +1 -2
- ccxt/async_support/bitstamp.py +1 -2
- ccxt/async_support/bitteam.py +1 -3
- ccxt/async_support/bitvavo.py +2 -4
- ccxt/async_support/blockchaincom.py +5 -5
- ccxt/async_support/blofin.py +10 -10
- ccxt/async_support/btcalpha.py +0 -1
- ccxt/async_support/btcbox.py +0 -1
- ccxt/async_support/btcmarkets.py +1 -3
- ccxt/async_support/bybit.py +2 -3
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +77 -1
- ccxt/async_support/coinbaseexchange.py +1 -1
- ccxt/async_support/coinbaseinternational.py +62 -0
- ccxt/async_support/coincatch.py +1 -1
- ccxt/async_support/coinex.py +9 -9
- ccxt/async_support/coinlist.py +1 -1
- ccxt/async_support/coinmetro.py +1 -1
- ccxt/async_support/cryptocom.py +91 -2
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/defx.py +1 -2
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/digifinex.py +1 -1
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/hashkey.py +3 -5
- ccxt/async_support/htx.py +1 -1
- ccxt/async_support/hyperliquid.py +1 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/kucoin.py +24 -24
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/mexc.py +137 -1
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/okcoin.py +18 -18
- ccxt/async_support/okx.py +21 -21
- ccxt/async_support/phemex.py +12 -8
- ccxt/async_support/poloniex.py +1 -1
- ccxt/async_support/poloniexfutures.py +6 -6
- ccxt/async_support/vertex.py +11 -11
- ccxt/async_support/woo.py +33 -33
- ccxt/async_support/woofipro.py +24 -24
- ccxt/async_support/xt.py +26 -26
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +13 -16
- ccxt/binance.py +13 -17
- ccxt/bingx.py +1 -2
- ccxt/bit2c.py +0 -1
- ccxt/bitbank.py +0 -1
- ccxt/bitbns.py +0 -1
- ccxt/bitfinex.py +15 -16
- ccxt/bitfinex1.py +0 -1
- ccxt/bitflyer.py +0 -1
- ccxt/bitget.py +1 -2
- ccxt/bithumb.py +0 -1
- ccxt/bitmart.py +3 -4
- ccxt/bitmex.py +5 -6
- ccxt/bitopro.py +4 -5
- ccxt/bitrue.py +5 -7
- ccxt/bitso.py +1 -2
- ccxt/bitstamp.py +1 -2
- ccxt/bitteam.py +1 -3
- ccxt/bitvavo.py +2 -4
- ccxt/blockchaincom.py +5 -5
- ccxt/blofin.py +10 -10
- ccxt/btcalpha.py +0 -1
- ccxt/btcbox.py +0 -1
- ccxt/btcmarkets.py +1 -3
- ccxt/bybit.py +2 -3
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +77 -1
- ccxt/coinbaseexchange.py +1 -1
- ccxt/coinbaseinternational.py +62 -0
- ccxt/coincatch.py +1 -1
- ccxt/coinex.py +9 -9
- ccxt/coinlist.py +1 -1
- ccxt/coinmetro.py +1 -1
- ccxt/cryptocom.py +91 -2
- ccxt/currencycom.py +1 -1
- ccxt/defx.py +1 -2
- ccxt/delta.py +1 -1
- ccxt/digifinex.py +1 -1
- ccxt/exmo.py +2 -2
- ccxt/gate.py +1 -1
- ccxt/hashkey.py +3 -5
- ccxt/htx.py +1 -1
- ccxt/hyperliquid.py +1 -1
- ccxt/kraken.py +1 -1
- ccxt/kucoin.py +24 -24
- ccxt/luno.py +1 -1
- ccxt/mexc.py +137 -1
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +18 -18
- ccxt/okx.py +21 -21
- ccxt/phemex.py +12 -8
- ccxt/poloniex.py +1 -1
- ccxt/poloniexfutures.py +6 -6
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +1 -1
- ccxt/pro/bybit.py +12 -1
- ccxt/pro/coinex.py +2 -2
- ccxt/pro/gate.py +6 -6
- ccxt/pro/kucoin.py +3 -3
- ccxt/pro/okx.py +11 -11
- ccxt/pro/upbit.py +2 -2
- ccxt/vertex.py +11 -11
- ccxt/woo.py +33 -33
- ccxt/woofipro.py +24 -24
- ccxt/xt.py +26 -26
- ccxt/zonda.py +1 -1
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/METADATA +4 -4
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/RECORD +134 -134
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/WHEEL +0 -0
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/top_level.txt +0 -0
ccxt/async_support/woofipro.py
CHANGED
@@ -1264,15 +1264,15 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1264
1264
|
stopLoss = self.safe_value(params, 'stopLoss')
|
1265
1265
|
takeProfit = self.safe_value(params, 'takeProfit')
|
1266
1266
|
algoType = self.safe_string(params, 'algoType')
|
1267
|
-
|
1267
|
+
isConditional = stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
|
1268
1268
|
isMarket = orderType == 'MARKET'
|
1269
1269
|
timeInForce = self.safe_string_lower(params, 'timeInForce')
|
1270
1270
|
postOnly = self.is_post_only(isMarket, None, params)
|
1271
|
-
orderQtyKey = 'quantity' if
|
1272
|
-
priceKey = 'price' if
|
1273
|
-
typeKey = 'type' if
|
1271
|
+
orderQtyKey = 'quantity' if isConditional else 'order_quantity'
|
1272
|
+
priceKey = 'price' if isConditional else 'order_price'
|
1273
|
+
typeKey = 'type' if isConditional else 'order_type'
|
1274
1274
|
request[typeKey] = orderType # LIMIT/MARKET/IOC/FOK/POST_ONLY/ASK/BID
|
1275
|
-
if not
|
1275
|
+
if not isConditional:
|
1276
1276
|
if postOnly:
|
1277
1277
|
request['order_type'] = 'POST_ONLY'
|
1278
1278
|
elif timeInForce == 'fok':
|
@@ -1283,7 +1283,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1283
1283
|
request['reduce_only'] = reduceOnly
|
1284
1284
|
if price is not None:
|
1285
1285
|
request[priceKey] = self.price_to_precision(symbol, price)
|
1286
|
-
if isMarket and not
|
1286
|
+
if isMarket and not isConditional:
|
1287
1287
|
request[orderQtyKey] = self.amount_to_precision(symbol, amount)
|
1288
1288
|
elif algoType != 'POSITIONAL_TP_SL':
|
1289
1289
|
request[orderQtyKey] = self.amount_to_precision(symbol, amount)
|
@@ -1355,9 +1355,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1355
1355
|
stopPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
1356
1356
|
stopLoss = self.safe_value(params, 'stopLoss')
|
1357
1357
|
takeProfit = self.safe_value(params, 'takeProfit')
|
1358
|
-
|
1358
|
+
isConditional = stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
|
1359
1359
|
response = None
|
1360
|
-
if
|
1360
|
+
if isConditional:
|
1361
1361
|
response = await self.v1PrivatePostAlgoOrder(request)
|
1362
1362
|
#
|
1363
1363
|
# {
|
@@ -1417,8 +1417,8 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1417
1417
|
stopPrice = self.safe_string_2(orderParams, 'triggerPrice', 'stopPrice')
|
1418
1418
|
stopLoss = self.safe_value(orderParams, 'stopLoss')
|
1419
1419
|
takeProfit = self.safe_value(orderParams, 'takeProfit')
|
1420
|
-
|
1421
|
-
if
|
1420
|
+
isConditional = stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(orderParams, 'childOrders') is not None)
|
1421
|
+
if isConditional:
|
1422
1422
|
raise NotSupported(self.id + 'createOrders() only support non-stop order')
|
1423
1423
|
orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
|
1424
1424
|
ordersRequests.append(orderRequest)
|
@@ -1474,16 +1474,16 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1474
1474
|
stopPrice = self.safe_string_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
|
1475
1475
|
if stopPrice is not None:
|
1476
1476
|
request['triggerPrice'] = self.price_to_precision(symbol, stopPrice)
|
1477
|
-
|
1478
|
-
orderQtyKey = 'quantity' if
|
1479
|
-
priceKey = 'price' if
|
1477
|
+
isConditional = (stopPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
|
1478
|
+
orderQtyKey = 'quantity' if isConditional else 'order_quantity'
|
1479
|
+
priceKey = 'price' if isConditional else 'order_price'
|
1480
1480
|
if price is not None:
|
1481
1481
|
request[priceKey] = self.price_to_precision(symbol, price)
|
1482
1482
|
if amount is not None:
|
1483
1483
|
request[orderQtyKey] = self.amount_to_precision(symbol, amount)
|
1484
1484
|
params = self.omit(params, ['stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice', 'trailingTriggerPrice', 'trailingAmount', 'trailingPercent'])
|
1485
1485
|
response = None
|
1486
|
-
if
|
1486
|
+
if isConditional:
|
1487
1487
|
response = await self.v1PrivatePutAlgoOrder(self.extend(request, params))
|
1488
1488
|
else:
|
1489
1489
|
request['symbol'] = market['id']
|
@@ -1536,9 +1536,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1536
1536
|
:param str [params.clientOrderId]: a unique id for the order
|
1537
1537
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1538
1538
|
"""
|
1539
|
-
|
1539
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
1540
1540
|
params = self.omit(params, ['stop', 'trigger'])
|
1541
|
-
if not
|
1541
|
+
if not trigger and (symbol is None):
|
1542
1542
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
1543
1543
|
await self.load_markets()
|
1544
1544
|
market: Market = None
|
@@ -1551,7 +1551,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1551
1551
|
clientOrderIdExchangeSpecific = self.safe_string(params, 'client_order_id', clientOrderIdUnified)
|
1552
1552
|
isByClientOrder = clientOrderIdExchangeSpecific is not None
|
1553
1553
|
response = None
|
1554
|
-
if
|
1554
|
+
if trigger:
|
1555
1555
|
if isByClientOrder:
|
1556
1556
|
request['client_order_id'] = clientOrderIdExchangeSpecific
|
1557
1557
|
params = self.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
|
@@ -1587,7 +1587,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1587
1587
|
extendParams['client_order_id'] = clientOrderIdExchangeSpecific
|
1588
1588
|
else:
|
1589
1589
|
extendParams['id'] = id
|
1590
|
-
if
|
1590
|
+
if trigger:
|
1591
1591
|
return self.extend(self.parse_order(response), extendParams)
|
1592
1592
|
data = self.safe_dict(response, 'data', {})
|
1593
1593
|
return self.extend(self.parse_order(data), extendParams)
|
@@ -1642,18 +1642,18 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1642
1642
|
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1643
1643
|
"""
|
1644
1644
|
await self.load_markets()
|
1645
|
-
|
1645
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
1646
1646
|
params = self.omit(params, ['stop', 'trigger'])
|
1647
1647
|
request: dict = {}
|
1648
1648
|
if symbol is not None:
|
1649
1649
|
market = self.market(symbol)
|
1650
1650
|
request['symbol'] = market['id']
|
1651
1651
|
response = None
|
1652
|
-
if
|
1652
|
+
if trigger:
|
1653
1653
|
response = await self.v1PrivateDeleteAlgoOrders(self.extend(request, params))
|
1654
1654
|
else:
|
1655
1655
|
response = await self.v1PrivateDeleteOrders(self.extend(request, params))
|
1656
|
-
#
|
1656
|
+
# trigger
|
1657
1657
|
# {
|
1658
1658
|
# "success": True,
|
1659
1659
|
# "timestamp": 1702989203989,
|
@@ -1692,12 +1692,12 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1692
1692
|
"""
|
1693
1693
|
await self.load_markets()
|
1694
1694
|
market = self.market(symbol) if (symbol is not None) else None
|
1695
|
-
|
1695
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
1696
1696
|
request: dict = {}
|
1697
1697
|
clientOrderId = self.safe_string_n(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
|
1698
1698
|
params = self.omit(params, ['stop', 'trigger', 'clOrdID', 'clientOrderId', 'client_order_id'])
|
1699
1699
|
response = None
|
1700
|
-
if
|
1700
|
+
if trigger:
|
1701
1701
|
if clientOrderId:
|
1702
1702
|
request['client_order_id'] = clientOrderId
|
1703
1703
|
response = await self.v1PrivateGetAlgoClientOrderClientOrderId(self.extend(request, params))
|
@@ -2107,7 +2107,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
2107
2107
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2108
2108
|
:param int [limit]: max number of ledger entries to return, default is None
|
2109
2109
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2110
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2110
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2111
2111
|
"""
|
2112
2112
|
currency, rows = await self.get_asset_history_rows(code, since, limit, params)
|
2113
2113
|
return self.parse_ledger(rows, currency, since, limit, params)
|
ccxt/async_support/xt.py
CHANGED
@@ -2377,7 +2377,7 @@ class xt(Exchange, ImplicitAPI):
|
|
2377
2377
|
:param str id: order id
|
2378
2378
|
:param str [symbol]: unified symbol of the market the order was made in
|
2379
2379
|
:param dict params: extra parameters specific to the xt api endpoint
|
2380
|
-
:param bool [params.
|
2380
|
+
:param bool [params.trigger]: if the order is a trigger order or not
|
2381
2381
|
:param bool [params.stopLossTakeProfit]: if the order is a stop-loss or take-profit order
|
2382
2382
|
:returns dict: An `order structure <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
|
2383
2383
|
"""
|
@@ -2391,15 +2391,15 @@ class xt(Exchange, ImplicitAPI):
|
|
2391
2391
|
response = None
|
2392
2392
|
type, params = self.handle_market_type_and_params('fetchOrder', market, params)
|
2393
2393
|
subType, params = self.handle_sub_type_and_params('fetchOrder', market, params)
|
2394
|
-
|
2394
|
+
trigger = self.safe_value(params, 'stop')
|
2395
2395
|
stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
|
2396
|
-
if
|
2396
|
+
if trigger:
|
2397
2397
|
request['entrustId'] = id
|
2398
2398
|
elif stopLossTakeProfit:
|
2399
2399
|
request['profitId'] = id
|
2400
2400
|
else:
|
2401
2401
|
request['orderId'] = id
|
2402
|
-
if
|
2402
|
+
if trigger:
|
2403
2403
|
params = self.omit(params, 'stop')
|
2404
2404
|
if subType == 'inverse':
|
2405
2405
|
response = await self.privateInverseGetFutureTradeV1EntrustPlanDetail(self.extend(request, params))
|
@@ -2549,7 +2549,7 @@ class xt(Exchange, ImplicitAPI):
|
|
2549
2549
|
:param int [since]: timestamp in ms of the earliest order
|
2550
2550
|
:param int [limit]: the maximum number of order structures to retrieve
|
2551
2551
|
:param dict params: extra parameters specific to the xt api endpoint
|
2552
|
-
:param bool [params.
|
2552
|
+
:param bool [params.trigger]: if the order is a trigger order or not
|
2553
2553
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
|
2554
2554
|
"""
|
2555
2555
|
await self.load_markets()
|
@@ -2567,9 +2567,9 @@ class xt(Exchange, ImplicitAPI):
|
|
2567
2567
|
response = None
|
2568
2568
|
type, params = self.handle_market_type_and_params('fetchOrders', market, params)
|
2569
2569
|
subType, params = self.handle_sub_type_and_params('fetchOrders', market, params)
|
2570
|
-
|
2571
|
-
if
|
2572
|
-
params = self.omit(params, 'stop')
|
2570
|
+
trigger = self.safe_value_2(params, 'trigger', 'stop')
|
2571
|
+
if trigger:
|
2572
|
+
params = self.omit(params, ['trigger', 'stop'])
|
2573
2573
|
if subType == 'inverse':
|
2574
2574
|
response = await self.privateInverseGetFutureTradeV1EntrustPlanListHistory(self.extend(request, params))
|
2575
2575
|
else:
|
@@ -2710,31 +2710,31 @@ class xt(Exchange, ImplicitAPI):
|
|
2710
2710
|
response = None
|
2711
2711
|
type, params = self.handle_market_type_and_params('fetchOrdersByStatus', market, params)
|
2712
2712
|
subType, params = self.handle_sub_type_and_params('fetchOrdersByStatus', market, params)
|
2713
|
-
|
2713
|
+
trigger = self.safe_value(params, 'stop')
|
2714
2714
|
stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
|
2715
2715
|
if status == 'open':
|
2716
|
-
if
|
2716
|
+
if trigger or stopLossTakeProfit:
|
2717
2717
|
request['state'] = 'NOT_TRIGGERED'
|
2718
2718
|
elif subType is not None:
|
2719
2719
|
request['state'] = 'NEW'
|
2720
2720
|
elif status == 'closed':
|
2721
|
-
if
|
2721
|
+
if trigger or stopLossTakeProfit:
|
2722
2722
|
request['state'] = 'TRIGGERED'
|
2723
2723
|
else:
|
2724
2724
|
request['state'] = 'FILLED'
|
2725
2725
|
elif status == 'canceled':
|
2726
|
-
if
|
2726
|
+
if trigger or stopLossTakeProfit:
|
2727
2727
|
request['state'] = 'USER_REVOCATION'
|
2728
2728
|
else:
|
2729
2729
|
request['state'] = 'CANCELED'
|
2730
2730
|
else:
|
2731
2731
|
request['state'] = status
|
2732
|
-
if
|
2732
|
+
if trigger or stopLossTakeProfit or (subType is not None) or (type == 'swap') or (type == 'future'):
|
2733
2733
|
if since is not None:
|
2734
2734
|
request['startTime'] = since
|
2735
2735
|
if limit is not None:
|
2736
2736
|
request['size'] = limit
|
2737
|
-
if
|
2737
|
+
if trigger:
|
2738
2738
|
params = self.omit(params, 'stop')
|
2739
2739
|
if subType == 'inverse':
|
2740
2740
|
response = await self.privateInverseGetFutureTradeV1EntrustPlanList(self.extend(request, params))
|
@@ -2960,7 +2960,7 @@ class xt(Exchange, ImplicitAPI):
|
|
2960
2960
|
:param int [since]: timestamp in ms of the earliest order
|
2961
2961
|
:param int [limit]: the maximum number of open order structures to retrieve
|
2962
2962
|
:param dict params: extra parameters specific to the xt api endpoint
|
2963
|
-
:param bool [params.
|
2963
|
+
:param bool [params.trigger]: if the order is a trigger order or not
|
2964
2964
|
:param bool [params.stopLossTakeProfit]: if the order is a stop-loss or take-profit order
|
2965
2965
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
|
2966
2966
|
"""
|
@@ -2979,7 +2979,7 @@ class xt(Exchange, ImplicitAPI):
|
|
2979
2979
|
:param int [since]: timestamp in ms of the earliest order
|
2980
2980
|
:param int [limit]: the maximum number of order structures to retrieve
|
2981
2981
|
:param dict params: extra parameters specific to the xt api endpoint
|
2982
|
-
:param bool [params.
|
2982
|
+
:param bool [params.trigger]: if the order is a trigger order or not
|
2983
2983
|
:param bool [params.stopLossTakeProfit]: if the order is a stop-loss or take-profit order
|
2984
2984
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
|
2985
2985
|
"""
|
@@ -2998,7 +2998,7 @@ class xt(Exchange, ImplicitAPI):
|
|
2998
2998
|
:param int [since]: timestamp in ms of the earliest order
|
2999
2999
|
:param int [limit]: the maximum number of order structures to retrieve
|
3000
3000
|
:param dict params: extra parameters specific to the xt api endpoint
|
3001
|
-
:param bool [params.
|
3001
|
+
:param bool [params.trigger]: if the order is a trigger order or not
|
3002
3002
|
:param bool [params.stopLossTakeProfit]: if the order is a stop-loss or take-profit order
|
3003
3003
|
:returns dict: a list of `order structures <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
|
3004
3004
|
"""
|
@@ -3016,7 +3016,7 @@ class xt(Exchange, ImplicitAPI):
|
|
3016
3016
|
:param str id: order id
|
3017
3017
|
:param str [symbol]: unified symbol of the market the order was made in
|
3018
3018
|
:param dict params: extra parameters specific to the xt api endpoint
|
3019
|
-
:param bool [params.
|
3019
|
+
:param bool [params.trigger]: if the order is a trigger order or not
|
3020
3020
|
:param bool [params.stopLossTakeProfit]: if the order is a stop-loss or take-profit order
|
3021
3021
|
:returns dict: An `order structure <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
|
3022
3022
|
"""
|
@@ -3030,16 +3030,16 @@ class xt(Exchange, ImplicitAPI):
|
|
3030
3030
|
response = None
|
3031
3031
|
type, params = self.handle_market_type_and_params('cancelOrder', market, params)
|
3032
3032
|
subType, params = self.handle_sub_type_and_params('cancelOrder', market, params)
|
3033
|
-
|
3033
|
+
trigger = self.safe_value_2(params, 'trigger', 'stop')
|
3034
3034
|
stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
|
3035
|
-
if
|
3035
|
+
if trigger:
|
3036
3036
|
request['entrustId'] = id
|
3037
3037
|
elif stopLossTakeProfit:
|
3038
3038
|
request['profitId'] = id
|
3039
3039
|
else:
|
3040
3040
|
request['orderId'] = id
|
3041
|
-
if
|
3042
|
-
params = self.omit(params, 'stop')
|
3041
|
+
if trigger:
|
3042
|
+
params = self.omit(params, ['trigger', 'stop'])
|
3043
3043
|
if subType == 'inverse':
|
3044
3044
|
response = await self.privateInversePostFutureTradeV1EntrustCancelPlan(self.extend(request, params))
|
3045
3045
|
else:
|
@@ -3092,7 +3092,7 @@ class xt(Exchange, ImplicitAPI):
|
|
3092
3092
|
|
3093
3093
|
:param str [symbol]: unified market symbol of the market to cancel orders in
|
3094
3094
|
:param dict params: extra parameters specific to the xt api endpoint
|
3095
|
-
:param bool [params.
|
3095
|
+
:param bool [params.trigger]: if the order is a trigger order or not
|
3096
3096
|
:param bool [params.stopLossTakeProfit]: if the order is a stop-loss or take-profit order
|
3097
3097
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
|
3098
3098
|
"""
|
@@ -3107,10 +3107,10 @@ class xt(Exchange, ImplicitAPI):
|
|
3107
3107
|
response = None
|
3108
3108
|
type, params = self.handle_market_type_and_params('cancelAllOrders', market, params)
|
3109
3109
|
subType, params = self.handle_sub_type_and_params('cancelAllOrders', market, params)
|
3110
|
-
|
3110
|
+
trigger = self.safe_value_2(params, 'trigger', 'stop')
|
3111
3111
|
stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
|
3112
|
-
if
|
3113
|
-
params = self.omit(params, 'stop')
|
3112
|
+
if trigger:
|
3113
|
+
params = self.omit(params, ['trigger', 'stop'])
|
3114
3114
|
if subType == 'inverse':
|
3115
3115
|
response = await self.privateInversePostFutureTradeV1EntrustCancelAllPlan(self.extend(request, params))
|
3116
3116
|
else:
|
ccxt/async_support/zonda.py
CHANGED
@@ -853,7 +853,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
853
853
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
854
854
|
:param int [limit]: max number of ledger entries to return, default is None
|
855
855
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
856
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
856
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
857
857
|
"""
|
858
858
|
balanceCurrencies = []
|
859
859
|
if code is not None:
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.40'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -2300,26 +2300,23 @@ class Exchange(object):
|
|
2300
2300
|
wssProxy = None
|
2301
2301
|
wsSocksProxy = None
|
2302
2302
|
# ws proxy
|
2303
|
-
|
2303
|
+
isWsProxyDefined = self.value_is_defined(self.wsProxy)
|
2304
|
+
is_ws_proxy_defined = self.value_is_defined(self.ws_proxy)
|
2305
|
+
if isWsProxyDefined or is_ws_proxy_defined:
|
2304
2306
|
usedProxies.append('wsProxy')
|
2305
|
-
wsProxy = self.wsProxy
|
2306
|
-
if self.value_is_defined(self.ws_proxy):
|
2307
|
-
usedProxies.append('ws_proxy')
|
2308
|
-
wsProxy = self.ws_proxy
|
2307
|
+
wsProxy = self.wsProxy if (isWsProxyDefined) else self.ws_proxy
|
2309
2308
|
# wss proxy
|
2310
|
-
|
2309
|
+
isWssProxyDefined = self.value_is_defined(self.wssProxy)
|
2310
|
+
is_wss_proxy_defined = self.value_is_defined(self.wss_proxy)
|
2311
|
+
if isWssProxyDefined or is_wss_proxy_defined:
|
2311
2312
|
usedProxies.append('wssProxy')
|
2312
|
-
wssProxy = self.wssProxy
|
2313
|
-
if self.value_is_defined(self.wss_proxy):
|
2314
|
-
usedProxies.append('wss_proxy')
|
2315
|
-
wssProxy = self.wss_proxy
|
2313
|
+
wssProxy = self.wssProxy if (isWssProxyDefined) else self.wss_proxy
|
2316
2314
|
# ws socks proxy
|
2317
|
-
|
2315
|
+
isWsSocksProxyDefined = self.value_is_defined(self.wsSocksProxy)
|
2316
|
+
is_ws_socks_proxy_defined = self.value_is_defined(self.ws_socks_proxy)
|
2317
|
+
if isWsSocksProxyDefined or is_ws_socks_proxy_defined:
|
2318
2318
|
usedProxies.append('wsSocksProxy')
|
2319
|
-
wsSocksProxy = self.wsSocksProxy
|
2320
|
-
if self.value_is_defined(self.ws_socks_proxy):
|
2321
|
-
usedProxies.append('ws_socks_proxy')
|
2322
|
-
wsSocksProxy = self.ws_socks_proxy
|
2319
|
+
wsSocksProxy = self.wsSocksProxy if (isWsSocksProxyDefined) else self.ws_socks_proxy
|
2323
2320
|
# check
|
2324
2321
|
length = len(usedProxies)
|
2325
2322
|
if length > 1:
|
ccxt/binance.py
CHANGED
@@ -6009,14 +6009,10 @@ class binance(Exchange, ImplicitAPI):
|
|
6009
6009
|
marginMode = None
|
6010
6010
|
marginMode, params = self.handle_margin_mode_and_params('createOrder', params)
|
6011
6011
|
reduceOnly = self.safe_bool(params, 'reduceOnly', False)
|
6012
|
-
if
|
6013
|
-
|
6014
|
-
|
6015
|
-
|
6016
|
-
request['reduceOnly'] = reduceOnly
|
6017
|
-
else:
|
6018
|
-
if reduceOnly:
|
6019
|
-
request['sideEffectType'] = 'AUTO_REPAY'
|
6012
|
+
if reduceOnly:
|
6013
|
+
if marketType == 'margin' or (not market['contract'] and (marginMode is not None)):
|
6014
|
+
params = self.omit(params, 'reduceOnly')
|
6015
|
+
request['sideEffectType'] = 'AUTO_REPAY'
|
6020
6016
|
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
6021
6017
|
stopLossPrice = self.safe_string(params, 'stopLossPrice', triggerPrice) # fallback to stopLoss
|
6022
6018
|
takeProfitPrice = self.safe_string(params, 'takeProfitPrice')
|
@@ -6373,7 +6369,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6373
6369
|
:param int [params.until]: the latest time in ms to fetch orders for
|
6374
6370
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
6375
6371
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch orders in a portfolio margin account
|
6376
|
-
:param boolean [params.
|
6372
|
+
:param boolean [params.trigger]: set to True if you would like to fetch portfolio margin account trigger or conditional orders
|
6377
6373
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
6378
6374
|
"""
|
6379
6375
|
if symbol is None:
|
@@ -6630,7 +6626,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6630
6626
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6631
6627
|
:param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
|
6632
6628
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch open orders in the portfolio margin account
|
6633
|
-
:param boolean [params.
|
6629
|
+
:param boolean [params.trigger]: set to True if you would like to fetch portfolio margin account conditional orders
|
6634
6630
|
:param str [params.subType]: "linear" or "inverse"
|
6635
6631
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
6636
6632
|
"""
|
@@ -6916,7 +6912,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6916
6912
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6917
6913
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
6918
6914
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch orders in a portfolio margin account
|
6919
|
-
:param boolean [params.
|
6915
|
+
:param boolean [params.trigger]: set to True if you would like to fetch portfolio margin account trigger or conditional orders
|
6920
6916
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
6921
6917
|
"""
|
6922
6918
|
if symbol is None:
|
@@ -6945,7 +6941,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6945
6941
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6946
6942
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
6947
6943
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch orders in a portfolio margin account
|
6948
|
-
:param boolean [params.
|
6944
|
+
:param boolean [params.trigger]: set to True if you would like to fetch portfolio margin account trigger or conditional orders
|
6949
6945
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
6950
6946
|
"""
|
6951
6947
|
if symbol is None:
|
@@ -6974,7 +6970,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6974
6970
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6975
6971
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
6976
6972
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch orders in a portfolio margin account
|
6977
|
-
:param boolean [params.
|
6973
|
+
:param boolean [params.trigger]: set to True if you would like to fetch portfolio margin account trigger or conditional orders
|
6978
6974
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
6979
6975
|
"""
|
6980
6976
|
if symbol is None:
|
@@ -7005,7 +7001,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7005
7001
|
:param str symbol: unified symbol of the market the order was made in
|
7006
7002
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7007
7003
|
:param boolean [params.portfolioMargin]: set to True if you would like to cancel an order in a portfolio margin account
|
7008
|
-
:param boolean [params.
|
7004
|
+
:param boolean [params.trigger]: set to True if you would like to cancel a portfolio margin account conditional order
|
7009
7005
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
7010
7006
|
"""
|
7011
7007
|
if symbol is None:
|
@@ -7085,7 +7081,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7085
7081
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7086
7082
|
:param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
|
7087
7083
|
:param boolean [params.portfolioMargin]: set to True if you would like to cancel orders in a portfolio margin account
|
7088
|
-
:param boolean [params.
|
7084
|
+
:param boolean [params.trigger]: set to True if you would like to cancel portfolio margin account conditional orders
|
7089
7085
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
7090
7086
|
"""
|
7091
7087
|
if symbol is None:
|
@@ -10839,7 +10835,7 @@ class binance(Exchange, ImplicitAPI):
|
|
10839
10835
|
:param str id: the identification number of the ledger entry
|
10840
10836
|
:param str code: unified currency code
|
10841
10837
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
10842
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
10838
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
10843
10839
|
"""
|
10844
10840
|
self.load_markets()
|
10845
10841
|
type = None
|
@@ -10885,7 +10881,7 @@ class binance(Exchange, ImplicitAPI):
|
|
10885
10881
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
10886
10882
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch the ledger for a portfolio margin account
|
10887
10883
|
:param str [params.subType]: "linear" or "inverse"
|
10888
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
10884
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
10889
10885
|
"""
|
10890
10886
|
self.load_markets()
|
10891
10887
|
paginate = False
|
ccxt/bingx.py
CHANGED
@@ -3439,7 +3439,6 @@ class bingx(Exchange, ImplicitAPI):
|
|
3439
3439
|
'postOnly': None,
|
3440
3440
|
'side': self.parse_order_side(side),
|
3441
3441
|
'price': self.safe_string_2(order, 'price', 'p'),
|
3442
|
-
'stopPrice': triggerPrice,
|
3443
3442
|
'triggerPrice': triggerPrice,
|
3444
3443
|
'stopLossPrice': stopLossPrice,
|
3445
3444
|
'takeProfitPrice': takeProfitPrice,
|
@@ -5872,7 +5871,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
5872
5871
|
:param float amount: how much of the currency you want to trade in units of the base currency
|
5873
5872
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5874
5873
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5875
|
-
:param str [params.
|
5874
|
+
:param str [params.triggerPrice]: Trigger price used for TAKE_STOP_LIMIT, TAKE_STOP_MARKET, TRIGGER_LIMIT, TRIGGER_MARKET order types.
|
5876
5875
|
:param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
5877
5876
|
:param float [params.takeProfit.triggerPrice]: take profit trigger price
|
5878
5877
|
:param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
ccxt/bit2c.py
CHANGED
ccxt/bitbank.py
CHANGED
ccxt/bitbns.py
CHANGED
ccxt/bitfinex.py
CHANGED
@@ -1483,10 +1483,10 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1483
1483
|
if flags[i] == 'postOnly':
|
1484
1484
|
postOnly = True
|
1485
1485
|
price = self.safe_string(orderList, 16)
|
1486
|
-
|
1486
|
+
triggerPrice = None
|
1487
1487
|
if (orderType == 'EXCHANGE STOP') or (orderType == 'EXCHANGE STOP LIMIT'):
|
1488
1488
|
price = None
|
1489
|
-
|
1489
|
+
triggerPrice = self.safe_string(orderList, 16)
|
1490
1490
|
if orderType == 'EXCHANGE STOP LIMIT':
|
1491
1491
|
price = self.safe_string(orderList, 19)
|
1492
1492
|
status = None
|
@@ -1509,8 +1509,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1509
1509
|
'postOnly': postOnly,
|
1510
1510
|
'side': side,
|
1511
1511
|
'price': price,
|
1512
|
-
'
|
1513
|
-
'triggerPrice': stopPrice,
|
1512
|
+
'triggerPrice': triggerPrice,
|
1514
1513
|
'amount': amount,
|
1515
1514
|
'cost': None,
|
1516
1515
|
'average': average,
|
@@ -1531,7 +1530,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1531
1530
|
:param float amount: how much you want to trade in units of the base currency
|
1532
1531
|
:param float [price]: the price of the order, in units of the quote currency, ignored in market orders
|
1533
1532
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1534
|
-
:param float [params.
|
1533
|
+
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
1535
1534
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1536
1535
|
:param bool [params.postOnly]:
|
1537
1536
|
:param bool [params.reduceOnly]: Ensures that the executed order does not flip the opened position.
|
@@ -1549,7 +1548,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1549
1548
|
'symbol': market['id'],
|
1550
1549
|
'amount': amountString,
|
1551
1550
|
}
|
1552
|
-
|
1551
|
+
triggerPrice = self.safe_string_2(params, 'stopPrice', 'triggerPrice')
|
1553
1552
|
trailingAmount = self.safe_string(params, 'trailingAmount')
|
1554
1553
|
timeInForce = self.safe_string(params, 'timeInForce')
|
1555
1554
|
postOnlyParam = self.safe_bool(params, 'postOnly', False)
|
@@ -1559,9 +1558,9 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1559
1558
|
if trailingAmount is not None:
|
1560
1559
|
orderType = 'TRAILING STOP'
|
1561
1560
|
request['price_trailing'] = trailingAmount
|
1562
|
-
elif
|
1561
|
+
elif triggerPrice is not None:
|
1563
1562
|
# request['price'] is taken for stop orders
|
1564
|
-
request['price'] = self.price_to_precision(symbol,
|
1563
|
+
request['price'] = self.price_to_precision(symbol, triggerPrice)
|
1565
1564
|
if type == 'limit':
|
1566
1565
|
orderType = 'STOP LIMIT'
|
1567
1566
|
request['price_aux_limit'] = self.price_to_precision(symbol, price)
|
@@ -1574,7 +1573,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1574
1573
|
raise InvalidOrder(self.id + ' createOrder() requires a price argument with IOC and FOK orders')
|
1575
1574
|
if (ioc or fok) and (type == 'market'):
|
1576
1575
|
raise InvalidOrder(self.id + ' createOrder() does not allow market IOC and FOK orders')
|
1577
|
-
if (type != 'market') and (
|
1576
|
+
if (type != 'market') and (triggerPrice is None):
|
1578
1577
|
request['price'] = self.price_to_precision(symbol, price)
|
1579
1578
|
if ioc:
|
1580
1579
|
orderType = 'IOC'
|
@@ -1611,7 +1610,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1611
1610
|
:param float amount: the amount of currency to trade
|
1612
1611
|
:param float [price]: price of the order
|
1613
1612
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1614
|
-
:param float [params.
|
1613
|
+
:param float [params.triggerPrice]: the price that triggers a trigger order
|
1615
1614
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1616
1615
|
:param boolean [params.postOnly]: set to True if you want to make a post only order
|
1617
1616
|
:param boolean [params.reduceOnly]: indicates that the order is to reduce the size of a position
|
@@ -2849,7 +2848,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
2849
2848
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2850
2849
|
:param int [params.until]: timestamp in ms of the latest ledger entry
|
2851
2850
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
2852
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2851
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2853
2852
|
"""
|
2854
2853
|
self.load_markets()
|
2855
2854
|
paginate = False
|
@@ -3520,7 +3519,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
3520
3519
|
:param float amount: how much you want to trade in units of the base currency
|
3521
3520
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
3522
3521
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3523
|
-
:param float [params.
|
3522
|
+
:param float [params.triggerPrice]: the price that triggers a trigger order
|
3524
3523
|
:param boolean [params.postOnly]: set to True if you want to make a post only order
|
3525
3524
|
:param boolean [params.reduceOnly]: indicates that the order is to reduce the size of a position
|
3526
3525
|
:param int [params.flags]: additional order parameters: 4096(Post Only), 1024(Reduce Only), 16384(OCO), 64(Hidden), 512(Close), 524288(No Var Rates)
|
@@ -3538,7 +3537,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
3538
3537
|
amountString = self.amount_to_precision(symbol, amount)
|
3539
3538
|
amountString = amountString if (side == 'buy') else Precise.string_neg(amountString)
|
3540
3539
|
request['amount'] = amountString
|
3541
|
-
|
3540
|
+
triggerPrice = self.safe_string_2(params, 'stopPrice', 'triggerPrice')
|
3542
3541
|
trailingAmount = self.safe_string(params, 'trailingAmount')
|
3543
3542
|
timeInForce = self.safe_string(params, 'timeInForce')
|
3544
3543
|
postOnlyParam = self.safe_bool(params, 'postOnly', False)
|
@@ -3546,13 +3545,13 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
3546
3545
|
clientOrderId = self.safe_integer_2(params, 'cid', 'clientOrderId')
|
3547
3546
|
if trailingAmount is not None:
|
3548
3547
|
request['price_trailing'] = trailingAmount
|
3549
|
-
elif
|
3548
|
+
elif triggerPrice is not None:
|
3550
3549
|
# request['price'] is taken for stop orders
|
3551
|
-
request['price'] = self.price_to_precision(symbol,
|
3550
|
+
request['price'] = self.price_to_precision(symbol, triggerPrice)
|
3552
3551
|
if type == 'limit':
|
3553
3552
|
request['price_aux_limit'] = self.price_to_precision(symbol, price)
|
3554
3553
|
postOnly = (postOnlyParam or (timeInForce == 'PO'))
|
3555
|
-
if (type != 'market') and (
|
3554
|
+
if (type != 'market') and (triggerPrice is None):
|
3556
3555
|
request['price'] = self.price_to_precision(symbol, price)
|
3557
3556
|
# flag values may be summed to combine flags
|
3558
3557
|
flags = 0
|