question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The problem of Gate.io's privateFuturesPostSettlePriceOrders' price

See original GitHub issue

Make sure your local version of CCXT is up to date. Check by comparing the output of ccxt.version to https://github.com/ccxt/ccxt/blob/master/package.json#L3

  • OS: Ubuntu
  • Programming Language version: Python 3.7.0
  • CCXT version:1.79.88
short_sl_order = exchange.privateFuturesPostSettlePriceOrders({"initial": {"contract": "BTC_USDT", "size": 0, "price": 0, "tif": "gtc", "reduce_only": True},
                                              "trigger": {"strategy_type": 0, "price_type": 0, "price": short_sl_price, "rule": 1},
                                              "order_type": "plan-close-short-position", 'settle': 'usdt'})
gateio {“label“:“AUTO_INVALID_REQUEST_BODY“,“message“:“invalid json json: cannot unmarshal number into Go struct field FutureReqOrder.initial.price of type string“}

I don’t know why this happened. the variable short_sl_price is str. Do I need to use float to do it?

Could you please help me? Thank you very much.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
samgermaincommented, Jun 13, 2022

For stop loss, you’ll need to set the stop price

  • higher than current for shorts (e.g. if current price is 2, you lose money as the price goes up, so you want a stopPrice higher than 2)
  • lower than current for longs

If you need to do the opposite, you’ll have to mess with params, and set them equal to something like in your original comment, because these get passed straight to the exchange

params = {"initial": {"contract": "BTC_USDT", "size": 0, "price": 0, "tif": "gtc", "reduce_only": True}, "trigger": {"strategy_type": 0, "price_type": 0, "price": short_sl_price, "rule": 1}

0reactions
Ben0nicommented, Jun 13, 2022

Thank you again, I think now it is clear. Thank you very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apple announces biggest upgrade to App Store pricing ...
Apple announces biggest upgrade to App Store pricing, adding 700 new price points. Developers will also gain new flexibility to manage pricing ......
Read more >
Apple batterygate letter full text - CNBC
Apple is reducing the price of an out-of-warranty iPhone battery replacement by $50 — from $79 to $29 — for anyone with an...
Read more >
'Charge-gate'? Emerging reports of charging-port issues in ...
This issue apparently affects both the iPhone XS and XS Max. ... Hopefully - especially considering the price demanded for these updated ...
Read more >
Apple iOS 16 Release: Should You Upgrade? - Forbes
This is why every new generation of iOS and iPadOS has trouble out the gate, and iOS 16 / iPadOS 16 are no...
Read more >
iPhone 4 - Wikipedia
Apple released iOS 4.0.1 to try to fix these issues, but were unsuccessful. The iPhone 4 spent the longest time as Apple's flagship...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found