Tomorrow/Next and Overnight FX Forward Rolling Strategy#

New user? The best way to learn SigTech is to follow the steps in our user guide.

Restricted data: You will only have access to the data used in this notebook if your organisation has specifically purchased it. To check your current data access, view Data. If you would like to access more data, please contact sales@sigtech.com.

Changes will not be saved: Edits made to SigTech’s example notebooks like this will only persist for the duration of your session. When you restart the research environment, this notebook will have been restored to its original state, and any changes you have made will have been lost. To make permanent changes, copy and paste the content to a new notebook in one of your workspaces.

Introduction#

The purpose of this notebook is to show how to create an tomorrow/next and overnight FX forward strategy. ## Environment This section will import relevant internal and external libraries, as well as setting up the platform environment.

[ ]:
import sigtech.framework as sig
from sigtech.framework.analytics.performance.performance_report import View
from sigtech.framework.infra.analytics.fx.fx_market import FXMarket

import datetime as dtm
import seaborn as sns
import pytz

sns.set(rc = {'figure.figsize': (18, 6)})

# we have to configure the timezone and calendar to run ON, TN, SN rolling strategies
tz = pytz.timezone('Europe/London')
env = sig.init(env_date=tz.localize(dtm.datetime(2021, 7, 27, 11, 10)))
env[sig.config.TM_CALENDAR] = 'TARGET CALENDAR,WMCO CALENDAR'

Strategy#

[ ]:
# to look for the calendars use the below method
# note: if a new calendar is needed the kernel needs to be restarted
FXMarket.instance().schedule_stub('EUR', 'USD').holidays
[ ]:
rolling_tn = sig.RollingFXForwardStrategy(
            currency='USD',
            direction='long',
            forward_tenor='TN',
            long_currency='EUR',
            start_date=dtm.date(2019,1,4),
            total_return=False,
            include_trading_costs=False,
            ticker = 'TN_strategy'
        )

rolling_on = sig.RollingFXForwardStrategy(
            currency='USD',
            direction='long',
            forward_tenor='ON',
            long_currency='EUR',
            start_date=dtm.date(2019,1,4),
            total_return=False,
            include_trading_costs=False,
            ticker='ON_strategy'
        )

rolling_tn.history().plot(label='TN',legend=True);
rolling_on.history().plot(label='ON',legend=True);

Performance Analytics#

[ ]:
VIEWS = [View.SUMMARY_SINGLE,View.MONTHLY_STATS_HEATMAP]
report = sig.PerformanceReport([rolling_tn,rolling_on],views=VIEWS).report()