Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Computing hourly bars and hourly high from tick data
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Francisco  
View profile  
 More options Feb 12, 4:27 am
From: Francisco <frango...@gmail.com>
Date: Sun, 12 Feb 2012 01:27:36 -0800 (PST)
Local: Sun, Feb 12 2012 4:27 am
Subject: Computing hourly bars and hourly high from tick data
Hello,

I'm a newcomer to Q and I need some help with my initial doubts:

My  tick database have these colums:

DateTime                BidPrice AskPrice
-----------------------------------------
2010.05.01T18:17:37.000 1.32875  1.32975
2010.05.02T05:05:36.000 1.3289   1.3299
2010.05.02T18:19:49.000 1.32865  1.33015
2010.05.02T18:19:58.000 1.32895  1.33045
2010.05.02T18:30:50.000 1.3287   1.3307
2010.05.02T18:30:59.000 1.3296   1.3316
2010.05.02T18:32:05.000 1.3299   1.3319
2010.05.02T18:44:00.000 1.3304   1.3324
2010.05.02T18:54:05.000 1.3324   1.3344
2010.05.02T18:54:15.000 1.33125  1.33325
2010.05.02T18:54:41.000 1.33146  1.33346
2010.05.02T18:54:41.000 1.33151  1.33351
2010.05.02T18:54:41.000 1.33177  1.33377

Here is where I need help

I want to add three columns: HourlyBar HourlyHighBid and
HourlyHighAsk:

With these results (computed by hand):

DateTime                BidPrice AskPrice HourlyBar HourlyHighBid
HourlyHighAsk
--------------------------------------------------------------------------- ---------------
2010.05.01T18:17:37.000 1.32875  1.32975 2010.05.01T18:00:00.000
1.32875  1.32975
2010.05.02T05:05:36.000 1.3289   1.3299  2010.05.02T05:00:00.000
1.3289   1.3299
2010.05.02T18:19:49.000 1.32865  1.33015 2010.05.02T18:00:00.000
1.32865  1.33015
2010.05.02T18:19:58.000 1.32895  1.33045 2010.05.02T18:00:00.000
1.32895  1.33045
2010.05.02T18:30:50.000 1.3287   1.3307  2010.05.02T18:00:00.000
1.32895  1.3307
2010.05.02T18:30:59.000 1.3296   1.3316  2010.05.02T18:00:00.000
1.3296   1.3316
2010.05.02T18:32:05.000 1.3299   1.3319  2010.05.02T18:00:00.000
1.3299   1.3319
2010.05.02T18:44:00.000 1.3304   1.3324  2010.05.02T18:00:00.000
1.3304   1.3324
2010.05.02T18:54:05.000 1.3324   1.3344  2010.05.02T18:00:00.000
1.3324   1.3344
2010.05.02T18:54:15.000 1.33125  1.33325 2010.05.02T18:00:00.000
1.3324   1.3344
2010.05.02T18:54:41.000 1.33146  1.33346 2010.05.02T18:00:00.000
1.3324   1.3344
2010.05.02T18:54:41.000 1.33151  1.33351 2010.05.02T18:00:00.000
1.3324   1.3344
2010.05.02T18:54:41.000 1.33177  1.33377 2010.05.02T18:00:00.000
1.3324   1.3344

How can I get these result using Q? Shoud I use xbar function? How?

Best regards


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Attila Vrabecz  
View profile  
 More options Feb 12, 5:57 am
From: Attila Vrabecz <attila.vrab...@gmail.com>
Date: Sun, 12 Feb 2012 10:57:17 +0000
Local: Sun, Feb 12 2012 5:57 am
Subject: Re: [personal kdb+] Computing hourly bars and hourly high from tick data
update HourlyHighBid:max BidPrice,HourlyHighAsk:max AskPrice by HourlyBar:(01:00%24:00)xbar DateTime from table

As DateTime is floating point days, so 1%24 is one hour.

Note that I would suggest using timestamp instead of datetime, in that case it would be
(`long$0D1)xbar timestamp

Cheers,
  Attila
On 12 Feb 2012, at 09:27, Francisco wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Francisco  
View profile  
 More options Feb 12, 1:58 pm
From: Francisco <frango...@gmail.com>
Date: Sun, 12 Feb 2012 10:58:44 -0800 (PST)
Local: Sun, Feb 12 2012 1:58 pm
Subject: Re: [personal kdb+] Computing hourly bars and hourly high from tick data

Hello,

Thanks for your help Attila.

I need that the columns return the highest value in each hour period as
found in real time, using as input data current row and older (excluding
future data).

Best regards


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Francisco  
View profile  
 More options Feb 12, 1:48 pm
From: Francisco <frango...@gmail.com>
Date: Sun, 12 Feb 2012 10:48:43 -0800 (PST)
Local: Sun, Feb 12 2012 1:48 pm
Subject: Re: Computing hourly bars and hourly high from tick data
Hello,

Thanks for your help.

The command that you suggest returns the highest value in each hour
period, but it has unwanted prophetic capabilities as since  the first
tick in each hour is returned the highest value even if it appears in
the minute 59.

The columns as I need them should contain the highest value as found
in real time using as inputs only the current row and older (former
rows in the table...)

Best regards

Francisco

On Feb 12, 11:57 am, Attila Vrabecz <attila.vrab...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wp  
View profile  
 More options Feb 12, 4:48 pm
From: wp <walter1...@gmail.com>
Date: Sun, 12 Feb 2012 21:48:07 +0000
Local: Sun, Feb 12 2012 4:48 pm
Subject: Re: [personal kdb+] Computing hourly bars and hourly high from tick data
maybe you could just offset, as in

update HourlyHighBid:max BidPrice,HourlyHighAsk:max AskPrice by
HourlyBar:(01:00%24:00)+(01:00%24:00)xbar DateTime from table


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Francisco  
View profile  
 More options Feb 13, 4:52 pm
From: Francisco <frango...@gmail.com>
Date: Mon, 13 Feb 2012 13:52:35 -0800 (PST)
Local: Mon, Feb 13 2012 4:52 pm
Subject: Re: Computing hourly bars and hourly high from tick data

Perhaps I'm totally wrong but I had this idea:

Getting the temporal position (tp) of each row in its hourly bar and using
that position to compute mmax of the tp rows should return the instant
hourly high.

Does that sound more or less right?

I have no idea about how to implement this idea. Please, can anyone comment
on this?

Cheers

Francisco


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
junan duan  
View profile  
 More options Feb 17, 1:15 am
From: junan duan <junan.d...@gmail.com>
Date: Fri, 17 Feb 2012 00:15:04 -0600
Local: Fri, Feb 17 2012 1:15 am
Subject: Re: [personal kdb+] Re: Computing hourly bars and hourly high from tick data

update HourlyHighBid:(maxs;BidPrice) fby
HourlyBar,HourlyHighAsk:(maxs;AskPrice) fby HourlyBar from update
HourlyBar:(1%24) xbar DateTime from t

Regards,

Junan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Francisco  
View profile  
 More options Feb 17, 6:56 am
From: Francisco <frango...@gmail.com>
Date: Fri, 17 Feb 2012 03:56:05 -0800 (PST)
Local: Fri, Feb 17 2012 6:56 am
Subject: Re: Computing hourly bars and hourly high from tick data
Thanks a lot!!

Francisco

On Feb 17, 7:15 am, junan duan <junan.d...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »