Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SPB_Exchange_Repo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Amelin Konstantin
SPB_Exchange_Repo
Commits
4ab58a85
Commit
4ab58a85
authored
Oct 30, 2018
by
Amelin Konstantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CommodityForwardTemplate
parent
58109300
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
67 deletions
+70
-67
input/Forward Commodity Client 1.xml
+1
-1
input/Forward Commodity Client 2.xml
+1
-1
input/Repo Client equity 1.xml
+1
-1
src/main/scala/templates/CommodityForwardTemplate.scala
+67
-64
No files found.
input/Forward Commodity Client 1.xml
View file @
4ab58a85
...
@@ -103,7 +103,7 @@
...
@@ -103,7 +103,7 @@
<nsdext:clientDetails>
<nsdext:clientDetails>
<nsdext:servicingParty
href=
"Party1"
/>
<nsdext:servicingParty
href=
"Party1"
/>
<nsdext:type>
P
</nsdext:type>
<nsdext:type>
P
</nsdext:type>
<nsdext:id>
PASS_23
08875145
</nsdext:id>
<nsdext:id>
PASS_23
_
08875145
</nsdext:id>
<nsdext:name>
</nsdext:name>
<nsdext:name>
</nsdext:name>
<nsdext:country
countryScheme=
"http://www.fpml.org/ext/iso3166"
>
RU
</nsdext:country>
<nsdext:country
countryScheme=
"http://www.fpml.org/ext/iso3166"
>
RU
</nsdext:country>
</nsdext:clientDetails>
</nsdext:clientDetails>
...
...
input/Forward Commodity Client 2.xml
View file @
4ab58a85
...
@@ -103,7 +103,7 @@
...
@@ -103,7 +103,7 @@
<nsdext:clientDetails>
<nsdext:clientDetails>
<nsdext:servicingParty
href=
"Party1"
/>
<nsdext:servicingParty
href=
"Party1"
/>
<nsdext:type>
P
</nsdext:type>
<nsdext:type>
P
</nsdext:type>
<nsdext:id>
PASS_23
01675418
</nsdext:id>
<nsdext:id>
PASS_23
_
01675418
</nsdext:id>
<nsdext:name>
</nsdext:name>
<nsdext:name>
</nsdext:name>
<nsdext:country
countryScheme=
"http://www.fpml.org/ext/iso3166"
>
RU
</nsdext:country>
<nsdext:country
countryScheme=
"http://www.fpml.org/ext/iso3166"
>
RU
</nsdext:country>
</nsdext:clientDetails>
</nsdext:clientDetails>
...
...
input/Repo Client equity 1.xml
View file @
4ab58a85
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
<nsdext:clientDetails>
<nsdext:clientDetails>
<nsdext:servicingParty
href=
"Party1"
/>
<nsdext:servicingParty
href=
"Party1"
/>
<nsdext:type>
P
</nsdext:type>
<nsdext:type>
P
</nsdext:type>
<nsdext:id>
PASS_57
87598732
</nsdext:id>
<nsdext:id>
PASS_57
_
87598732
</nsdext:id>
<nsdext:name>
</nsdext:name>
<nsdext:name>
</nsdext:name>
<nsdext:country
countryScheme=
"http://www.fpml.org/ext/iso3166"
>
RU
</nsdext:country>
<nsdext:country
countryScheme=
"http://www.fpml.org/ext/iso3166"
>
RU
</nsdext:country>
</nsdext:clientDetails>
</nsdext:clientDetails>
...
...
src/main/scala/templates/CommodityForwardTemplate.scala
View file @
4ab58a85
...
@@ -4,72 +4,75 @@ import scala.xml.Node
...
@@ -4,72 +4,75 @@ import scala.xml.Node
class
CommodityForwardTemplate
(
source
:
Node
)
extends
TradeTemplate
(
source
)
{
class
CommodityForwardTemplate
(
source
:
Node
)
extends
TradeTemplate
(
source
)
{
protected
[
this
]
def
templateTradeBody
:
Node
=
{
protected
[
this
]
def
templateTradeBody
:
Node
=
{
<
fpml
:
bondOption>
<
fpml
:
commodityForward>
<fpml:productType>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
productType
"
)
}
</fpml:productType>
<fpml:productType>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
productType
"
)
}
</fpml:productType>
<fpml:productId
productIdScheme
={
get
(
source
\
"trade"
\
"bondOption"
\
"productId"
,
"productIdScheme"
)
}>{
get
(
source
\
"trade"
\
"bondOption"
\
"productId"
)
}</
fpml
:
productId>
<fpml:productId>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
productId
"
)
}
</fpml:productId>
<fpml:buyerPartyReference
href
={
get
(
source
\
"trade"
\
"bondOption"
\
"buyerPartyReference"
,
"href"
)
}/>
{
/*
valueDate
isn`t
present
in
source!!!*/
}
<
fpml
:
sellerPartyReference
href
={
get
(
source
\
"trade"
\
"bondOption"
\
"sellerPartyReference"
,
"href"
)
}/>
<fpml:valueDate>
<
fpml
:
optionType>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
optionType
"
)
}
</fpml:optionType>
<fpml:adjustableDate>
<fpml:premium>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
fixedLeg
"
\
"
paymentDates
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
<fpml:payerPartyReference
href
={
get
(
source
\
"trade"
\
"bondOption"
\
"premium"
\
"payerPartyReference"
,
"href"
)
}/>
</fpml:adjustableDate>
<
fpml
:
receiverPartyReference
href
={
get
(
source
\
"trade"
\
"bondOption"
\
"premium"
\
"receiverPartyReference"
,
"href"
)
}/>
</fpml:valueDate>
<
fpml
:
paymentAmount>
<fpml:fixedLeg>
<fpml:currency>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
premium
"
\\
"
currency
"
)
}
</fpml:currency>
<fpml:buyerPartyReference
href
={
get
(
source
\
"trade"
\
"commodityForward"
\
"fixedLeg"
\
"buyerPartyReference"
,
"href"
)
}/>
<fpml:amount>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
premium
"
\\
"
amount
"
)
}
</fpml:amount>
<
fpml
:
sellerPartyReference
href
={
get
(
source
\
"trade"
\
"commodityForward"
\
"fixedLeg"
\
"sellerPartyReference"
,
"href"
)
}/>
</fpml:paymentAmount>
<
fpml
:
fixedPrice>
{
/*
paymentDate
isn`t
present
in
source!!!*/
}
<fpml:price>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
fixedLeg
"
\
"
fixedPrice
"
\
"
price
"
)
}
</fpml:price>
<fpml:paymentDate>
<fpml:priceCurrency>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
fixedLeg
"
\
"
fixedPrice
"
\
"
priceCurrency
"
)
}
</fpml:priceCurrency>
<fpml:adjustableDate>
<fpml:priceUnit>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
fixedLeg
"
\
"
fixedPrice
"
\
"
priceUnit
"
)
}
</fpml:priceUnit>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
americanExercise
"
\
"
expirationDate
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
</fpml:fixedPrice>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
bermudaExercise
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
<fpml:totalPrice>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
europeanExercise
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
<fpml:currency>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
fixedLeg
"
\
"
totalPrice
"
\
"
currency
"
)
}
</fpml:currency>
</fpml:adjustableDate>
<fpml:amount>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
fixedLeg
"
\
"
totalPrice
"
\
"
amount
"
)
}
</fpml:amount>
</fpml:paymentDate>
</fpml:totalPrice>
</fpml:premium>
<fpml:paymentDates>
<fpml:americanExercise>
<fpml:commencementDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
americanExercise
"
\
"
commencementDate
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpml:commencementDate>
<fpml:expirationDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
americanExercise
"
\
"
expirationDate
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpml:expirationDate>
</fpml:americanExercise>
<fpml:bermudaExercise>
<fpml:bermudaExerciseDates>
<fpml:adjustableDates>
<fpml:adjustableDates>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
bermudaExercise
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
fixedLeg
"
\
"
paymentDates
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
</fpml:adjustableDates>
</fpml:adjustableDates>
</fpml:bermudaExerciseDates>
</fpml:paymentDates>
</fpml:bermudaExercise>
</fpml:fixedLeg>
<fpml:europeanExercise>
<rtsrep:commodityPhysicalLeg>
<fpml:expirationDate>
<fpml:payerPartyReference
href
={
get
(
source
\
"trade"
\
"commodityForward"
\
"commodityForwardPhysicalLeg"
\
"payerPartyReference"
,
"href"
)
}/>
<fpml:adjustableDate>
<
fpml
:
receiverPartyReference
href
={
get
(
source
\
"trade"
\
"commodityForward"
\
"commodityForwardPhysicalLeg"
\
"receiverPartyReference"
,
"href"
)
}/>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
europeanExercise
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
<
rtsrep
:
commodity
id
={
get
(
source
\
"trade"
\
"commodityForward"
\
"commodityForwardPhysicalLeg"
\
"commodity"
,
"id"
)
}>
</fpml:adjustableDate>
<
fpml
:
instrumentId
instrumentIdScheme
={
get
(
source
\
"trade"
\
"commodityForward"
\
"commodityForwardPhysicalLeg"
\
"commodity"
\
"instrumentId"
,
"instrumentIdScheme"
)
}>{
get
(
source
\
"trade"
\
"commodityForward"
\
"commodityForwardPhysicalLeg"
\
"commodity"
\
"instrumentId"
)
}</
fpml
:
instrumentId>
</fpml:expirationDate>
<fpml:unit>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
commodityForwardPhysicalLeg
"
\
"
commodity
"
\
"
unit
"
)
}
</fpml:unit>
</fpml:europeanExercise>
<fpml:currency>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
commodityForwardPhysicalLeg
"
\
"
commodity
"
\
"
currency
"
)
}
</fpml:currency>
<fpml:notionalAmount>
<fpml:deliveryDate>
<fpml:currency>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
notionalAmount
"
\
"
currency
"
)
}
</fpml:currency>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
commodityForwardPhysicalLeg
"
\
"
deliveryPeriods
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
<fpml:amount>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
notionalAmount
"
\
"
amount
"
)
}
</fpml:amount>
</fpml:deliveryDate>
</fpml:notionalAmount>
</rtsrep:commodity>
<fpml:optionEntitlement>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
optionEntitlement
"
)
}
</fpml:optionEntitlement>
<rtsrep:deliveryQuantity>
<fpml:numberOfOptions>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
numberOfOptions
"
)
}
</fpml:numberOfOptions>
<fpml:totalPhysicalQuantity>
<fpml:settlementType>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
settlementType
"
)
}
</fpml:settlementType>
<fpml:quantityUnit>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
commodityForwardPhysicalLeg
"
\
"
deliveryQuantity
"
\\
"
quantityUnit
"
)
}
</fpml:quantityUnit>
<fpml:strike>
<fpml:quantity>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
commodityForwardPhysicalLeg
"
\
"
deliveryQuantity
"
\\
"
quantity
"
)
}
</fpml:quantity>
<fpml:price>
</fpml:totalPhysicalQuantity>
<fpml:strikePrice>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
strike
"
\\
"
strikePrice
"
)
}
</fpml:strikePrice>
</rtsrep:deliveryQuantity>
<fpml:strikePercentage>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
strike
"
\\
"
strikePercentage
"
)
}
</fpml:strikePercentage>
</rtsrep:commodityPhysicalLeg>
<fpml:currency>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
strike
"
\\
"
currency
"
)
}
</fpml:currency>
<rtsrep:floatingForwardLeg>
</fpml:price>
<fpml:payerPartyReference
href
={
get
(
source
\
"trade"
\
"commodityForward"
\
"floatingForwardLeg"
\
"payerPartyReference"
,
"href"
)
}/>
</fpml:strike>
<
fpml
:
receiverPartyReference
href
={
get
(
source
\
"trade"
\
"commodityForward"
\
"floatingForwardLeg"
\
"receiverPartyReference"
,
"href"
)
}/>
<fpml:bond
id
={
get
(
source
\
"trade"
\
"bondOption"
\
"bond"
,
"id"
)
}>
<
rtsrep
:
commodity
id
={
get
(
source
\
"trade"
\
"commodityForward"
\
"floatingForwardLeg"
\
"commodity"
,
"id"
)
}>
<
fpml
:
instrumentId
instrumentIdScheme
={
get
(
source
\
"trade"
\
"bondOption"
\
"bond"
\
"instrumentId"
,
"instrumentIdScheme"
)
}>{
get
(
source
\
"trade"
\
"bondOption"
\
"bond"
\
"instrumentId"
)
}</
fpml
:
instrumentId>
<
fpml
:
instrumentId
instrumentIdScheme
={
get
(
source
\
"trade"
\
"commodityForward"
\
"floatingForwardLeg"
\
"commodity"
\
"instrumentId"
,
"instrumentIdScheme"
)
}>{
get
(
source
\
"trade"
\
"commodityForward"
\
"floatingForwardLeg"
\
"commodity"
\
"instrumentId"
)
}</
fpml
:
instrumentId>
</fpml:bond>
<fpml:unit>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
floatingForwardLeg
"
\
"
commodity
"
\
"
unit
"
)
}
</fpml:unit>
</fpml:bondOption>
<fpml:currency>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
floatingForwardLeg
"
\
"
commodity
"
\
"
currency
"
)
}
</fpml:currency>
</rtsrep:commodity>
<fpml:totalNotionalQuantity>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
floatingForwardLeg
"
\
"
totalNotionalQuantity
"
)
}
</fpml:totalNotionalQuantity>
{
/*
calculation/pricingDates
isn`t
present
in
source!!!*/
}
<rtsrep:calculation>
<fpml:pricingDates>
<fpml:pricingDates>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
floatingForwardLeg
"
\
"
paymentDates
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
</fpml:pricingDates>
</fpml:pricingDates>
</rtsrep:calculation>
<fpml:paymentDates>
<fpml:adjustableDates>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
commodityForward
"
\
"
floatingForwardLeg
"
\
"
paymentDates
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
</fpml:adjustableDates>
</fpml:paymentDates>
</rtsrep:floatingForwardLeg>
</fpml:commodityForward>
}
}
def
isStraight
=
true
def
isStraight
=
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment