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.

How to change leverage and its mode on MECX?

See original GitHub issue

How i can change leverages and set mode for futures on MECX with ccxt?

mexc_futures = ccxt.mexc({
    "apiKey": config.MEXC_API_KEY,
    "secret": config.MEXC_SECRET_KEY,
    "options": {'defaultType': 'swap' }
})
mexc_futures.set_leverage(10, "BTC/USDT")

Got

ccxt.base.errors.ArgumentsRequired: mexc setLeverage() requires a positionId parameter

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
KindSpideycommented, May 18, 2022

Now works Thanks

1reaction
KindSpideycommented, May 17, 2022

`fetch Request: mexc POST https://contract.mexc.com/api/v1/private/position/change_leverage RequestHeaders: {‘ApiKey’: ‘mx0merTKMZUjmqMvm8’, ‘Request-Time’: ‘1652802870408’, ‘Content-Type’: ‘application/json’, ‘Signature’: ‘12de46df39d4b3e7b5f4dabf35a40a99a4c35e37e77d5e4b9bf7f1023f2a2623’, ‘User-Agent’: ‘python-requests/2.27.1’, ‘Accept-Encoding’: ‘gzip, deflate’, ‘Accept’: ‘/’, ‘Connection’: ‘keep-alive’} RequestBody: {“leverage”:10,“openType”:1,“symbol”:“ADA/USDT:USDT”,“positionType”:1}

fetch Response: mexc POST https://contract.mexc.com/api/v1/private/position/change_leverage 200 ResponseHeaders: {‘Content-Type’: ‘application/json’, ‘Content-Encoding’: ‘gzip’, ‘Content-Length’: ‘90’, ‘Expires’: ‘Tue, 17 May 2022 15:54:30 GMT’, ‘Cache-Control’: ‘max-age=0, no-cache, no-store’, ‘Pragma’: ‘no-cache’, ‘Date’: ‘Tue, 17 May 2022 15:54:30 GMT’, ‘Connection’: ‘keep-alive’, ‘Vary’: ‘Accept-Encoding’, ‘Server-Timing’: ‘cdn-cache; desc=MISS, edge; dur=116, origin; dur=12’} ResponseBody: {“success”:false,“code”:1001,“message”:“Contract does not exist!”} `

ccxt.base.errors.ExchangeError: mexc {"success":false,"code":1001,"message":"Contract does not exist!"}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lesson 3. How to Use Leverage Trading
In this video our YouTube Host Mark will guide you through process of margin trading and multiply assets. Ready to Earn by our...
Read more >
Isolated and Cross Margin
When using Isolated Margin, you are able to adjust your leverage on the fly via the leverage slider. Setting and Adjusting Isolated Margin....
Read more >
LEVERAGE TRADING with MEXC X2 | X5 | X10 - YouTube
Register an account with MEXC and get 20% off the trading fee ... This video will set you up for Margin Trading in...
Read more >
Unified contract naming conventions · Issue #10931 · ccxt ...
In order to unify the contract trading aspects CCXT is going to alter the way it handles ... How to change leverage and...
Read more >
Distance Education for Teacher Training: Modes, Models, ...
Section I: Distance Education: Modes and Models . ... This finding is consistent with the literature on teacher change, success, and persistence in...
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