Skip to content

Commit

Permalink
added examples/py/bitmex-create-order.py fix ccxt#2499
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Apr 9, 2018
1 parent 77bb0f6 commit d74dff3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions examples/py/bitmex-create-order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-

import os
import sys

root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')

import ccxt # noqa: E402


exchange = ccxt.bitmex({
'apiKey': 'YOUR_API_KEY',
'secret': 'YOUR_SECRET',
'enableRateLimit': True,
})

symbol = 'XBTM18' # bitcoin contract according to bitmex futures coding
type = 'StopLimit' # or 'market', or 'Stop' or 'StopLimit'
side = 'sell' # or 'buy'
amount = 1.0
price = 6500.0 # or None

# extra params and overrides
params = {
'stopPx': 6000.0, # if needed
}

order = exchange.create_order(symbol, type, side, amount, price, params)
print(order)

0 comments on commit d74dff3

Please sign in to comment.