get_candles {moexer}R Documentation

Get Candles for a Set of Securities

Description

REST path: ⁠/engines/[engine]/markets/[market]/boards/[board]/securities/[security]/candles⁠ (see http://iss.moex.com/iss/reference/46).

Usage

get_candles(secid, from, till = NULL, interval = "monthly", ...)

Arguments

secid

A vector of security ID's.

from

A date or a datetime object, or something that can be coerced to it with readr::parse_date or readr::parse_datetime.

till

A date or a datetime object, or something that can be coerced to it with readr::parse_date or readr::parse_datetime, or NULL. If NULL, interpreted by ISS as "today".

interval

A character value specifying the candle duration (see moexer.candle.intervals option.)

...

Further arguments to query_iss.

Details

To get the engine-market-board path a separate get_security_info query is made and the board with is_primary = 1 is selected.

All candles for the specified period will be fetched, see fetching_fully.

Value

A tibble as with candles in OHLCV format, prepended with a column containing the corresponding security ID.

Examples

## Not run: 
# Get daily candles for `SBER`, `FXGD` from 2020-01-01 until today. Note that
# an unknown symbol `XXXX` is skipped with a warning.
get_candles(
    secid = c('XXXX', 'SBER', 'FXGD'),
    from = '2020-01-01',
    debug_output = TRUE
)

# Get SBER minute candles for one trading day (all 526 of them)
get_candles(
    secid = 'SBER',
    from = '2020-01-10',
    till = '2020-01-10',
    interval = 'per_minute'
)

# Get SBER minute candles for the specified time period (1 hour)
get_candles(
    secid = 'SBER',
    from = '2020-01-10 11:00:00',
    till = '2020-01-10 12:00:00',
    interval = 'per_minute'
)

## End(Not run)

[Package moexer version 0.3.0 Index]