Skip to main content

box spread utility for interactive brokers

Project description

ibkrbox

Constructs a Box Spread combo order for SPX or ES futures option, only required arguments are amount you want to lend or borrow , and for how many months.

This utility will automatically look up current treasury rates, and add .30 to get the yield rate. This will be used to calculate limit price. rate or limit price can be overridden as needed.

It can also automatically calculate the right strikes and spread, with approximate expiry for given duration. All of these can be overridden as needed.

This utility is easy to install and use with existing IBKR TWS or gateway session. Just make sure to enable API access in the GUI of IBKR TWS or gateway.

Please file a issue if you notice any problem(s).

Installation

pip install ibkrbox

Usage

ibkrbox -h
image

1. construct a combo SPX Box Spread lending for 50K, duration 4 months (use "--execute" option to send the order to IBKR)

This will not execute the order, so you can safely run this.

ibkrbox -a 50000 -m 4
image

2. same as above but using Options on ES Futures (use "--execute" option to send the order to IBKR)

This will not execute the order, so you can safely run this.

ibkrbox -a 50000 -m 4 --es
image

3. construct a combo SPX Box Spread borrowing for 50K, duration 4 months (use "--execute" option to send the order to IBKR)

This will not execute the order, so you can safely run this.

ibkrbox -a 50000 -m 4 --short

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ibkrbox-0.6.0.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

ibkrbox-0.6.0-py3-none-any.whl (10.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page