shiny app not running after saving

Hi, I am having an issue similar to what described on:

My Shiny app only works in a fresh script but it fails after saving. The specific error I am receiving is: "Error in get(symbol, envir = envir) : object 'AAPL' not found" pointing at the quantstrat package I used to produce data in the app. The fact is that when pasting the script on a new sheet it runs with no issues and no errors. In case you need the devtools::session_info() this is it here below: I approeciate if someone can kindly help to find a solution

  • Session info --------------------------------------------------------------------------------------
    setting value
    version R version 3.5.1 (2018-07-02)
    os Windows >= 8 x64
    system x86_64, mingw32
    ui RStudio
    language (EN)
    collate English_United Kingdom.1252
    ctype English_United Kingdom.1252
    tz Europe/Berlin
    date 2019-11-29

  • Packages ------------------------------------------------------------------------------------------
    package * version date lib source
    admisc 0.5 2019-11-03 [1] CRAN (R 3.5.3)
    assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.5.1)
    backports 1.1.2 2017-12-13 [1] CRAN (R 3.5.0)
    blotter * 0.14.7 2019-10-15 [1] Github (braverock/blotter@16349ee)
    boot 1.3-20 2017-08-06 [2] CRAN (R 3.5.1)
    callr 3.3.1 2019-07-18 [1] CRAN (R 3.5.3)
    cli 1.1.0 2019-03-19 [1] CRAN (R 3.5.3)
    codetools 0.2-15 2016-10-05 [2] CRAN (R 3.5.1)
    colorspace 1.3-2 2016-12-14 [1] CRAN (R 3.5.1)
    colourpicker * 1.0 2017-09-27 [1] CRAN (R 3.5.3)
    crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.1)
    crosstalk 1.0.0 2016-12-21 [1] CRAN (R 3.5.1)
    curl 4.2 2019-09-24 [1] CRAN (R 3.5.3)
    data.table 1.12.0 2019-01-13 [1] CRAN (R 3.5.3)
    desc 1.2.0 2018-05-01 [1] CRAN (R 3.5.3)
    devtools 2.2.0 2019-09-07 [1] CRAN (R 3.5.3)
    digest 0.6.21 2019-09-20 [1] CRAN (R 3.5.3)
    dplyr * 0.8.3 2019-07-04 [1] CRAN (R 3.5.3)
    DT * 0.8 2019-08-07 [1] CRAN (R 3.5.3)
    ellipsis 0.2.0.1 2019-07-02 [1] CRAN (R 3.5.3)
    FinancialInstrument * 1.3.1 2018-01-10 [1] CRAN (R 3.5.3)
    foreach * 1.4.7 2019-07-27 [1] CRAN (R 3.5.3)
    fs 1.3.1 2019-05-06 [1] CRAN (R 3.5.3)
    ggplot2 * 3.0.0 2018-07-03 [1] CRAN (R 3.5.1)
    glue 1.3.1 2019-03-12 [1] CRAN (R 3.5.3)
    gtable 0.2.0 2016-02-26 [1] CRAN (R 3.5.1)
    htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.1)
    htmlwidgets 1.3 2018-09-30 [1] CRAN (R 3.5.1)
    httpuv 1.4.5 2018-07-19 [1] CRAN (R 3.5.1)
    httr 1.4.1 2019-08-05 [1] CRAN (R 3.5.3)
    iterators 1.0.12 2019-07-26 [1] CRAN (R 3.5.3)
    jsonlite 1.6 2018-12-07 [1] CRAN (R 3.5.3)
    labeling 0.3 2014-08-23 [1] CRAN (R 3.5.0)
    later 0.7.4 2018-08-31 [1] CRAN (R 3.5.1)
    lattice 0.20-35 2017-03-25 [2] CRAN (R 3.5.1)
    lazyeval 0.2.1 2017-10-29 [1] CRAN (R 3.5.1)
    magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.1)
    MASS 7.3-50 2018-04-30 [2] CRAN (R 3.5.1)
    memoise 1.1.0 2017-04-21 [1] CRAN (R 3.5.1)
    mime 0.5 2016-07-07 [1] CRAN (R 3.5.0)
    miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 3.5.1)
    munsell 0.5.0 2018-06-12 [1] CRAN (R 3.5.1)
    PerformanceAnalytics * 1.5.3 2019-06-23 [1] CRAN (R 3.5.3)
    pillar 1.3.1 2018-12-15 [1] CRAN (R 3.5.2)
    pkgbuild 1.0.5 2019-08-26 [1] CRAN (R 3.5.3)
    pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.5.1)
    pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.5.3)
    plotly * 4.8.0 2018-07-20 [1] CRAN (R 3.5.1)
    plyr 1.8.4 2016-06-08 [1] CRAN (R 3.5.1)
    prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.1)
    processx 3.4.1 2019-07-18 [1] CRAN (R 3.5.3)
    promises 1.0.1 2018-04-13 [1] CRAN (R 3.5.1)
    ps 1.3.0 2018-12-21 [1] CRAN (R 3.5.3)
    purrr 0.3.2 2019-03-15 [1] CRAN (R 3.5.3)
    QCA 3.6 2019-11-17 [1] CRAN (R 3.5.3)
    quadprog 1.5-7 2019-05-06 [1] CRAN (R 3.5.3)
    quantmod * 0.4-15 2019-06-17 [1] CRAN (R 3.5.3)
    quantstrat * 0.16.4 2019-10-15 [1] Github (braverock/quantstrat@8a86c4b)
    R6 2.4.0 2019-02-14 [1] CRAN (R 3.5.3)
    Rcpp 1.0.2 2019-07-25 [1] CRAN (R 3.5.3)
    remotes 2.1.0 2019-06-24 [1] CRAN (R 3.5.3)
    rlang 0.4.0 2019-06-25 [1] CRAN (R 3.5.3)
    rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.1)
    rsconnect 0.8.8 2018-03-09 [1] CRAN (R 3.5.1)
    scales 1.0.0 2018-08-09 [1] CRAN (R 3.5.1)
    sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.5.3)
    shiny * 1.1.0 2018-05-17 [1] CRAN (R 3.5.1)
    testthat 2.2.1 2019-07-25 [1] CRAN (R 3.5.3)
    tibble 2.0.1 2019-01-12 [1] CRAN (R 3.5.2)
    tidyr 0.8.1 2018-05-18 [1] CRAN (R 3.5.1)
    tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.5.2)
    TTR * 0.23-5 2019-09-23 [1] CRAN (R 3.5.3)
    usethis 1.5.1 2019-07-04 [1] CRAN (R 3.5.3)
    venn 1.7 2018-07-31 [1] CRAN (R 3.5.3)
    viridisLite 0.3.0 2018-02-01 [1] CRAN (R 3.5.1)
    withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.1)
    xtable 1.8-3 2018-08-29 [1] CRAN (R 3.5.1)
    xts * 0.11-2 2018-11-05 [1] CRAN (R 3.5.3)
    yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.1)
    zoo * 1.8-6 2019-05-28 [1] CRAN (R 3.5.3)

[1] C:/Users/Agrasso/Documents/R/win-library/3.5
[2] C:/Program Files/R/R-3.5.1/library

I just want to add that the datasets to build the app have been loaded and manipulated outside the shiny server. The short fix is to remove the data load and manipulation on a separate sheet and to run the saved app apart. That would work but it raised a new question: since the data is dynamically loaded via quantstrat and needs to be run daily before the stock closing time, how can I publish an app whose data is recreated daily outside its server? Thanks!