Rolling FX forward strategy
Setting up your environment takes three steps:
- Import the relevant internal and external libraries
- Configure the environment parameters
- Initialise the environment
import sigtech.framework as sig
import datetime as dtm
import seaborn as sns
sns.set(rc={'figure.figsize': (18, 6)})
sig.config.init();
The
RollingFXForwardStrategy
object allows for automatic rolling of FX forwards.An example of building a rolling forward strategy:
def get_fxrf(long_ccy, forward_tenor, direction):
return sig.RollingFXForwardStrategy(
currency='USD',
direction=direction,
forward_tenor=forward_tenor, # '2D', '1W', '1M', '3M_IMM'
long_currency=long_ccy, # 'EUR', 'CHF', 'GBP', 'JPY'
start_date=dtm.date(2010, 3, 5),
# can also set up custom rolling schedule via
# custom_roll_dates=[dtm.date(2010, 10, 18), dtm.date(2011, 10, 25)]
)
Input
Output
st = get_fxrf('EUR', '3M_IMM', 'long')
st
USD 2636B46A RFXFS STRATEGY <class 'sigtech.framework.strategies.rolling_fx_forward_strategy.RollingFXForwardStrategy'>[4517982800]
Input
Output
st.history().tail()
2021-04-22 839.436923
2021-04-23 845.115986
2021-04-26 844.328467
2021-04-27 844.312474
2021-04-28 NaN
Name: (LastPrice, EOD, USD 2636B46A RFXFS STRATEGY), dtype: float64
st.history().plot(title='Rolling FX Forward Performance');

Last modified 4mo ago