mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-10 16:58:08 +00:00
32 lines
618 B
Markdown
32 lines
618 B
Markdown
- [Binance Futures Positions](./examples/py/)
|
|
|
|
|
|
```python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import os
|
|
import sys
|
|
from pprint import pprint
|
|
|
|
|
|
import ccxt # noqa: E402
|
|
|
|
print('CCXT Version:', ccxt.__version__)
|
|
|
|
exchange = ccxt.binance({
|
|
'apiKey': 'YOUR_TESTNET_API_KEY',
|
|
'secret': 'YOUR_TESTNET_API_SECRET',
|
|
'options': {
|
|
'defaultType': 'future',
|
|
},
|
|
})
|
|
|
|
exchange.set_sandbox_mode(True) # comment if you're not using the testnet
|
|
markets = exchange.load_markets()
|
|
exchange.verbose = True # debug output
|
|
|
|
balance = exchange.fetch_balance()
|
|
positions = balance['info']['positions']
|
|
pprint(positions)
|
|
|
|
``` |