question

Upvotes
Accepted
401 17 17 33

Tick history via R

I am interested in interfacing your tick history platform with a programming language such as R (statistical software, http://www.r-project.org/), using an API or functions you would have written.

As I imagine it, there would ideally exist a R function that would allow me to send a request to your tick history platform in order to retrieve the history of a given ticker at a certain date/time.

tick-history-rest-apir
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Upvotes
Accepted
322 5 11 16

Yes, it is possible to use TRTH via R.

Download the API from the TRTH download page here on the Developer portal.

To install please select "Run As an Adminstrator" before running R.

You will need to select from the menu bar "Packages" and then "Install packages(s) from local zip files..."

You will also need to install RCurl, XML and the base64 packages prior to loading THAPI in R. You can install these in the R GUI from the Packages & Data menu.

Once you have installed the package, you will need to call the library function to load the package into R. This will automatically load THAPI and its auxiliary packages.

library(THAPI)

Before you use any of the Tick History services, you will need to create a login object containing your username and password:

rdth <- createCredential(user="username@xyz.com",
password="your password")
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I cant find package THAPI. Any idea? I am using R version 3.3.0