Commodity Futures 
The market risk analyzer calculates the net present value (NPV) of commodity futures as the difference between the scenario value and the actual value.
The market risk analyzer calculates the clean price (CP) of commodity futures.
The price calculator calculates the NPV of existing commodity futures according to the formula:
∆NPV=NPV scenario - NPV actual
where NPV actual is the NPV calculated by using current market data, and NPV scenario is the NPV from scenario data.
The calculation proceeds through five steps:
Step 1
determines the actual (
( )
) and scenario (
( )
) commodity future (F) price.
The calculation of Fdepends upon whether the flag calculate theoretical price is set and whether the calling application delivers market data for the commodity future to the price calculator:
If the flag is not set and market data for the commodity future is provided, then Fis equal to
( )
(that is the market price of the commodity future on the evaluation date).
If the flag is set or no market data for the commodity future is provided, then F is calculated from the spot price according to the formula:

Where:
S 0 is the spot price of the commodity (cash market price).
r is the risk-free interest rate of the contract currency.
u is the storage cost of the commodity per unit time, expressed as a percentage of asset value (set to zero in a first step).
y is the convenience yield of the commodity, expressed as a percentage (set to zero in a first step).
T is the time until delivery of the commodity future.
Step 2 calculates the “theoretical value” of the commodity future with actual market data ( NPV actual )
NPV actual is calculated according to the formula:

Where:
PS is Position Size (derived from the position data of class position in the future account).
TV is Tick Value.
TS is Tick Size.
Step 3 calculates the “theoretical value” of the Commodity future with scenario/actual market data.
NPV scenario is calculated according to the formula:

Step 4 calculates the difference (ΔNPV).
Δ NPV = NPV scenario - NPV actual
Step 5 converts the difference to reporting currency.
The difference between NPV scenario and NPV actual is converted to the reporting currency using the exchange rate from the market data.
The calculator calculates the clean price of commodity futures as follows:
1. Calculate the clean price (CP) of commodity futures by adapting steps 1 and 2 above such that
( )
is equal to
( )
.
2. After the calculation of the clean price in position currency, it is converted to the reporting currency.