CashIndex#
-
class sigtech.framework.indices.cash_index.CashIndex
Baseclasses:
CalculatedIndex
A class implementing a cash asset based on interest rate fix instrument, e.g. ‘FEDL01 INDEX’.
Keyword arguments:
currency
: str.start_date
: str or datetime.interest_rate_fix
: Ticker (str) or list of [ticker (str), date effective until inclusive (datetime.date)] to create a composite index if interest rate ticker changes over time.fixing_delay
: Delay (str), e.g. ‘1BD’, or list of [start date inclusive (str), delay (str)].
Example of object creation:
import datetime as dtm rf = sig.CashIndex(currency='USD', start_date=dtm.date(2000, 1, 5), interest_rate_fix='FEDL01 INDEX', fixing_delay='1BD')
Fixing delay is an input to account for publication delay in the interest rate fixes, i.e. FEDL01 Index fix published at 8:30 a.m. America/New_York for the previous day.
Example ‘1BD’ fixing_delay: the cash index calculation performed on t+1 for value on t will use the fixing from t-2.
Cash formula used:
\[{CI}_t = {CI}_{t-1} * \left( 1.0 + r_{t-1}^{lag} * \frac{0.01}{day count} \right)\]Scheduling for cash indices is every calendar day.
- rf = CashIndex(currency=’EUR’,
start_date=’2000-01-03’, interest_rate_fix=[[‘EONIA INDEX’, ‘2021-01-02’], [‘ESTR INDEX’, None]], fixing_delay=[[‘2000-01-03’,’0BD’], [‘2005-01-03’,’1BD’]])
In the example above EONIA INDEX is replaced with ESTR INDEX after ‘2021-01-02’ as an underlying of the cash index. Fixing delay is ‘0BD’ at the start, changes to ‘1BD’ from ‘2005-01-03’.
-
fixing_delay: Union[list, str]
-
interest_rate_fix: Union[list, str]
-
property valuation_time
The valuation time/tz represents the time at which interest is earned on cash. Here we assert that you only earn interest if cash is held over midnight.
-
static available_currencies()
Return a list of available currencies to use in
CashIndex.from_currency
.
-
calculation_start_date()
Return the start date based on the interest rate fix.
-
static from_currency(ccy, long=False, env: Optional[ConfiguredEnvironment] = None)
Return a cash index object from a currency ticker.
- Parameters:
ccy – Currency ticker.
long – If True, the cash account is ‘long’ the selected currency (optional, default is False).
env – Configured environment (optional).
- Returns:
Object.
-
static name_from_currency(curncy, long=False, env: Optional[ConfiguredEnvironment] = None)
Return the instrument ticker from a currency ticker.
- Parameters:
curncy – Currency ticker.
long – If True, the cash account is ‘long’ the selected currency (optional, default is False).
env – Configured environment (optional).
- Returns:
Object.
-
schedule_information()
Return the schedule information for this instrument.