-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
63 lines (42 loc) · 2.49 KB
/
ui.R
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
53
54
55
56
57
58
59
60
61
62
63
shinyUI(navbarPage("Option Pricing",
# part 1: Option Calculator
tabPanel("Option Calculator",
sidebarLayout(
sidebarPanel(
# input option characteristics
selectInput("type", label = h3("Select type of the option"),
choices = list("Call option" = "call", "Put option" = "put")
),
sliderInput("stock","Select stock price", 50, 150, value = 100),
sliderInput("strike","Select strike price", 50, 150, value = 100),
sliderInput("maturity","Select maturity", 0.2, 2, value = 0.7),
sliderInput("rate","Select risk free rate", 0.01, 0.05, value = 0.02),
sliderInput("vola","Select volatility", 0.1, 2, value = 0.2),
radioButtons("greekType", "Select one of Greeks to plot",
c("Delta", "Gamma","Vega", "Rho")),
sliderInput("percent","rescale x-axis", 1, 100, value = 50)
),
mainPanel(
h1("Properties of your option"),
verbatimTextOutput("BSprice"), # output option price and Greeks
plotOutput("plotGreek") # output plot of one of the Greeks
)
)
),
# part 2: VSTOXX Data
tabPanel("VSTOXX Data",
selectInput("optionType", label = h3("Select type of the option"),
choices = list("Call option" = "call", "Put option" = "put")
),
radioButtons("selectPlot", "Select type of the plot",
c("Strike", "maturity")
),
plotOutput("descriptivePlot"), # plot price of option averaged accross
# all dates
# input of the date to select option data with regard to this date
dateInput('date', label = h3("Date input"), value ='2014-03-27',
min = '2014-01-02', max = '2014-03-31', format = "yyyy-mm-dd"),
plotOutput("plotImplVola"), # plot volatility smiles
plotOutput("plotObsPrices") # plot option prices observed from market
)
))