timeOHLCV: Make time based OHLC bars

Description Usage Arguments Details Value

View source: R/bars.R

Description

The traditional OHLC bars based on buckets of time.

Usage

1
2
3
4
5
6
7
8
timeOHLCV(
  ticks,
  align_period = 5L,
  align_by = "minutes",
  name = NULL,
  prev_bar = NULL,
  add_name = getOption("FancyBar.AddSymbolName")
)

Arguments

ticks

The original trade data.

align_period

Length of the time period to align by.

align_by

Unit of the time period, can be:

  • seconds: one of 's', 'secs', 'seconds

  • minutes: one of 'm', 'mins', 'minutes

  • hours: one of 'h', 'hours

  • days: one of 'd', 'days'

name

Name of the symbol.

prev_bar

Bar from a previous call to timeOHLCV() with an earlier set of trades.

add_name

Should the name of the symbol be added to the column names?

Details

Bars are aligned on multiples of the time period since midnight, that is a tick happening at 01:06:41 will be in a bar starting on:

The highfrequency package uses the same logic but the timestamp of the bar is the end of the bar period.

Value

Time based OHLC bars.


bobjansen/FancyBars documentation built on Jan. 29, 2022, 2:18 p.m.