Power

Price Forward Curve

class rivapy.marketdata.EnergyPriceForwardCurve(id, refdate: datetime | date, pfc: DataFrame = None, **kwargs)[source]

Bases: object

Energy Price Forward Curve object. It is recommended to initialze this object via the class methods from_existing_pfc, from_existing_shape or from_scratch.

Parameters:
  • id (_type_) – ID for the PFC object

  • refdate (Union[datetime, date]) – Reference date

  • pfc (pd.DataFrame, optional) – This object can be initialized with an existing pfc. Defaults to None.

classmethod from_existing_pfc(id, refdate: datetime | date, pfc: DataFrame) EnergyPriceForwardCurve[source]

Initialization of the EnergyPriceForwardCurve given an existing PFC.

Parameters:
  • id (_type_) – ID for the PFC object

  • refdate (Union[datetime, date]) – Reference Date

  • pfc (pd.DataFrame) – Existing Pfc

Returns:

EnergyPriceForwardCurve object

Return type:

EnergyPriceForwardCurve

classmethod from_existing_shape(id, refdate: datetime | date, pfc_shape: DataFrame, future_contracts: List[EnergyFutureSpecifications]) EnergyPriceForwardCurve[source]

Initialization of the EnergyPriceForwardCurve given an existing PFC shape. The shape is then shifted in order to match the future contracts defined in the future_contracts list.

Parameters:
  • id (_type_) – ID for the PFC object

  • refdate (Union[datetime, date]) – Reference Date

  • pfc_shape (pd.DataFrame) – Existing PFC shape

  • future_contracts (List[EnergyFutureSpecifications]) – List of future contracts (EnergyFutureSpecifications objects)

Returns:

EnergyPriceForwardCurve object

Return type:

EnergyPriceForwardCurve

classmethod from_scratch(id, refdate: datetime | date, apply_schedule: SimpleSchedule, pfc_shaper: PFCShaper, future_contracts: List[EnergyFutureSpecifications]) EnergyPriceForwardCurve[source]

Initialization of the EnergyPriceForwardCurve from scratch. First a shape is created using the pfc_shaper. Afterwards, shape is shifted in order to match the future contracts defined in the future_contracts list.

Parameters:
  • id (_type_) – ID for the PFC object

  • refdate (Union[datetime, date]) – Reference Date

  • apply_schedule (SimpleSchedule) – Schedule to apply the pfc_shaper on, in order to obtain shape values for future time points

  • pfc_shaper (PFCShaper) – PFC shaper

  • future_contracts (List[EnergyFutureSpecifications]) – List of future contracts (EnergyFutureSpecifications objects)

Returns:

EnergyPriceForwardCurve object

Return type:

EnergyPriceForwardCurve

get_pfc() DataFrame[source]

Returns the PFC

Returns:

PFC

Return type:

pd.DataFrame