xts 刻度数据滚动子集 [英] xts tick data rolling subset

查看:21
本文介绍了xts 刻度数据滚动子集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 SQL 数据库中的历史刻度数据创建了一个 xts 对象.我想创建刻度数据的子集,例如:

I have created an xts object from historical tick data, sourced from a SQL database. I would like to create subsets of the tick data, for example:

在上午 10 点到下午 2:30 之间显示每日刻度.这将允许我根据一天中的时间为特定的交易想法创建特定的数据集.我的索引格式如下:

Show daily ticks between 10am and 2:30pm. This would allow me to create specific data sets for specific trade ideas, based on the time of day. The format of my index is as follows:

> index(merged[3567,])
[1] "2011-08-01 13:17:59 SAST"

xts 方面的专家能否请教我如何创建这些子集?任何建议将不胜感激.

Could an expert in xts please advise me how I would go about creating these subsets? Any advice would be greatly appreciated.

推荐答案

您可以使用时间子集设置:

You can do it with time-of-day subsetting:

merged["T10:00/T14:30"]

这篇关于xts 刻度数据滚动子集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆