Skip to content

quantpylib.gateway.executor

Executor

Bases: BaseGateway

all_mids_subscribe(handler, exc, **kwargs) async

Subscribe to mid prices.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
handler coroutine

A coroutine handler for the message received.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

all_mids_unsubscribe(exc, **kwargs) async

Unsubscribe from mid prices.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required

cancel_open_orders(exc, **kwargs) async

Group cancel orders.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

cancel_order(exc, **kwargs) async

Cancel an order.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

get_all_marks(exc, **kwargs) async

Get all mark prices.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

get_all_mids(exc, **kwargs) async

Get all mid prices.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

l2_book_get(ticker, exc, **kwargs) async

Request data for L2 Order Book snapshot.

Parameters:

Name Type Description Default
ticker str

Ticker symbol.

required
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

l2_book_mirror(ticker, exc, **kwargs) async

Keep a local mirror copy of the L2 Order Book using orderbook updates.

Parameters:

Name Type Description Default
ticker str

Ticker symbol.

required
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

l2_book_peek(ticker, exc, **kwargs)

Retrieve the local mirror copy of the L2 Order Book.

Parameters:

Name Type Description Default
ticker str

Ticker symbol.

required
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

Returns:

Type Description

The local mirror copy of the L2 Order Book.

l2_book_subscribe(ticker, handler, exc, **kwargs) async

Subscribe to L2 Order Book update/increment/snapshot streams.

Parameters:

Name Type Description Default
ticker str

Ticker symbol.

required
handler coroutine

A coroutine handler for the message received.

required
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

l2_book_subscriptions(exc, **kwargs)

Get the current subscriptions to the L2 Order Book.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

Returns:

Type Description

The current L2 Order Book subscriptions.

l2_book_unsubscribe(ticker, exc, **kwargs) async

Unsubscribe from L2 Order Book update/increment/snapshot streams.

Parameters:

Name Type Description Default
ticker str

Ticker symbol.

required
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

limit_order(ticker, amount, exc, **kwargs) async

Submit limit order.

Parameters:

Name Type Description Default
ticker str

Ticker symbol.

required
amount float or Decimal

The positive/negative quantity of contracts to long/short.

required
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

market_order(ticker, amount, exc, **kwargs) async

Submit market order.

Parameters:

Name Type Description Default
ticker str

Ticker symbol.

required
amount float or Decimal

The positive/negative quantity of contracts to long/short.

required
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

rand_cloid(exc, **kwargs)

Generate a random client order id.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

trades_subscribe(ticker, handler, exc, **kwargs) async

Subscribe to ticker trades.

Parameters:

Name Type Description Default
ticker str

Ticker symbol.

required
handler coroutine

A coroutine handler for the message received.

required
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

trades_unsubscribe(ticker, exc, **kwargs) async

Unsubscribe from ticker trades.

Parameters:

Name Type Description Default
ticker str

Ticker symbol.

required
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}