R/module_portfolio_plot.R

Defines functions modulePortfolioPlotServer modulePortfolioPlotUI

#' @export

modulePortfolioPlotUI <- function(id) {
  tagList(
    introBox(plotOutput(NS(id, "Module_Portfolio_Plot")), data.step = 2,
             data.intro = "Here we will plot the running proift of the chosen study against the buy and hold stock position.")
  )
}

#' @export

modulePortfolioPlotServer <- function(id) {
  moduleServer(id, function(input, output, session) {
    output$Module_Portfolio_Plot <- shiny::renderPlot(
      ggplot() +
        geom_line(data = results, aes(x = entry_date, y = portfolio_profit)) +
        xlab("Entry Date") +
        ylab("Trade Profit") +
        theme_bw() +
        theme(axis.title = element_text(size = 14, face = "bold")),
      height = 600, width = "auto")
  })
}
themechanicalbear/mobstrs documentation built on Dec. 31, 2020, 8:35 a.m.