A futures contract is a standarized contract traded on a futures exchange. The futures contract obligates the holder to buy or sell a certain underlying instrument at a certain future date at a specified price. The futures date is called the delivery date or the final settlement date. The pre-set price is called the futures strike price.
The futures price of a traded financial security is its discounted expected value. In many cases, this is very easy to compute. In some cases, i.e., with stochastic dividend payments, a numerical solution can be useful.
The following ThetaML model determines the futures price of a traded underlying 'S'. The underlying 'S' and the discount numeraire 'EUR' are processes simulated externally. For example, the process 'S' can be a stock price process that follows a Geometric Brownian Motion or a Heston Volatility process. The discount numeraire 'EUR' can be a constant discount curve as implemented in Discounting, or a stochastic process that has a dynamics as defined in the CIR model .
model future import S "Underlying" import T "Futures maturity" import EUR "Discount numeraire" export P "Futures price" %at current time, set 'P' to the expected discounted future values of 'V' P = E(V!) %the ThetaML command 'Theta' pass time by 'T' years Theta T %at the futures expiry time 'T', 'V' is equal to the underlying price at 'T' %note the future cash flows are discounted to time 0 by the discount numeraire 'EUR' V = S*EUR end