API Trading SDK
Here we describe how to create a new self-hosted strategy, open and close positions using the Mizar python SDK
Self-hosted strategies are strategies hosted by quants/trading firms on their own servers.
Creating a new self-hosted strategy
Install the Mizar client and follow the instruction below.
from mizar import Mizar
mizar_client = Mizar()
mizar_client.create_self_hosted_strategy(
name="My Strategy",
description="My Strategy works this way",
exchanges=["binance"],
symbols=["BTCUSDT"],
market="SPOT"
)
The strategy creation returns a dictionary with the following format
{
'creation_timestamp': 1625571350830,
'exchange': 'binance',
'market': 'SPOT',
'name': 'My Strategy',
'strategy_id': 1,
'symbols': [
{
'base_asset': 'BTC',
'quote_asset': 'USDT',
'symbol': 'BTCUSDT'
}
]
}
Open a position
Open a new position using the open_position method
If the position opening is successful it will return a dictionary with the following format
Close a position
Close an existing open position using the close_position method
If the position is closed successfully you will receive
List all open positions
Get all the open positions using get_all_open_positions method
Will return
Close all open positions
Close all the positions using close_all_positions method
Will return
Last updated
Was this helpful?