Futures Data
futures(contract_code, date)
Fetches data for a specified futures contract based on type and reference date.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
contract_code
|
str
|
The B3 futures contract code identifying the derivative. Supported contract codes are: - "DI1": One-day Interbank Deposit Futures (Futuro de DI) from B3. - "DDI": DI x U.S. Dollar Spread Futures (Futuro de Cupom Cambial) from B3. - "FRC": Forward Rate Agreement (FRA) from B3. - "DAP": DI x IPCA Spread Futures. - "DOL": U.S. Dollar Futures from B3. - "WDO": Mini U.S. Dollar Futures from B3. - "IND": Ibovespa Futures from B3. - "WIN": Mini Ibovespa Futures from B3. |
required |
date
|
DateScalar
|
The date for which to fetch the data. If the reference date is a string, it should be in 'DD-MM-YYYY' format. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: DataFrame containing the fetched data for the specified futures contract. |
Raises:
Type | Description |
---|---|
ValueError
|
If the futures contract code is not recognized or supported. |
Examples:
>>> futures("DI1", "31-05-2024")
TradeDate TickerSymbol ... SettlementRate ForwardRate
0 2024-05-31 DI1M24 ... 0.10399 0.10399
1 2024-05-31 DI1N24 ... 0.1039 0.103896
2 2024-05-31 DI1Q24 ... 0.1037 0.103517
3 2024-05-31 DI1U24 ... 0.1036 0.1034
...
>>> futures("DAP", "31-05-2024")
TradeDate TickerSymbol ... SettlementRate ForwardRate
0 2024-05-31 DAPM24 ... 0.0555 0.0555
1 2024-05-31 DAPN24 ... 0.07524 0.086254
2 2024-05-31 DAPQ24 ... 0.0885 0.106631
3 2024-05-31 DAPU24 ... 0.0855 0.078171
...