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
1524dc63
Commit
1524dc63
authored
Oct 29, 2018
by
Amelin Konstantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add BondOptionTemplate.
parent
b2abb7d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
1 deletions
+77
-1
src/main/scala/Main.scala
+2
-1
src/main/scala/templates/BondOptionTemplate.scala
+75
-0
No files found.
src/main/scala/Main.scala
View file @
1524dc63
...
...
@@ -22,7 +22,8 @@ object Main {
case
"repo"
=>
if
(
debugMode
)
new
RepoTemplate
(
source
)
with
Logger
else
new
RepoTemplate
(
source
)
case
v
if
v
==
"bondBasketOption"
=>
if
(
debugMode
)
new
BondBasketOptionTemplate
(
source
)
with
Logger
else
new
BondBasketOptionTemplate
(
source
)
case
v
if
v
==
"bondOption"
=>
throw
new
Exception
(
"Undefined trade type"
)
case
v
if
v
==
"bondOption"
=>
if
(
debugMode
)
new
BondOptionTemplate
(
source
)
with
Logger
else
new
BondOptionTemplate
(
source
)
case
v
if
v
==
"equityOption"
=>
if
(
debugMode
)
new
EquityOptionTemplate
(
source
)
with
Logger
else
new
EquityOptionTemplate
(
source
)
case
v
if
v
==
"commodityOption"
=>
...
...
src/main/scala/templates/BondOptionTemplate.scala
0 → 100644
View file @
1524dc63
package
templates
import
scala.xml.Node
class
BondOptionTemplate
(
source
:
Node
)
extends
TradeTemplate
(
source
)
{
protected
[
this
]
def
templateTradeBody
:
Node
=
{
<
fpml
:
bondOption>
<fpml:productType>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
productType
"
)
}
</fpml:productType>
<fpml:productId
productIdScheme
={
get
(
source
\
"trade"
\
"bondOption"
\
"productId"
,
"productIdScheme"
)
}>{
get
(
source
\
"trade"
\
"bondOption"
\
"productId"
)
}</
fpml
:
productId>
<fpml:buyerPartyReference
href
={
get
(
source
\
"trade"
\
"bondOption"
\
"buyerPartyReference"
,
"href"
)
}/>
<
fpml
:
sellerPartyReference
href
={
get
(
source
\
"trade"
\
"bondOption"
\
"sellerPartyReference"
,
"href"
)
}/>
<
fpml
:
optionType>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
optionType
"
)
}
</fpml:optionType>
<fpml:premium>
<fpml:payerPartyReference
href
={
get
(
source
\
"trade"
\
"bondOption"
\
"premium"
\
"payerPartyReference"
,
"href"
)
}/>
<
fpml
:
receiverPartyReference
href
={
get
(
source
\
"trade"
\
"bondOption"
\
"premium"
\
"receiverPartyReference"
,
"href"
)
}/>
<
fpml
:
paymentAmount>
<fpml:currency>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
premium
"
\\
"
currency
"
)
}
</fpml:currency>
<fpml:amount>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
premium
"
\\
"
amount
"
)
}
</fpml:amount>
</fpml:paymentAmount>
{
/*
paymentDate
isn`t
present
in
source!!!*/
}
<fpml:paymentDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
americanExercise
"
\
"
expirationDate
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
bermudaExercise
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
europeanExercise
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpml:paymentDate>
</fpml:premium>
<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:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
bermudaExercise
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
</fpml:adjustableDates>
</fpml:bermudaExerciseDates>
</fpml:bermudaExercise>
<fpml:europeanExercise>
<fpml:expirationDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
europeanExercise
"
\\
"
unadjustedDate
"
)
}
</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpml:expirationDate>
</fpml:europeanExercise>
<fpml:notionalAmount>
<fpml:currency>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
notionalAmount
"
\
"
currency
"
)
}
</fpml:currency>
<fpml:amount>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
notionalAmount
"
\
"
amount
"
)
}
</fpml:amount>
</fpml:notionalAmount>
<fpml:optionEntitlement>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
optionEntitlement
"
)
}
</fpml:optionEntitlement>
<fpml:settlementType>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
settlementType
"
)
}
</fpml:settlementType>
<fpml:strike>
<fpml:price>
<fpml:strikePrice>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
strike
"
\\
"
strikePrice
"
)
}
</fpml:strikePrice>
<fpml:strikePercentage>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
strike
"
\\
"
strikePercentage
"
)
}
</fpml:strikePercentage>
<fpml:currency>
{
get
(
source
\
"
trade
"
\
"
bondOption
"
\
"
strike
"
\\
"
currency
"
)
}
</fpml:currency>
</fpml:price>
</fpml:strike>
<fpml:bond
id
={
get
(
source
\
"trade"
\
"bondOption"
\
"bond"
,
"id"
)
}>
<
fpml
:
instrumentId
instrumentIdScheme
={
get
(
source
\
"trade"
\
"bondOption"
\
"bond"
\
"instrumentId"
,
"instrumentIdScheme"
)
}>{
get
(
source
\
"trade"
\
"bondOption"
\
"bond"
\
"instrumentId"
)
}</
fpml
:
instrumentId>
</fpml:bond>
</fpml:bondOption>
}
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