| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.Instrument.Forward
Contents
Synopsis
- type GenForward f = GenInstrument (AnyOf CForward' f)
- type Forward = GenForward CForward
- type ForwardRateAgreement = GenInstrument CForwardRateAgreement
- type BondForward = GenForward CBondForward
- type FxForward = GenInstrument CFxForward
- asForward :: GenForward f -> IO Forward
- forwardRateAgreement :: GenIborIndex ibor -> Day -> Day -> PositionType -> Double -> Double -> Maybe (GenYieldTermStructure y) -> IO ForwardRateAgreement
- bondForward :: Day -> Day -> PositionType -> Double -> Word -> DayCounter -> Calendar -> BusinessDayConvention -> GenBond b -> Maybe (GenYieldTermStructure y1) -> Maybe (GenYieldTermStructure y2) -> IO BondForward
- fxForward :: Double -> Currency -> Double -> Currency -> Day -> Bool -> Word -> Calendar -> IO FxForward
- fxForwardFromRate :: Double -> Currency -> Currency -> Double -> Day -> Bool -> Word -> Calendar -> IO FxForward
- cleanForwardPrice :: BondForward -> IO Double
- forwardPrice :: BondForward -> IO Double
- forwardValue :: GenForward f -> IO Double
- impliedYield :: GenForward f -> Double -> Double -> Day -> Compounding -> DayCounter -> IO InterestRate
- settlementDate :: GenForward f -> IO Day
- spotIncome :: GenForward f -> GenYieldTermStructure y -> IO Double
- spotValue :: GenForward f -> IO Double
- amount :: ForwardRateAgreement -> IO Double
- forwardRate :: ForwardRateAgreement -> IO InterestRate
- fxForwardRate :: FxForward -> Double
- fairForwardRate :: FxForward -> IO Double
- npvSourceCurrency :: FxForward -> IO Double
- npvTargetCurrency :: FxForward -> IO Double
Types
type GenForward f = GenInstrument (AnyOf CForward' f) Source #
type Forward = GenForward CForward Source #
An Instrument; see the hierarchy under GenInstrument.
type ForwardRateAgreement = GenInstrument CForwardRateAgreement Source #
An Instrument; see the hierarchy under GenInstrument.
type BondForward = GenForward CBondForward Source #
A Forward; see the hierarchy under GenInstrument.
type FxForward = GenInstrument CFxForward Source #
An Instrument; see the hierarchy under GenInstrument.
Constructors
Arguments
| :: GenIborIndex ibor | |
| -> Day | valueDate |
| -> Day | maturityDate |
| -> PositionType | |
| -> Double | strikeForwardRate |
| -> Double | notionalAmount |
| -> Maybe (GenYieldTermStructure y) | discountCurve |
| -> IO ForwardRateAgreement |
FRA with a par-rate approximation: the forward rate is forecast from valueDate to maturityDate by the index's forecast curve (useIndexedCoupon=false).
Arguments
| :: Day | valueDate |
| -> Day | maturityDate |
| -> PositionType | |
| -> Double | strike |
| -> Word | settlementDays |
| -> DayCounter | |
| -> Calendar | |
| -> BusinessDayConvention | |
| -> GenBond b | |
| -> Maybe (GenYieldTermStructure y1) | discountCurve |
| -> Maybe (GenYieldTermStructure y2) | incomeDiscountCurve |
| -> IO BondForward |
If strike is given in the constructor, can calculate the NPV of the contract via NPV().If strike/forward price is desired, it can be obtained via forwardPrice(). In this case, the strike variable in the constructor is irrelevant and will be ignored.
Arguments
| :: Double | sourceNominal |
| -> Currency | sourceCurrency |
| -> Double | targetNominal |
| -> Currency | targetCurrency |
| -> Day | maturityDate |
| -> Bool | paySourceCurrency |
| -> Word | settlementDays |
| -> Calendar | paymentCalendar |
| -> IO FxForward |
FX forward using nominal amounts in both currencies.
Arguments
| :: Double | sourceNominal |
| -> Currency | sourceCurrency |
| -> Currency | targetCurrency |
| -> Double | forwardRate |
| -> Day | maturityDate |
| -> Bool | paySourceCurrency |
| -> Word | settlementDays |
| -> Calendar | paymentCalendar |
| -> IO FxForward |
FX forward using a source nominal amount and a contracted forward rate (target/source).
Inspectors
cleanForwardPrice :: BondForward -> IO Double Source #
(dirty) forward bond price minus accrued on bond at delivery
forwardPrice :: BondForward -> IO Double Source #
(dirty) forward bond price
forwardValue :: GenForward f -> IO Double Source #
forward valueprice of underlying, discounting incomedividends if this is a bond forward price, is must be a dirty forward price.
Arguments
| :: GenForward f | |
| -> Double | underlyingSpotValue |
| -> Double | forwarValue |
| -> Day | settlementDate |
| -> Compounding | |
| -> DayCounter | |
| -> IO InterestRate |
Simple yield calculation based on underlying spot and forward values, taking into account underlying income. When $ t>0 $, call with: underlyingSpotValue=spotValue(t), forwardValue=strikePrice, to get current yield. For a repo, if $ t=0 $, impliedYield should reproduce the spot repo rate. For FRA's, this should reproduce the relevant zero rate at the FRA's maturityDate_;
settlementDate :: GenForward f -> IO Day Source #
Date on which the forward contract settles.
spotIncome :: GenForward f -> GenYieldTermStructure y -> IO Double Source #
NPV of incomedividendsstorage-costs etc. of underlying instrument.
spotValue :: GenForward f -> IO Double Source #
returns spot value/price of an underlying financial instrument
amount :: ForwardRateAgreement -> IO Double Source #
The payoff on the value date: the discounted difference between the FRA's forward rate and its strike (contract) rate, scaled by the notional and accrual, negated for a short position.
forwardRate :: ForwardRateAgreement -> IO InterestRate Source #
Returns the relevant forward rate associated with the FRA term.
fxForwardRate :: FxForward -> Double Source #
The contracted forward exchange rate (target/source), computed as targetNominal /
sourceNominal -- distinct from fairForwardRate, the market-implied rate.