Metadata-Version: 2.1
Name: ibkrbox
Version: 0.4.0
Summary: box spread utility for interactive brokers
Home-page: https://github.com/asemx/ibkrbox
Author: asemx
Author-email: 998264+asemx@users.noreply.github.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: click (>=8.1.3,<9.0.0)
Requires-Dist: click-log (>=0.4.0,<0.5.0)
Requires-Dist: ib-insync (>=0.9.71,<0.10.0)
Requires-Dist: pandas (>=1.5.1,<2.0.0)
Project-URL: Documentation, https://github.com/asemx/ibkrbox/blob/main/README.md
Project-URL: Repository, https://github.com/asemx/ibkrbox.git
Description-Content-Type: text/markdown

# 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.

## Installation
```code
pip install ibkrbox
```

## Usage

```code
ibkrbox -h
```
<img width="629" alt="image" src="https://user-images.githubusercontent.com/998264/200383898-c9433221-0107-4366-9b06-60179233f5c1.png">


### 1. construct a combo SPX Box Spread lending for 50K, duration 4 months, and display ("--show" option ensures it will not be executed)
```code
ibkrbox -a 50000 -m 4 --show
```
<img width="795" alt="image" src="https://user-images.githubusercontent.com/998264/200384213-06b1e995-6cfb-4c68-a022-53385b3e494f.png">


### 2. construct a combo SPX Box Spread borrowing for 50K, duration 4 months, and display.
```code
ibkrbox -a 50000 -m 4 --show --short
```

