.cdm-java.5.0.1.source-code.event-position-func.rosetta Maven / Gradle / Ivy
namespace cdm.event.position : <"Position concepts: portfolio and portfolio aggregation.">
version "${project.version}"
import cdm.base.math.*
import cdm.product.template.*
import cdm.event.common.*
import cdm.base.staticdata.party.*
func FxMarkToMarket: <"Representation of sample mark to market calculation provided by a member firm.">
inputs:
trade Trade (1..1)
output:
value number (1..1)
alias forwardPayout: <"Alias to the forward pay out.">
trade -> tradableProduct -> product -> contractualProduct -> economicTerms -> payout -> forwardPayout only-element
alias quotedCurrency: <"The quoted currency.">
trade -> tradableProduct -> tradeLot -> priceQuantity -> price -> unit -> currency
distinct
only-element
alias baseCurrency: <"The base currency.">
trade -> tradableProduct -> tradeLot -> priceQuantity -> price -> perUnitOf -> currency
distinct
only-element
alias quantities: <"Quantity list. Only works in the case of a single trade lot.">
trade -> tradableProduct -> tradeLot only-element -> priceQuantity -> quantity
alias quotedQuantity: <"Quoted quantity amount.">
FilterQuantityByCurrency(quantities, quotedCurrency) only-element -> value
alias baseQuantity: <"Base quantity amount.">
FilterQuantityByCurrency(quantities, baseCurrency) only-element -> value
alias interpolatedRate: InterpolateForwardRate(forwardPayout)
condition ForwardPayoutExists: <"The forwardPayout on the contract must exist.">
trade -> tradableProduct -> product -> contractualProduct -> economicTerms -> payout -> forwardPayout exists
set value: (quotedQuantity / interpolatedRate - baseQuantity) * interpolatedRate
func InterpolateForwardRate:
inputs:
forward ForwardPayout (1..1)
output:
result number (1..1)
func EvaluatePortfolioState: <"Function specification to evaluate a portfolio's aggregation parameters and return a new portfolio state containing aggregated positions.">
inputs:
portfolio Portfolio (1..1) <"Portfolio containing the aggregation parameters to be used to calculate the new portfolio state.">
output:
portfolioState PortfolioState (1..1) <"Portfolio state containing the aggregated positions based on the input aggregation parameters.">
func IsValidPartyRole:
inputs:
partyRoles PartyRole (0..*)
validRoles PartyRoleEnum (1..*)
output:
isValid boolean (1..1)
set isValid:
partyRoles
extract
(validRoles contains role)
then all = True
© 2015 - 2025 Weber Informatics LLC | Privacy Policy