hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.Index.Commodity

Synopsis

Types

type CommodityIndex = GenIndex CCommodityIndex Source #

An Index; see the hierarchy under GenIndex.

Constructors

commodityIndex Source #

Arguments

:: String

name

-> CommodityType 
-> Currency 
-> UnitOfMeasure 
-> Calendar 
-> Double

lotQuantity

-> Maybe CommodityCurve

forwardCurve

-> IO CommodityIndex 

A named commodity index, whose fixings forecast from an optional forward CommodityCurve (or fall back to a stored historical fixing when none is given -- add one via addFixing). Upstream's constructor also takes an ExchangeContracts/nearby-offset pair for rolling onto nearby exchange contracts; this binds only the no-rolling case (a null exchangeContracts and offset 0), the same scope this module's CommodityCurve already narrowed price to. Commodity type, currency, unit, lot quantity, and forward curve are not exposed as inspectors because they only echo the constructor arguments.

Inspectors

forwardPrice :: CommodityIndex -> Day -> IO Double Source #

The forecast forward price for a date, from the forward curve.

lastQuoteDate :: CommodityIndex -> IO Day Source #

The most recent date with a stored historical fixing. Throws if none has been added yet -- check isEmpty first if that's a possibility.

isEmpty :: CommodityIndex -> Bool Source #

Whether this index has any stored historical fixings.