-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
105 lines (103 loc) · 2.94 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
library(shiny)
library(tidyverse)
rebalance_ui <-
navbarPage(
"Schwab Portfolio Rebalancer",
tabPanel(
"1. Instructions",
fluidRow(
column(
br(),
p("This application visualizes planned changes in a Charles Schwab portfolio and assists in the arithmetic needed to manually rebalance assets.", style = "text-align:justify;color:black;background-color:#bbdbeb;padding:15px;border-radius:10px"),
# br(),
p("To export the data necessary to use this tool, navigate to the ",
a("Accounts > Positions", href = "https://client.schwab.com/Areas/Accounts/Positions"),
" screen on the Charles Schwab client site and select the Export option located in the upper-right hand corner of the page. The image to the right is a screenshot of what should subsequently display. The downloaded file can then be uploaded to the application using the Import tab.",
style = "text-align:justify;color:black;background-color:#bbdbeb;padding:15px;border-radius:10px"
),
width = 5
),
column(
imageOutput("image", width = "10%"),
width = 5
)
)
),
tabPanel(
"2. Import",
sidebarLayout(
sidebarPanel(
fileInput("file1", "Choose CSV File",
multiple = FALSE,
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv"
)
),
tags$hr(),
numericInput(
"nskip",
"Skip rows",
1,
min = 0,
max = 10,
step = 1
),
radioButtons("sep", "Separator",
choices = c(
Comma = ",",
Semicolon = ";",
Tab = "\t"
),
selected = ","
),
checkboxInput("view_og", "View original file", F)
),
mainPanel(
tableOutput("contents")
)
)
),
tabPanel(
"3. Allocate",
sidebarLayout(
sidebarPanel(
textInput("input_ticker", "Add additional asset ticker", ""),
actionButton("add_ticker", "Update ticker list"),
br(), br(),
uiOutput("sliders")
),
mainPanel(
br(),
plotOutput("plot_comparison")
)
)
),
tabPanel(
"4. Trades",
sidebarLayout(
sidebarPanel(
checkboxInput(
"threshold_option",
"Avoid small trades?",
T
),
numericInput(
"threshold_dollar",
"Avoid trades below $",
25,
min = 0,
max = 125,
step = 5
),
br(), br(),
tableOutput("report_allocation")
),
mainPanel(
tableOutput("trades") # ,
# "Data current as of ",textOutput("datetime")
)
)
)
)