ccxt / ccxt

A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
https://docs.ccxt.com
MIT License
32.93k stars 7.52k forks source link

how to use "set margin mode" #15716

Closed chaedongyoon closed 1 year ago

chaedongyoon commented 1 year ago

I would like to use "isolated margin" in Binance.

i think i maybe use set_margin_mode

image

if i want to use BTC/USDT, i input like this

exchange1.set_margin_mode(marginMode="isolated",symbol="BTC/USDT")

but it doest work.. please help me thanks!

image

samgermain commented 1 year ago

Can you copy and paste the error response that you're getting, or describe what isn't working exactly?

frosty00 commented 1 year ago

hi, setMarginMode is for futures trading only. To use isolated margin you can create an order like this:

binance.createOrder ('BTC/USDT', 'limit', 'buy', 0.01, 20000, { 'marginMode': 'isolated' })

let me know if this doesn't solve your issue

samgermain commented 1 year ago

I'm going to close this issue. Feel free to reopen it if you have any more questions