Currency forwards#
A currency forward or foreign exchange (FX) forward is a contract that binds the parties to a fixed exchange rate for a currency pair on a fixed future date.
Initialize SigTech
Import Python libraries:
import datetime as dtm
import numpy as np
import pandas as pd
import sigtech.framework as sig
Initialize the SigTech framework environment:
env = sig.init()
Learn more
FX forward instruments#
Retrieve an FX forward instrument. The following code block retrieves an FX forward instrument for the "EUR/USD"
currency pair where:
The
start_date
parameter is the trade date of the FX forward contract.The
payment_date
parameter is the maturity date of the FX forward contract.
START_DATE = dtm.date(2023, 1, 1)
PAYMENT_DATE = dtm.date(2024, 1, 1)
fx_forward = sig.FXForward(
start_date=START_DATE,
payment_date=PAYMENT_DATE,
under="EUR",
over="USD",
)
fx_forward
Retrieve the FX forward strike:
fx_forward.strike
Retrieve historical performance data for the FX forward instrument:
fx_forward.history().tail()
FX forward instrument prices#
The price of an FX forward instrument depends on exchange rates, interest rates, and the length of the FX forward contract. FX forward instrument prices are set by daily FX forward curves.
Retrieve an FX forward curve object:
fx_market = sig.FXMarket.instance()
curve = sig.obj.get(fx_market.fx_curve_name("EUR"))
curve
Each day has a curve, using discount factors (depo rates):
curve_history = curve.history()
curve_history.tail()
Plot the discount factors:
curve_date = curve.history().index[0].date()
pillar_dates = [d.to_date() for d in curve.get_handle(curve_date).dates()]
spot_date = fx_market.fx_spot_date("USD", "EUR", curve_date)
curve_df = pd.Series([curve.discount_factor(curve_date, d, spot_date)
for d in pillar_dates], index=pillar_dates)
curve_df.plot(title="EUR FX Curve Discount Factors");
Creating strategies#
There are several building blocks for creating forward contract strategies:
RollingFXForwardStrategy
FXForwardHedgingStrategy
DynamicRollingFXForwardStrategy
Learn more