@@ -1648,3 +1648,169 @@ \subsubsection*{Worst Performance Rainbow Option 05}
16481648 COMM underlyings), this will result in a quanto payoff. Notice section `` Payment Currency'' in ore/Docs/ScriptedTrade. \\
16491649 Allowable values: See Table \ref {tab:currency } for allowable currency codes.
16501650\end {itemize }
1651+
1652+ \subsubsection* {Worst Performance Rainbow Option 06 }
1653+
1654+ A worst performance rainbow option 06 is represented as a {\em scripted trade},
1655+ refer to the scripted trade documentation in ore/Docs/ScriptedTrade
1656+ for an introduction.
1657+
1658+ Trade input and the payoff script are described below.
1659+
1660+ \begin {minted }[fontsize=\scriptsize ]{xml}
1661+ <Trade id="EQ_WorstPerformanceRainbowOption06">
1662+ <TradeType>ScriptedTrade</TradeType>
1663+ <Envelope>
1664+ <CounterParty>CPTY_A</CounterParty>
1665+ <NettingSetId>CPTY_A</NettingSetId>
1666+ <AdditionalFields/>
1667+ </Envelope>
1668+ <WorstPerformanceRainbowOption06Data>
1669+ <LongShort type="longShort"> Long</LongShort>
1670+ <Quantity type="number"> 200000</Quantity>
1671+ <Underlyings type="index">
1672+ <Value>EQ-RIC:.STOXX50E</Value>
1673+ <Value>EQ-RIC:.SPX</Value>
1674+ </Underlyings>
1675+ <InitialPrices type="number">
1676+ <Value>5455.60</Value>
1677+ <Value>500</Value>
1678+ </InitialPrices>
1679+ <StrikePrices type="number">
1680+ <Value>5600</Value>
1681+ <Value>550</Value>
1682+ </StrikePrices>
1683+ <BarrierLevels type="number">
1684+ <Value>5600</Value>
1685+ <Value>550</Value>
1686+ </BarrierLevels>
1687+ <KnockInPrices type="number">
1688+ <Value>5600</Value>
1689+ <Value>550</Value>
1690+ </KnockInPrices>
1691+ <BonusCoupon type="number"> 0.1430</BonusCoupon>
1692+ <ObservationSchedule type="event">
1693+ <ScheduleData>
1694+ <Rules>
1695+ <StartDate>2020-03-11</StartDate>
1696+ <EndDate>2020-09-04</EndDate>
1697+ <Tenor>1D</Tenor>
1698+ <Calendar>USD</Calendar>
1699+ <Convention>ModifiedFollowing</Convention>
1700+ <TermConvention>ModifiedFollowing</TermConvention>
1701+ <Rule>Forward</Rule>
1702+ </Rules>
1703+ </ScheduleData>
1704+ </ObservationSchedule>
1705+ <ObservationDate type="event"> 2020-09-04</ObservationDate>
1706+ <SettlementDate type="event"> 2020-09-11</SettlementDate>
1707+ <PayCcy type="currency"> EUR</PayCcy>
1708+ </WorstPerformanceRainbowOption06Data>
1709+ </Trade>
1710+ \end {minted}
1711+
1712+ The WorstPerformanceRainbowOption06 script referenced in the trade above is shown in listing
1713+ \ref {lst:worst_performance_rainbow_option_06 }.
1714+
1715+ \begin {listing }[hbt]
1716+ \begin {minted }[fontsize=\scriptsize ]{Basic}
1717+ REQUIRE SIZE(Underlyings) == SIZE(InitialPrices) AND SIZE(Underlyings) == SIZE(StrikePrices);
1718+ REQUIRE SIZE(Underlyings) == SIZE(BarrierLevels) AND SIZE(Underlyings) == SIZE(KnockInPrices);
1719+ REQUIRE ObservationDate <= SettlementDate;
1720+
1721+ NUMBER indexInitial, indexFinal, performance, d, spot;
1722+ NUMBER worstPerformance, payoff, premium, knockedIn, u, worstUnderlying, worstUnderlyingFinalPrice;
1723+ NUMBER deliverableAsset,fractionalAmount, fractionalCashAmount;
1724+
1725+ worstUnderlying = 1;
1726+
1727+ FOR u IN (1, SIZE(Underlyings), 1) DO
1728+ indexInitial = InitialPrices[u];
1729+ indexFinal = Underlyings[u](ObservationDate);
1730+ performance = indexFinal / indexInitial;
1731+
1732+ IF {u == 1} OR {performance < worstPerformance} THEN
1733+ worstPerformance = performance;
1734+ worstUnderlyingFinalPrice = indexFinal;
1735+ worstUnderlying = u;
1736+ END;
1737+ END;
1738+
1739+ FOR d IN (1, SIZE(ObservationSchedule), 1) DO
1740+ IF knockedIn == 0 THEN
1741+ FOR u IN (1, SIZE(Underlyings), 1) DO
1742+ spot = Underlyings[u](ObservationSchedule[d]);
1743+ IF spot < KnockInPrices[u] THEN
1744+ knockedIn = 1;
1745+ END;
1746+ END;
1747+ END;
1748+ END;
1749+
1750+ IF knockedIn == 1 AND worstUnderlyingFinalPrice < StrikePrices[worstUnderlying] THEN
1751+ deliverableAsset = Quantity/StrikePrices[worstUnderlying];
1752+ fractionalAmount = frac(deliverableAsset);
1753+ fractionalAmount = round(fractionalAmount,4);
1754+ fractionalCashAmount = worstUnderlyingFinalPrice*fractionalAmount;
1755+ payoff = round(fractionalCashAmount,2)+round(deliverableAsset,0);
1756+ ELSE
1757+ IF worstUnderlyingFinalPrice >= BarrierLevels[worstUnderlying] THEN
1758+ payoff = Quantity*(1+max(BonusCoupon, worstPerformance-1));
1759+ ELSE
1760+ payoff = Quantity;
1761+ END;
1762+ END;
1763+
1764+ payoff = LOGPAY(payoff, ObservationDate, SettlementDate, PayCcy, 1, Payoff);
1765+
1766+ Option = LongShort * payoff;
1767+ \end {minted }
1768+ \caption {Payoff script for a WorstPerformanceRainbowOption06.}
1769+ \label {lst:worst_performance_rainbow_option_06 }
1770+ \end {listing }
1771+
1772+ The payout formula, determined on the \lstinline !ObservationDate !, is as follows, where
1773+ $ worstPerformance$ is the performance, i.e.\ $ S_T/S_0 $ , of the worst-performing asset as
1774+ of the final determination date $ T$ . The payout for a long put option is as follows:
1775+
1776+ If a knock-in event was triggered and the Final Reference Price of the Worst Performing Underlying
1777+ is below its Strike Price,
1778+ \begin {equation* }
1779+ Payout = \text {\lstinline !Quantity !} * S * \text {FractionalAmount} + \text {round}(\text {fractionalCashAmount})
1780+ \end {equation* }
1781+ with Fractional Amount being the fractional share resulting from the calculation of the Deliverable Assets. $ K$ being the strike level of the
1782+ worst underlying performing asset, $ S$ that underlying final price.
1783+ \begin {equation* }
1784+ FractionalAmount = \text {\lstinline !Quantity !} / \text {K}
1785+ \end {equation* }
1786+
1787+ The meanings and allowable values for the \lstinline !WorstPerformanceRainbowOption06Data ! node below.
1788+
1789+ \begin {itemize }
1790+ \item {}[longShort] \lstinline !LongShort !: Own party position in the option. \\
1791+ Allowable values: \emph {Long, Short }.
1792+ \item {}[index] \lstinline !Underlyings !: The basket of underlyings. \\
1793+ Allowable values: See ore/Docs/ScriptedTrade's Index Section for allowable values.
1794+ \item {}[number] \lstinline !InitialPrices !: The agreed initial price for each basket underlying. \\
1795+ Allowable values: Any positive number.
1796+ \item {}[number] \lstinline !StrikePrices !: The strike prices used within the calculation agent. \\
1797+ Allowable values: Any number.
1798+ \item {}[number] \lstinline !KnockInPrices !: The agreed European knock-in barrier level. \\
1799+ Allowable values: Any number.
1800+ \item {}[number] \lstinline !Quantity !: A quantity multiplier applied to the payoff. \\
1801+ Allowable values: Any number.
1802+ \item {}[number] \lstinline !BarrierLevels !: The agreed barrier level. \\
1803+ Allowable values: Any number.
1804+ \item {}[number] \lstinline !BonusCoupon !: A percentage. \\
1805+ Allowable values: Any number.
1806+ \item {}[event] \lstinline !ObservationDate !: The date on which the final levels of the assets are determined. \\
1807+ Allowable values: See \lstinline !Date ! in Table \ref {tab:allow_stand_data }.
1808+ \item {}[event] \lstinline !SettlementDate !: The settlement date for the payoff. \\
1809+ Allowable values: See \lstinline !Date ! in Table \ref {tab:allow_stand_data }.
1810+ \item {}[currency] \lstinline !PayCcy !: The payment currency. For FX, where the underlying is provided
1811+ in the form \lstinline !FX-SOURCE-CCY1-CCY2 ! (see Table \ref {tab:fxindex_data }) this should
1812+ be \lstinline !CCY2 !. If \lstinline !CCY1 ! or the currency of the underlying (for EQ and
1813+ COMM underlyings), this will result in a quanto payoff. The \lstinline !StrikePrices ! and \lstinline !BarrierLevels ! should be expressed in
1814+ as amount of CCY1 in CCY2.Notice section `` Payment Currency'' in ore/Docs/ScriptedTrade. \\
1815+ Allowable values: See Table \ref {tab:currency } for allowable currency codes.
1816+ \end {itemize }
0 commit comments