get_roll_yield
Compute roll yield for any two futures contracts on a given trading day. Specify date, variety, and contract symbols; optionally provide price data to speed up calculation.
Instructions
指定交易日指定品种(主力和次主力)或任意两个合约的展期收益率 Parameters
date: string 某一天日期 format: YYYYMMDD var: string 合约品种如 RB、AL 等 symbol1: string 合约 1 如 rb1810 symbol2: string 合约 2 如 rb1812 df: DataFrame或None 从dailyBar得到合约价格,如果为空就在函数内部抓dailyBar,直接喂给数据可以让计算加快
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| df | No | ||
| var | No | BB | |
| date | No | ||
| symbol1 | No | ||
| symbol2 | No |