hasquant-0.7.0.0: QuantLib/Index/Commodity.chs
module QuantLib.Index.Commodity
(
-- * Types
CommodityIndex
-- * Constructors
, commodityIndex
-- * Inspectors
, forwardPrice
, lastQuoteDate
, isEmpty
) where
import QuantLib.Internal
import QuantLib.Internal.Type
#include "qlTypesC2HS.h"
#include "qlEnumC2HS.h"
#include "qlEnumObjects.h"
#include "ql.h"
{#pointer *Calendar foreign -> CCalendar nocode#}
{#pointer *Currency foreign -> CCurrency nocode#}
{#pointer *CommodityType foreign -> CCommodityType nocode#}
{#pointer *UnitOfMeasure foreign -> CUnitOfMeasure nocode#}
{#pointer *QlCommodityCurve as CommodityCurve foreign -> CCommodityCurve' nocode#}
{#pointer *QlCommodityIndex as CommodityIndex foreign -> CCommodityIndex' nocode#}
-- |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
-- 'QuantLib.Index.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
-- 'QuantLib.TermStructure.Commodity.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.
{#fun qlCommodityIndex as commodityIndex
{`String' -- ^name
,withCommodityType*`CommodityType'
,withCurrency*`Currency'
,withUnitOfMeasure*`UnitOfMeasure'
,withCalendar*`Calendar'
,`Double' -- ^lotQuantity
,withMaybeCommodityCurve*`Maybe CommodityCurve' -- ^forwardCurve
,preErrorCheck-`String'errorCheck*-}->`CommodityIndex'peekCommodityIndex*#}
-- |The forecast forward price for a date, from the forward curve.
{#fun qlCommodityIndexForwardPrice as forwardPrice{withCommodityIndex*`CommodityIndex',withDay*`Day',preErrorCheck-`String'errorCheck*-}->`Double'#}
-- |The most recent date with a stored historical fixing. Throws if none has been added yet --
-- check 'isEmpty' first if that's a possibility.
{#fun qlCommodityIndexLastQuoteDate as lastQuoteDate{withCommodityIndex*`CommodityIndex',preErrorCheck-`String'errorCheck*-}->`Day'toDay#}
-- |Whether this index has any stored historical fixings.
{#fun pure qlCommodityIndexEmpty as isEmpty{withCommodityIndex*`CommodityIndex'}->`Bool'#}
-- vim: set ff=unix ts=8 sts=2 sw=2 et: