tingo plugin get n/a data

Issue #2 closed
Murthy Suresh created an issue

I find that when i use the tingo plugin , its shows n/a data . The tiingo data itself is accurate as i can compare it against the ringo package. Below is the reprex. i just swapped the api key out.

library(riingo)
print(tail(riingo_prices("AAPL")))
#> # A tibble: 6 x 14
#>   ticker date                close  high   low  open    volume adjClose adjHigh
#>   <chr>  <dttm>              <dbl> <dbl> <dbl> <dbl>     <int>    <dbl>   <dbl>
#> 1 AAPL   2022-01-21 00:00:00  162.  166.  162.  164. 122848858     162.    166.
#> 2 AAPL   2022-01-24 00:00:00  162.  162.  155.  160. 162706686     162.    162.
#> 3 AAPL   2022-01-25 00:00:00  160.  163.  157.  159. 115798367     160.    163.
#> 4 AAPL   2022-01-26 00:00:00  160.  164.  158.  164. 108275308     160.    164.
#> 5 AAPL   2022-01-27 00:00:00  159.  164.  158.  162. 121954638     159.    164.
#> 6 AAPL   2022-01-28 00:00:00  170.  170.  163.  166. 179935660     170.    170.
#> # ... with 5 more variables: adjLow <dbl>, adjOpen <dbl>, adjVolume <int>,
#> #   divCash <dbl>, splitFactor <dbl>


# use rtsdata for now

# load `rtsdata` package
require(quantstrat)
#> Loading required package: quantstrat
#> Loading required package: quantmod
#> Loading required package: xts
#> Loading required package: zoo
#> 
#> Attaching package: 'zoo'
#> The following objects are masked from 'package:base':
#> 
#>     as.Date, as.Date.numeric
#> Loading required package: TTR
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo
#> Loading required package: blotter
#> Loading required package: FinancialInstrument
#> Loading required package: PerformanceAnalytics
#> 
#> Attaching package: 'PerformanceAnalytics'
#> The following object is masked from 'package:graphics':
#> 
#>     legend
#> Loading required package: foreach
require(PerformanceAnalytics)
library(rtsdata)
#> 
#> Attaching package: 'rtsdata'
#> The following object is masked from 'package:quantmod':
#> 
#>     getSymbols
#env = new.env()
initDate="1990-01-01"
from="2003-01-01"
to="2021-01-29"
options(width=70)
currency('USD')
#> [1] "USD"
Sys.setenv(TZ="UTC")


# tickers to load data
#env = new.env()



symbols = c('AAPL')
tail(AAPL)
#> Error in tail(AAPL): object 'AAPL' not found

options(getSymbols.av.Default ="<itsmysecret>")
options(RTSDATA_FOLDER='C:/ProgramData/TradingData')

# change the 'yahoo' data source to use CSV files to store historical data
# data is stored in the 'C:/Data/stocks' folder 
# and disable check for updates
register.data.source(src = 'tiingo', 
                     storage = ds.storage.file.csv(getwd(), custom.folder = TRUE),
                     functionality = ds.functionality.default(check.update = TRUE)
)


getSymbols(symbols ,  src = 'tiingo', from = initDate, verbose=TRUE)
#> ***Full Update for AAPL

print(tail(AAPL)) 
#>            AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume
#> 2022-01-21    164.42    166.33   162.30     162.41   122501300
#> 2022-01-24    160.02    162.30   154.70     161.62   162706700
#> 2022-01-25    158.98    162.76   157.02     159.78   115798400
#> 2022-01-26    163.50    164.39   157.82     159.69   108275300
#> 2022-01-27        NA        NA       NA         NA          NA
#> 2022-01-28    165.71    170.35   162.80     170.33   179485800
#>            AAPL.Adjusted
#> 2022-01-21        162.41
#> 2022-01-24        161.62
#> 2022-01-25        159.78
#> 2022-01-26        159.69
#> 2022-01-27            NA
#> 2022-01-28        170.33

Comments (2)

  1. rtsvizteam repo owner

    Could you please try changing

    options(getSymbols.av.Default ="<itsmysecret>")

    to

    options(getSymbols.tiingo.Default =TIINGO_API_TOKEN)

  2. Log in to comment