Documentation
¶
Index ¶
- Constants
- func ExpandSpan(span ValueSpan, direction bool) []float64
- func NormalizedCDF(x float64) float64
- func Round(value float64, places int32) float64
- type Asset
- type CalcInstrumentRequest
- type CalcInstrumentResult
- type Chain
- type ChainCalculator
- func (occ *ChainCalculator) BlackScholesCall(ctx *context.Context, assetPrice, strikePrice, daysToExpiry float64, ...) error
- func (occ *ChainCalculator) BlackScholesPut(ctx *context.Context, assetPrice, strikePrice, daysToExpiry float64, ...) error
- func (occ *ChainCalculator) ComputeChain(ctx *context.Context, ...) (Chain, error)
- func (occ *ChainCalculator) GetCalcInstrumentResult() CalcInstrumentResult
- type ChainOptions
- type Option
- type OptionPosition
- type ValueSpan
Constants ¶
View Source
const ( Call = iota Put )
Variables ¶
This section is empty.
Functions ¶
func ExpandSpan ¶
Expand a ValueSpan in a given direction direction = true -> expand from Low to High direction = false -> expand from High to Low
func NormalizedCDF ¶
Standard normal cumulative distribution function
Types ¶
type CalcInstrumentRequest ¶
type CalcInstrumentResult ¶
type Chain ¶
type Chain [][][]OptionPosition
type ChainCalculator ¶
type ChainCalculator struct { sync.RWMutex OptionType int Volatility float64 RiskFreeRate float64 ExpiryInDays float64 // contains filtered or unexported fields }
func NewChainCalculator ¶
func NewChainCalculator(ctx *context.Context, optionType int, volatility, riskFreeRate, expiryInDays float64, calcOptions *ChainOptions) (*ChainCalculator, error)
func (*ChainCalculator) BlackScholesCall ¶
func (occ *ChainCalculator) BlackScholesCall(ctx *context.Context, assetPrice, strikePrice, daysToExpiry float64, position *OptionPosition) error
func (*ChainCalculator) BlackScholesPut ¶
func (occ *ChainCalculator) BlackScholesPut(ctx *context.Context, assetPrice, strikePrice, daysToExpiry float64, position *OptionPosition) error
Black-Scholes formula for put option price
func (*ChainCalculator) ComputeChain ¶
func (*ChainCalculator) GetCalcInstrumentResult ¶
func (occ *ChainCalculator) GetCalcInstrumentResult() CalcInstrumentResult
type ChainOptions ¶
type ChainOptions struct {
InstrumentRequest CalcInstrumentRequest
}
For context values
type OptionPosition ¶
Click to show internal directories.
Click to hide internal directories.