Learn R Programming

QuantTools (version 0.5.7.1)

to_ticks: Convert candles to ticks

Description

Convert candles to ticks

Usage

to_ticks(x)

Arguments

x

candles, read 'Candles' in Processor

Details

Convert OHLCV candles to ticks using the following model. One candle is equivalent to four ticks ( time, price, volume ): ( time - period, open, volume / 4 ); ( time - period / 2, high, volume / 4 ); ( time - period / 2, low, volume / 4 ); ( time - period / 100, close, volume / 4 ). Assuming provided candles have frequent period ( less than a minute ) it is a good approximation for tick data which can be used to speed up back testing or if no raw tick data available.

Examples

Run this code
# NOT RUN {
data( ticks )
candles = to_candles( ticks, timeframe = 60 )
to_ticks( candles )

# }

Run the code above in your browser using DataLab