Metadata-Version: 2.4
Name: pycffex
Version: 0.1.1
Summary: cffex with python: gb futures, index futures, and options
Author-email: rhozhang <rhozhang@163.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/rhozhang/pycffex
Project-URL: Issues, https://github.com/rhozhang/pycffex/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: pandas
Requires-Dist: polars
Requires-Dist: akshare
Requires-Dist: cnexchcal
Requires-Dist: cnfixedratebond
Dynamic: license-file

# CFFEX

A python package for China Financial Futures Exchange (CFFEX) products, including government bond futures, index futures, and index options.

## Installation

```
pip install pycffex
```

## GB Futures

- Attributes
    * tenor: int, tenor of underlying, 2, 5, 10, or 30
    * code: str, code of futures of the given tenor, 'TS', 'TF', 'T', 'TL'
    * listdate 
- Methods
    * lasttradingday()
    * getcontracts(): contracts available on the given trading date
    * deliverable(): whether a given bond is deliverable for the given contract month
    * conversionfactor(): conversion factor of a given deliverable bond for the given contract month
    * invoiceprice(): invoice price for delivery
    * irr(): implied repo rate for a given deliverable bond
    * ...

## Index Futures

**Contracts**

| code      | underlying     | multiplier |
|:---------:|:---------------|-----------:|
| IF        | csi 300        | 300        |
| IC        | csi 500        | 200        |
| IM        | csi 1000       | 200        |
| IH        | sse 50         | 300        |

- contract month: current month, next month, subsequent 2 quarterly month
- last trading day: the 3rd Friday of contract month
- delivery method: cash settlement
- delivery date: last trading day

**Attributes**: underlying, code, listdate

**Methods**

* lasttradingday(contractmon)
* getcontracts(tradedate)
* spothist(startdate, enddate)
* futhist(startdate, enddate)
* ...

## Index Options

**Contracts**

| code      | underlying     | multiplier |
|:---------:|:---------------|-----------:|
| IO        | csi 300        | 100        |
| MO        | csi 1000       | 100        |
| HO        | sse 50         | 100        |

- contract months: current month, next 2 months, subseuently 3 quarterly months
- last trading day: the 3rd Friday of contract month
- delivery method: cash settlement
- delivery date: last trading day
- 

**Attributes**: underlyings, multiplier, exercisetype, listdates

**Methods**

- contractcode()
- lasttradingday()
- contractcode()
- contractmons()
- exercisedata()
- impliedvolatility()
