RollingOptionsStrategyBase#
-
class sigtech.framework.strategies.rolling_options_strategy_base.RollingOptionsStrategyBase
Baseclasses:
OptionsStrategyBase
,RollingStrategyBase
Subclasses:
RollingOptionStrategy
,RollingStraddleOptionStrategy
,RollingStrangleOptionStrategy
,RollingSpreadOptionsStrategy
,RollingButterflyOptionsStrategy
,DynamicOptionsStrategy
,DynamicMultiOptionsStrategy
,_RollingSwaptionStrategyBase
,DynamicSwaptionsStrategy
,DynamicMultiSwaptionsStrategy
,RollingVarianceSwapStrategy
Base strategy class for rolling options strategies, that can be quickly implemented by defining their own
roll_options
method.Keyword arguments (in addition to the standard
OptionsStrategyBase
arguments):target_type
: Type of quantity to target at each roll (optional, set to'Fixed'
by default). Please see below for a list of values and examples.target_quantity
: Target quantity to trade at each roll (optional). The meaning depends on thetarget_type
set. For atarget_type
set as'Vega'
,'Gamma'
or'Theta'
, this is the sum of absolute risk quantity of each underlying in the position. The default is 1, with the default type of'Fixed'
this corresponds to trading one of each option type at the rolls.net_target_quantity
: Net target type of option legs (optional).greek_neutral_nav_scale
: Percentage of nav used for scaling delta, vega, gamma or theta neutral strategies. Value must be between 0 and 1, where 0 is the default value and deactivate the scaling (optional).force_target_quantity
: Adjust ratio of option legs to achieve target quantity (optional).maturity
: Maturity or tenor of underlying options, e.g.'3M'
. Can be'ROLL+1BD'
, or'ROLL-1W'
etc. to set maturity to the next roll date plus/minus the offset. One extra roll date might be needed for the last maturity in this case.rolling_frequencies
: List of strings used to set roll dates, e.g. [‘3M’] (optional). If nothing is passed, the strategy uses only onefirst_entry_date
for trading.roll_dates
: Pre-specified list of roll dates (optional). All other schedule parameters apart fromuse_first_entry_date
are ignored if the list is non-empty.close_out_at_roll
: Flag specifying whether the strategy should automatically close out all positions on the roll dates (optional, set to True by default).target_maturity_weekday
: Target day of week for option maturity, (optional, set to'Friday'
by default). Possible values are:'Monday'
,'Tuesday'
,'Wednesday'
,'Thursday'
,'Friday'
,Weekday.MO
,Weekday.TU
,Weekday.WE
,Weekday.TH
, orWeekday.FR
.is_imm_maturity
: Flag used for targeting 3rd week of the month for option maturities (optional, set to False by default).strike_type
: Strike type of the underlying options, set to'Price'
by default (optional).strike
or equivalent is expected to be defined in the derived strategies if planned to be used. Possible values are:'Delta'
,'Price'
,'Premium'
,'DN'
,'DEFAULT'
,'SPOT'
and'FWD'
. Note that'DN'
,'FWD'
and'DEFAULT'
can only be used for FX OTC options, where'DEFAULT'
allows to fetch the delta type from the surface.t0_option_selection
: Flag used to specify if option strikes should be determined using the same market data point as order execution. Default is False as this might cause inconsistencies in production strategy.size_at_execution
: Flag used to specify if option decision, sizing, and execution should happen withing very short period of time. This serves as a proxy to a real time data, when we have access only to one data point a day.t0_option_selection
is automatically set toTrue
ifsize_at_execution
isTrue
. Default isFalse
, as the sizing, decision, and execution times are set around the group valuation time, and might happen at or after the market close, which could be a problem for a production strategy.price_listed_as_model
: Flag used only inExchangeTradedOptionsGroup
case, to specify if the options should be priced using vol surface ('VolSurface'
), or Greeks and price should be implied from the volatility implied from the listed price ('VolFromPrice'
). Optional, default isNone
(equivalent toFalse
, or not relevant, or use only what is in the database).
Values for target_type
'Gamma'
is the dollar gamma, i.e. \(S \cdot\Gamma\).'PV'
is the absolute options value.'Fixed'
is a fixed number of each option type per strategy, (e.g. 1 means exactly one option in rolling option case, or exactly 1 call and 1 put in rolling straddle/strangle).'StrikeNotional'
is the total notional, computed as strike times option notional (summed over all options).'SpotNotional'
is the total notional, computed as underlying spot times option notional.'StrikeNotionalAsProportionOfNAV'
and'SpotNotionalAsProportionOfNAV'
are'StrikeNotional'
and'SpotNotional'
with the quantity targeting a proportion (set bytarget_quantity
) of the strategy NAV. *'PVAsProportionOfNAV''
is'PV'
with the quantity targeting a proportion (set bytarget_quantity
) of the strategy NAV. Possible values are:'Vega'
,'Gamma'
,'Theta'
,'PV'
,'Fixed'
,'StrikeNotional'
,'SpotNotional'
,'PVAsProportionOfNAV'
,'StrikeNotionalAsProportionOfNAV'
, or'SpotNotionalAsProportionOfNAV'
.
Note
If
target_quantity
is 100, spot is 5 at the time of re-balance, and strike is 10, then'StrikeNotional'
target would imply 10 options in rolling option, or 5 calls and 5 puts in rolling straddle (100 / 10 total options), while'SpotNotional'
would imply 20 rolling options or 10 calls and 10 puts in rolling straddle (i.e. target divided by spot total number of options).In case of strangle, in the same example,
'SpotNotional'
would be the same as in straddle, and if the strikes are 5 and 15, and target is 100, then there will be 5 calls and 5 puts (i.e. 100 / (5 + 15) total number of pairs).-
close_out_at_roll: Optional[bool]
-
roll_dates: Optional[list[datetime.date]]
-
property rolling_table
Builds the strategy’s rolling table.
- Returns:
Built rolling table as a pandas DataFrame.
-
size_at_execution: Optional[bool]
-
AVAILABLE_REBALANCE_FREQS
Subclasses:
ScheduleFrequenciesWithIntraday
alias of
ScheduleFrequencies
-
AVAILABLE_STRIKE_VALUES
alias of
StrikeValues
-
next_roll_date(d)
Determine the next roll date.
- Parameters:
d – Reference date.
- Returns:
Date.
-
option_dependencies(input_dependency, valuation_currency, data_points) list[sigtech.framework.internal.infra.mu.graph.registry.factory.Dependency]
Dependencies to be loaded after the vol surface and option underlying dependencies are loaded
-
option_underlying_dependencies(input_dependency, valuation_currency, group)
Dependencies to be loaded after the vol surface is loaded
-
pnl_explain(fields=None, data_point=None, start_date=None, end_date=None)
A breakdown of the actual pnl and greeks pnl over time for a list of fields.
- Parameters:
fields – Input fields (optional).
data_point – Input data point (optional).
start_date – Start date - used if later than default start date (optional).
end_date – End date - used if earlier than default end date (optional).
- Returns:
pandas DataFrame.
-
roll_options(dt)
Action to take when trading.
- Parameters:
dt – Reference datetime.
-
rolling_schedule()
Determine the dates to trade on.
-
rolling_underlying_return(implied_volatility=False)
Continuous series of price return and (optional) corresponding implied volatility absolute change of the instruments underlying the rolling option/swaption strategy.
- Implied_volatility:
bool, default
False
. IfTrue
returns corresponding implied_volatility.- Returns:
pandas DataFrame.
-
strategy_initialization(dt)
Initial decision run on the start date of the strategy.
- Parameters:
dt – Reference datetime.
-
trade_group()
Option group used for specifying type of traded options.
-
validate()
Validate strategy instrument.