We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code:
exch = ccxt.kraken({ "enableRateLimit": True, "apiKey": key, "secret": secret, }) o = exch.create_order( symbol="ETH/USD", type="stop-loss-limit", side="buy", amount=0.01, price=1160, params={"price2": 1170}, ) o = exch.fetch_order(o["id"]) print("Order info:", o["info"]["descr"]["order"]) print("Stop price (Should be 1160):", o["stopPrice"]) print("Limit price (Should be 1170):", o["price"])
Output:
Order info: buy 0.01000000 ETHUSD @ stop loss 1160.00 -> limit 1170.00 Stop price (Should be 1160): 0.0 Limit price (Should be 1170): 1160.0
I've tracked down where the issue is occurring in the exchange source code. Initially, it actually gets the correct stop price from the order description: https://github.com/ccxt/ccxt/blob/master/python/ccxt/kraken.py#L1343 A few lines down though, it overwrites that value with 0: https://github.com/ccxt/ccxt/blob/master/python/ccxt/kraken.py#L1389
Below is the full order returned from calling exch.fetch_order(id):
exch.fetch_order(id)
{ 'info': { 'id': '', 'refid': None, 'userref': '0', 'status': 'open', 'opentm': '1656542790.9874883', 'starttm': '0', 'expiretm': '0', 'descr': { 'pair': 'ETHUSD', 'type': 'buy', 'ordertype': 'stop-loss-limit', 'price': '1160.00', 'price2': '1170.00', 'leverage': 'none', 'order': 'buy 0.01000000 ETHUSD @ stop loss 1160.00 -> limit 1170.00', 'close': '' }, 'vol': '0.01000000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq', 'reason': None }, 'id': '', 'clientOrderId': '0', 'timestamp': 1656542790987, 'datetime': '2022-06-29T22:46:30.987Z', 'lastTradeTimestamp': None, 'status': 'open', 'symbol': 'ETH/USD', 'type': 'stop-loss-limit', 'timeInForce': None, 'postOnly': None, 'side': 'buy', 'price': 1160.0, 'stopPrice': 0.0, 'cost': 0.0, 'amount': 0.01, 'filled': 0.0, 'average': None, 'remaining': 0.01, 'fee': {'cost': 0.0, 'rate': None, 'currency': 'USD'}, 'trades': [], 'fees': [{'cost': 0.0, 'rate': None, 'currency': 'USD'}] }
You can see that although the order description states "stop loss 1160.00", it also inexplicably has 'stopprice': '0.00000'.
"stop loss 1160.00"
'stopprice': '0.00000'
The text was updated successfully, but these errors were encountered:
frosty00
No branches or pull requests
Code:
Output:
I've tracked down where the issue is occurring in the exchange source code. Initially, it actually gets the correct stop price from the order description:
https://github.com/ccxt/ccxt/blob/master/python/ccxt/kraken.py#L1343
A few lines down though, it overwrites that value with 0:
https://github.com/ccxt/ccxt/blob/master/python/ccxt/kraken.py#L1389
Below is the full order returned from calling
exch.fetch_order(id)
:You can see that although the order description states
"stop loss 1160.00"
, it also inexplicably has'stopprice': '0.00000'
.The text was updated successfully, but these errors were encountered: