Rolling FX forward strategy#
Inheriting from the DailyStrategy
base class, RollingFXForwardStrategy
shorts the strategy currency (normally USD) and goes long long_currency
in rolling FX forwards.
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
Create a rolling FX forward strategy#
Use the sig.RollingFXForwardStrategy
class to create a rolling FX forward strategy object. Parameters include: long_currency
, currency
, forward_tenor
, start_date
, custom_roll_offset
, and end_date
.
First, define a helper function, get_fxrf
, that creates rolling FX forward strategies:
def get_fxrf(long_ccy, forward_tenor, direction):
return sig.RollingFXForwardStrategy(
start_date=dtm.date(2023, 1, 1),
end_date=dtm.date(2024, 1, 1),
currency="USD",
direction=direction,
forward_tenor=forward_tenor,
long_currency=long_ccy,
)
Use the helper function to create a rolling FX forward strategy. This example goes long EUR
and shorts USD
, with a forward tenor 3M_IMM
(every quarter following International Monetary Market dates):
st = get_fxrf("EUR", "3M_IMM", "long")
st
View price data:
st.history().tail()
Plot the price data:
st.history().plot(title='Rolling FX Forward Performance');
API documentation#
For more details on the RollingFXForwardStrategy
class, refer to its API documentation.