1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

python bitmex 新規注文につていて

Last updated at Posted at 2018-06-24

bitmexのapiを使って注文をしたいです。

このコードだと注文が通るのですが。記下のコードだとエラーになってしまします。宜しくお願い致します

注文成功コード

import ccxt
import json

bitmex = ccxt.bitmex({
       #APIキーをご自分のものに差し替えてください
       'apiKey': 'ほげほげ',
       'secret': 'ほげほげ',
})

print(bitmex.publicGetInstrument({'symbol': 'XBTUSD'})[0]['lastPrice'])
entryPrice = (bitmex.publicGetInstrument({'symbol': 'XBTUSD'})[0]['lastPrice'])

bitmex.create_market_buy_order(symbol='BTC/USD', amount=1)

注文失敗コード

import ccxt
import json

bitmex = ccxt.bitmex({
       #APIキーをご自分のものに差し替えてください
       'apiKey': 'ほげほげ',
       'secret': 'ほげほげ',
})

print(bitmex.publicGetInstrument({'symbol': 'XBTUSD'})[0]['lastPrice'])
entryPrice = (bitmex.publicGetInstrument({'symbol': 'XBTUSD'})[0]['lastPrice'])


bitmex.create_StopLimit_order(symbol='BTC/USD', orderQty=1,stopPx=8000,price=8000,side="BUY")
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?