Documentation ¶
Index ¶
- func Bod(t time.Time, timezone string) (time.Time, error)
- func CVI(sigma1 float64, sigma2 float64, t1 float64, t2 float64, year int) (float64, error)
- func CVIFiltering(computedCVIs scrapers.ComputedCVIs, filteredCVIs chan<- scrapers.ComputedCVI)
- func CVIToDatastore(value float64) error
- func CVIsFromDatastore(starttime time.Time, endtime time.Time) ([]dia.CviDataPoint, error)
- func Eod(t time.Time, timezone string) (time.Time, error)
- func ForwardIndexLevel(optionsMeta []dia.OptionMetaForward, r float64, t float64) (float64, error)
- func GetNearTermOptionMeta(baseCurrency string, expirationNextTerm time.Time) ([]dia.OptionMetaForward, error)
- func GetNextTermOptionMeta(baseCurrency string) ([]dia.OptionMetaForward, error)
- func GetOptionMetaIndex(baseCurrency string, maturityDate string) ([]dia.OptionMetaIndex, error)
- func MinutesBetweenTwoDays(t1 time.Time, t2 time.Time) (float64, error)
- func MinutesInYear(year int) (float64, error)
- func MinutesUntilMidnight(timezone string) (float64, error)
- func MinutesUntilSettlement(settlement scrapers.OptionSettlement, timezone string) (float64, error)
- func TimeToMaturity(option dia.OptionMetaForward) float64
- func VarianceIndex(optionsMeta []dia.OptionMetaIndex, r float64, t float64, f float64, k0 float64) (float64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CVIFiltering ¶
func CVIFiltering(computedCVIs scrapers.ComputedCVIs, filteredCVIs chan<- scrapers.ComputedCVI)
CVIFiltering is the actual filtering algorithm; computedCVIs is the channel through which we receive the calculated CVIs, filteredCVIs is the channel through which we send the filtered CVIs
func CVIToDatastore ¶
func CVIsFromDatastore ¶
func ForwardIndexLevel ¶
ForwardIndexLevel calculates the forward level; used to compute the forward level for near-term & next-term options; r - risk free rate; t - time to expiration; LaTeX equation for the forward index level is: F_j = \texttt{Strike Price}_j + \exp{(R_j T)} \cdot (\texttt{Call Price}_j - \texttt{Put Price}_j)
func GetNearTermOptionMeta ¶
func GetNearTermOptionMeta(baseCurrency string, expirationNextTerm time.Time) ([]dia.OptionMetaForward, error)
Find last option with expiration date before NextTermOption
func GetNextTermOptionMeta ¶
func GetNextTermOptionMeta(baseCurrency string) ([]dia.OptionMetaForward, error)
Get the forward option meta information for near and next term
func GetOptionMetaIndex ¶
func GetOptionMetaIndex(baseCurrency string, maturityDate string) ([]dia.OptionMetaIndex, error)
func MinutesBetweenTwoDays ¶
MinutesBetweenTwoDays - given two days: t1 and t2, this method calculates how many minutes there are between the midnight of t1 and the midnight of the day immediately before t2. So this is an exclusive time difference measured in minutes between the two dates. The order of the dates given does not matter.
func MinutesInYear ¶
MinutesInYear - returns how many minutes there were in a year
func MinutesUntilMidnight ¶
MinutesUntilMidnight - how many minutes until midnight
func MinutesUntilSettlement ¶
func MinutesUntilSettlement(settlement scrapers.OptionSettlement, timezone string) (float64, error)
MinutesUntilSettlement - how many minutes from midnight until settlement; If on the settlement day, however and after midnight, then count how many minutes until settlement (rather than count how many minutes from midnight until settlement)
func TimeToMaturity ¶
func TimeToMaturity(option dia.OptionMetaForward) float64
func VarianceIndex ¶
func VarianceIndex(optionsMeta []dia.OptionMetaIndex, r float64, t float64, f float64, k0 float64) (float64, error)
VarianceIndex is used to calculate variance for near term and next term options; later on these two values are used in interpolation to obtain a CVI value; r - risk free rate; t - time to expiration; f - forward index level; k0 - strike price just below the forward index level; LaTeX equation for the output of this function is: \sigma^2_j = \frac{1}{T_j} \left(2 \sum_i \frac{\Delta K_i}{K_i^2} \exp{(RT_j)} \cdot Q(K_i) - \left( \frac{F_j}{K_0} - 1 \right)^2 \right), \forall \ j \in \{1,2\}
Types ¶
This section is empty.