This commit is contained in:
Skyler Feng 2022-10-31 18:23:57 +08:00
parent 417f3976b8
commit 5b5e4a2357
3 changed files with 1118 additions and 3 deletions

BIN
.DS_Store vendored

Binary file not shown.

1092
example/derivatives_en.ipynb Normal file

File diff suppressed because it is too large Load Diff

View File

@ -137,7 +137,7 @@
"source": [ "source": [
"import okx.Funding as Funding\n", "import okx.Funding as Funding\n",
"\n", "\n",
"flag = \"1\" # live trading:0 , demo trading1\n", "flag = \"1\" # live trading: 0, demo trading: 1\n",
"\n", "\n",
"fundingAPI = Funding.FundingAPI(api_key, secret_key, passphrase, False, flag)\n", "fundingAPI = Funding.FundingAPI(api_key, secret_key, passphrase, False, flag)\n",
"\n", "\n",
@ -168,7 +168,7 @@
"source": [ "source": [
"import okx.MarketData as MarketData\n", "import okx.MarketData as MarketData\n",
"\n", "\n",
"flag = \"1\" # live trading:0 , demo trading1\n", "flag = \"1\" # live trading: 0, demo trading: 1\n",
"\n", "\n",
"marketDataAPI = MarketData.MarketAPI(flag=flag)\n", "marketDataAPI = MarketData.MarketAPI(flag=flag)\n",
"\n", "\n",
@ -333,7 +333,30 @@
"source": [ "source": [
"import okx.Account as Account\n", "import okx.Account as Account\n",
"\n", "\n",
"flag = \"1\" # live trading:0 , demo trading1\n", "flag = \"1\" # live trading: 0, demo trading: 1\n",
"\n",
"accountAPI = Account.AccountAPI(api_key, secret_key, passphrase, False, flag)\n",
"\n",
"result = accountAPI.get_max_avail_size(\n",
" instId=\"BTC-USDT\",\n",
" tdMode=\"cash\"\n",
")\n",
"print(result)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"import okx.Account as Account\n",
"\n",
"flag = \"1\" # live trading: 0, demo trading: 1\n",
"\n", "\n",
"accountAPI = Account.AccountAPI(api_key, secret_key, passphrase, False, flag)\n", "accountAPI = Account.AccountAPI(api_key, secret_key, passphrase, False, flag)\n",
"\n", "\n",