netrium-0.6.0: examples/DarkSpreadOption.contract
import Options
import Calendar
-- Daily exercise at 15:00 on the day preceding the supply day
-- (this is supposed to be on every fourth EEX business day but for now it does every fourth calendar day - to be updated when we have a proper calendar)
contract = commoditySpreadOption "choice" legs
(calendarDaysEarlier calendar 4 <> atTimeOfDay 15 00)
(calendarDaysLater calendar 5)
CallOption
strikePrice gbp (CashFlowType "initialMargin")
premium gbp
where strikePrice = 7 * powerVol
premium = 3
calendar = getBusinessDayCalendar "EEX Power"
legs = [coalLeg, carbonLeg, electricityLeg]
months = [1..1] -- Should be [1..12], but cut down to reduce runtime
-- API2 coal: monthly delivery (assumption is 1st of the month)
coalLeg =
( Market (Commodity "Coal") (Unit "MWh") (Location "ARA"), coalVol
, coalPrice, (Currency "USD"), (CashFlowType "initialMargin")
, [ [datetime 2011 m 1 0 0 ] | m <- months ]
, exchangeFee 50
)
-- Carbon: yearly certificates split into monthly deliveries at 12:00
carbonLeg =
( Market (Commodity "Carbon") (Unit "t") (Location "EU"), carbonVol
, carbonPrice, (Currency "GBP"), (CashFlowType "initialMargin")
, [ [datetime 2011 m 1 12 0 ] | m <- months ]
, exchangeFee 75)
-- CE Power: delivery every 15 minutes
electricityLeg =
( Market (Commodity "Electricity") (Unit "MWh") (Location "Amprion HVG"), powerVol
, powerPrice, (Currency "EUR"), (CashFlowType "initialMargin")
, [ [datetime 2011 m d h i | d <- [1..31], h <- [0..23], i <- [0,15,30,45] ] | m <- months ]
, exchangeFee 100 )