# NOT RUN {
data( ticks )
time_series = to_candles( ticks, 60 * 10 )
plot_ts( time_series[ time %bw% '2016-05-13', list( time, open, high, low, close ) ] )
plot_ts( time_series[ time %bw% '2016-05-13', list( time, volume = volume / 1e6 ) ] , type = 'h' )
plot_ts( time_series[ time %bw% '2016-05', list( time, close ) ] )
plot_ts( time_series[ , list( time, close ) ] )
# }
# NOT RUN {
mar = par( 'mar' )
par( mar = c( 0, 4, 0, 4 ), xaxt = 'n' )
layout ( matrix( 1:(3 + 2) ), heights = c( 1, 4, 2, 2, 1 ) )
empty_plot()
plot_ts( time_series[ , list( time, open, high, low, close ) ] )
plot_ts( time_series[ , list( time, close ) ] )
par( xaxt = 's' )
plot_ts( time_series[ , list( time, volume = volume / 1e6 ) ], type = 'h' )
empty_plot()
par( mar = mar )
layout( matrix(1) )
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab