TDIConnection: TDIConnection (R6 class constructor)

TDIConnectionR Documentation

TDIConnection (R6 class constructor)

Description

'TDIConnection' class is a generic and abstract R6 class, that wraps an object of class 'TDIDriver' with the connection parameters. Its purpose is to provide the capabilities to connect with the API. Each API extends this class to implement the API specific capabilities.

Super class

TDI::baseTDI -> TDIConnection

Public fields

driver

An object of class 'TDIDriver'.

conn_args

List with connection parameters.

endpoints

List with available API endpoints.

values

List collection with valid parameter values.

Methods

Public methods

Inherited methods

Method new()

Initialize the API connection for the sub-class. This class is abstract and cannot be instantiated.

Usage
TDIConnection$new(driver, conn_args, endpoints, values)
Arguments
driver

An object of class 'TDIDriver'.

conn_args

List with connection parameters.

endpoints

List with available API endpoints.

values

List with allowed values for parameter(s).

Returns

An object of class 'TDIConnection'.


Method getInstrument()

Interface method to be implemented by sub-class.

Usage
TDIConnection$getInstrument(symbol)
Arguments
symbol

Symbol to identify the instrument.

Returns

A list with the calling arguments.


Method getChart()

Interface method to be implemented by sub-class.

Usage
TDIConnection$getChart(
  symbol,
  range = NULL,
  from = NULL,
  to = NULL,
  interval = NULL
)
Arguments
symbol

Symbol to identify the instrument.

range

Optional period range.

from

Optional start date of period.

to

Optional end date of period.

interval

Optional interval.

Returns

A list with the calling arguments.


Method getCashFlow()

Interface method to be implemented by sub-class.

Usage
TDIConnection$getCashFlow(symbol)
Arguments
symbol

Symbol to identify the instrument.

Returns

A list with the calling arguments.


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