Framework v8 Latest

Pages in this category

On this page

v8.27.0

Options

New class: RollingSpreadOptionsStrategy

Create options trading strategies based on spread direction (Bull or Bear) and option type (Call or Put).

Example:

import datetime as dtm
import sigtech.framework as sig

sig.init()

group = sig.obj.get('USDJPY OTC OPTION GROUP')

# Create a Bull Call Spread options trading strategy
spread = sig.RollingSpreadOptionsStrategy(
    start_date=dtm.date(2021, 1, 4),
    end_date=dtm.date(2023, 1, 4),
    currency=group.underlying_obj.currency,
    group_name=group.name,
    rolling_frequencies=['3M'],
    maturity='12M',
    option_type='Call',
    spread_direction='Bull',
    strike_type='SPOT',
    strike_1='ATM',
    strike_2='ATM+3%',
    target_type='Vega',
    target_quantity=10.0,
)

New class: RollingButterflyOptionsStrategy

Create butterfly spread options trading strategies based on butterfly direction ('long' or 'short') and option type (Call or Put).

Example:

import datetime as dtm
import sigtech.framework as sig

sig.init()

group = sig.obj.get('USDJPY OTC OPTION GROUP')

# Create a long butterfly spread with calls
butterfly = sig.RollingButterflyOptionsStrategy(
    start_date=dtm.date(2021, 1, 4),
    end_date=dtm.date(2023, 1, 4),
    currency=group.underlying_obj.currency,
    group_name=group.name,
    rolling_frequencies=['3M'],
    maturity='12M',
    option_type='Call',
    butterfly_direction='long',
    strike_type='SPOT',
    strike_1='ATM',
    strike_2='ATM+3%',
    strike_3='ATM+5%',
    target_type='Vega',
    target_quantity=10.0,
)

New feature: Target the net of a target quantity

Set net_target_quantity to True to target net of target quantity in options trading strategies.

You can force target quantity by adjusting the ratio of option legs.

Example:

import datetime as dtm
import sigtech.framework as sig

sig.init()

# Create strangle on SPX INDEX with call strike of 4500 and put strike 5500.
# Scale option legs to get net target delta of 1.

group = sig.obj.get('SPX INDEX OTC OPTION GROUP')
strangle = sig.Strangle(
    start_date=dtm.date(2023, 1, 4),
    end_date=dtm.date(2024, 1, 4),
    currency=group.underlying_obj.currency,
    group_name=group.name,
    rolling_frequencies=['1M'],
    maturity='3M',
    strike_type='Price',
    put_strike=4500,
    call_strike=5500,
    target_type='Delta',
    target_quantity=1.0,
    net_target_quantity=True,
    total_return=False
)
strangle.history().plot()

This change applies to strategies created with the following classes:

  • DynamicMultiOptionsStrategy

  • DynamicMultiSwaptionsStrategy

  • DynamicOptionsStrategy

  • DynamicSwaptionsStrategy

  • RollingButterflyOptionsStrategy

  • RollingOptionStrategy

  • RollingSpreadOptionsStrategy

  • RollingStraddleOptionStrategy

  • RollingStrangleOptionStrategy

  • RollingVarianceSwapStrategy

  • Any custom class inheriting from RollingOptionsStrategyBase

Swaps

Improved transaction cost handling for IR and OIS OTC swaps

Transaction costs for IR and OIS OTC swaps can now be handled separately from the valuation price of the swap. This is in line with market conventions for modeling transaction costs.

To use this functionality, set INCLUDE_OTC_T_COSTS_IN_CASH to True.

Example:

import datetime as dtm
import sigtech.framework as sig

sig.env()[sig.config.IGNORE_T_COSTS] = False
sig.env()[sig.config.INCLUDE_OTC_T_COSTS_IN_CASH] = True

rolling_swap= sig.RollingSwapStrategy(
        tenor="10Y",
        currency='USD',
        swap_currency='USD',
        rolling_frequency_months=6,
        forward_start_months=6,
        start_date=dtm.date(2023, 12, 5),
        initial_cash=0,
        notional_target = 2000000,
    )
rolling_swap.build()

rolling_swap.plot.portfolio_table(dts='ACTION_PTS')

New method for OISSwap class: swap_details

Get information about a swap for a specified reference date.

Example:

import sigtech.framework as sig
import datetime as dtm

sig.init()

ois_swap = sig.OISSwap(
    currency="USD",
    tenor="5Y",
    start_date=dtm.date(2020, 11, 9),
    trade_date=dtm.date(2020, 11, 9),
)

ois_swap.swap_details(d=dtm.date(2020, 11, 9), notional=10_000_000.0)

New method for discounting and projection curves: yield_curve

This change adds the yield_curve method to display forward and zero rates for a given discounting or projection curve.

Example:

import datetime as dtm
import sigtech.framework as sig

from sigtech.framework.instruments.ir_otc import IRSwapMarket

sig.init()

# Get a discounting curve
discounting_curve = sig.obj.get(IRSwapMarket.discounting_curve_name('USD'))

# Get the yield curve for the discounting curve
yield_curve = discounting_curve.yield_curve(d=dtm.date(2024, 3, 13))

Pass a list of holiday calendars when creating a dynamic strategy

Add non-trading days to a dynamic strategy by passing the extra_holidays parameter on creation.

The extra_holidays parameter can be a string or a list of strings. It must contain the object names of the holiday calendars you want the strategy to use.

Example:

fx_option_group = sig.obj.get('EURUSD OTC OPTION GROUP')

trade_dictionary = {dtm.date(2010, 4, 7): {
        fx_option_group.get_option('Call', 1.3, dtm.date(2010, 4, 6), dtm.date(2011, 4, 6)) : 1,
        fx_option_group.get_option('Put', 1.3, dtm.date(2010, 4, 6), dtm.date(2011, 4, 6)) : -1
    }
}

strat = sig.DynamicStrategy(
    currency=fx_option_group.over,
    start_date=dtm.date(2010, 1, 6),
    end_date=dtm.date(2012, 1, 20),
    trade_dictionary=trade_dictionary,
    #extra_holidays=['CMX(T) CALENDAR','SINGEX_JP(T) CALENDAR'],
    extra_holidays='CMX(T) CALENDAR,SINGEX_JP(T) CALENDAR',
)

strat.history()

Last updated

© 2023 SIG Technologies Limited