TDIConnector: TDIConnector

TDIConnectorR Documentation

TDIConnector

Description

TDIConnector instantiates class 'TDIConnector' to manage connection(s). It's purpose is to establish connection(s) to access API(s) for qualitative data.

Setup and provide an API connection.

Usage

TDIConnector(source = "yahoo")

Arguments

source

API driver class name.

Format

An object of class TDIConnector (inherits from R6) of length 3.

Details

The 'TDIConnector' connects with an API through its driver identified by 'source' (class). It's 'connect()' method establishes the API access via the 'TDIDriver', and returns that connection as an object of class 'TDIConnection'.

The class implements the **singleton pattern** to re-use *open* connections. This is achieved by directly instantiating the class. APIs can use this to pre-load settings.

Value

An object of class 'TDIConnection'.

Examples

# TDI library creates an singleton object of class `TDIConnector`.
# It's `connect()` method is to be used to establish a connection,
# that facilitates the API request.
con <- TDI::TDIConnector$connect(source = "yahoo")
msft <- con$getChart(symbol = "MSFT")

n0Trader/TDI documentation built on July 30, 2023, 7:48 p.m.