Sorry, Its not microsecond levels, just seconds. My mistake, sorry.

I'm confused as to how can I use methods available in Quantmod like
chartseries etc if the timestamps are not unique.

Will look more into xts and quantmod, and how to hardcode date from filename
into timestamp while creating xts object :)

Thanks a lot

On Tue, Sep 1, 2009 at 10:43 PM, Brian G. Peterson <brian@braverock.com>wrote:

> jatin patni wrote:
>
>> I'm trying to create a zoo object from a tick data file(sample below)
>> which
>> contains timestamps only.
>> Filename: "20080202.trd"
>> 1|BHARTIARTL|EQ|18:15:05|600|1
>> 2|BHARTIARTL|EQ|18:15:05|600|99
>> 3|GLENMARK|EQ|18:15:05|238.1|5
>> 4|HINDALCO|EQ|18:15:05|43.75|100
>> 5|BHARTIARTL|EQ|18:15:05|600|1
>> 6|BHEL|EQ|18:15:05|1100|11
>> 7|HINDALCO|EQ|18:15:06|43.2|1
>> 8|CHAMBLFERT|EQ|18:15:06|46|10
>> 9|CHAMBLFERT|EQ|18:15:06|46|90
>> 10|BAJAUTOFIN|EQ|18:15:06|80|100
>>
>> As you can see that timestamps are not unique even at microsecond levels.
>> Inorder to create a zoo/xts object to be used with quantmod later, How do
>> I:-
>> 1)Do I have to merge two rows with the same timestamp, symbols, price but
>> different volumes.(Do I need to do this or is there some other way
>> possible)
>> 2)Append date to the timestamp while creating the zoo/xts object
>>
>> I'm trying to explore the 'format' argument, and POSIX and chron but
>> without
>> much success.
>>
>>
>
> Your target should be POSIXct, as that is what xts uses internally, given
> that your stated goal is to use xts and quantmod.
>
> ?as.POSIXct
> ?format.POSIXct
>
> These look like one second bars, not microsecond bars.  To see
> microseconds, if you have them:
>
> options(digits.secs=6)
>
> zoo doesn't require unique timestamps, just ordered ones.  In this case,
> your trades are ordered in the files.  You might need to append an order in
> the microseconds if you really only have second bars.  It's also not
> necessary to have unique timestamps, but you'll be happier if you do.
>
> Regards,
>
>  - Brian
>
>
> --
> Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
>
>


-- 
Jatin Patni
Tel: 91 9833 2180 52
jatinpatni@gmail.com
www.jatinpatni.co.nr

	[[alternative HTML version deleted]]

