1 | Opt(Style = c("European", "American", "Asian", "Binary", "AverageStrike", "Barrier", "Chooser", "Compound", "DeferredPayment", "ForeignEquity", "ForwardStart", "Gap", "HolderExtendible", "Ladder", "Lookback", "MOPM", "Perpetual", "Quotient", "Rainbow", "Shout", "SimpleChooser", "VarianceSwap"), Right = c("Call", "Put", "Other"), S0 = 50, ttm = 2, K = 52, Curr = "$", ContrSize = 100, SName = "A stock share", SSymbol = "")
|
Style |
|
Right |
|
S0 |
|
ttm |
|
K |
|
Curr |
|
ContrSize |
|
SName |
|
SSymbol |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (Style = c("European", "American", "Asian", "Binary",
"AverageStrike", "Barrier", "Chooser", "Compound", "DeferredPayment",
"ForeignEquity", "ForwardStart", "Gap", "HolderExtendible",
"Ladder", "Lookback", "MOPM", "Perpetual", "Quotient", "Rainbow",
"Shout", "SimpleChooser", "VarianceSwap"), Right = c("Call",
"Put", "Other"), S0 = 50, ttm = 2, K = 52, Curr = "$", ContrSize = 100,
SName = "A stock share", SSymbol = "")
{
Style = match.arg(Style)
s = list(Name = Style)
s$Vanilla = (Style == "European" || Style == "American")
s$Exotic = !s$Vanilla
s$European = (Style == "European")
s$American = (Style == "American")
s$Asian = (Style == "Asian")
s$Binary = (Style == "Binary")
s$AverageStrike = (Style == "AverageStrike")
s$Barrier = (Style == "Barrier")
s$Chooser = (Style == "Chooser")
s$Compound = (Style == "Compound")
s$DP = (Style == "DeferredPayment")
s$ForeignEquity = (Style == "ForeignEquity")
s$ForwardStart = (Style == "ForwardStart")
s$Gap = (Style == "Gap")
s$HolderExtendible = (Style == "HolderExtendible")
s$Ladder = (Style == "Ladder")
s$Lookback = (Style == "Lookback")
s$MOPM = (Style == "MOPM")
s$Perpetual = (Style == "Perpetual")
s$Quotient = (Style == "Quotient")
s$Rainbow = (Style == "Rainbow")
s$Shout = (Style == "Shout")
s$SimpleChooser = (Style == "SimpleChooser")
s$VarianceSwap = (Style == "VarianceSwap")
Right = match.arg(Right)
r = list(Name = Right)
r$Call = (Right == "Call")
r$Put = (Right == "Put")
r$Other = (Right == "Other")
r$SignCP = (r$Call * 2 - 1) * if (r$Other)
NA
else 1
o = list(S0 = S0, ttm = ttm, K = K, Style = s, Right = r,
Curr = Curr, ContrSize = ContrSize, SName = SName, SSymbol = SSymbol)
class(o) = "Opt"
return(o)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.