Skip to content

Basic Bitmex operations needed to create a trading bot.

Notifications You must be signed in to change notification settings

NFSS10/Bitmex-API-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Bitmex API Example

Basic Bitmex operations needed to create a trading bot. For more information about the API: https://www.bitmex.com/app/apiOverview

Installation

pip install bitmex

pip install bitmex-ws

Usage

import bitmex as Bitmex

leverage = 10
api_key = "YOUR API KEY HERE"
api_secret = "YOUR API SECRET HERE"

Bitmex.init(api_key, api_secret)

print("Setting the leverage to " + str(leverage) + "x")
Bitmex.setTradingLeverage(leverage)

orderData = Bitmex.buyMarket(50)
priceBought = orderData[0]['price']
print("Bought 50 contracts at the market price of "+ str(priceBought) + " $")

About

Basic Bitmex operations needed to create a trading bot.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages