Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8324691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:09:52+00:00 2026-06-09T00:09:52+00:00

I’m working with tick data and would like to have some basic information about

  • 0

I’m working with tick data and would like to have some basic information about the distribution of the change in tick prices. My database is made of tick data during a period of 10 open days.
I’ve taken the first difference of the tick prices :

                     Tick spread
2010-02-02 08:00:04   -1
2010-02-02 08:00:04    1
2010-02-02 08:00:04    0
2010-02-02 08:00:04    0
2010-02-02 08:00:04    0
2010-02-02 08:00:04   -1
2010-02-02 08:00:05    1
2010-02-02 08:00:05    1

I’ve created an array which provides me with the first and last tick of each day :

       Open  Close
[1,]      1  59115
[2,]  59116 119303
[3,] 119304 207300
[4,] 207301 351379
[5,] 351380 426553
[6,] 426554 516742
[7,] 516743 594182
[8,] 594183 683840
[9,] 683841 754962
[10,] 754963 780725

I would like to know each day the empirical distribution of my tick spreads.
I know that I can use the R function table() but the problem is that it gives me a table object which length varies with days. The second problem is that some day I can have spreads of 3 points whereas the days after I only have spreads less than 3 points.

first day table() output :

 -3    -2    -1     0     1     2     3 
  1    19  6262 46494  6321    16     2

second day table() output :

-2    -1     0     1     2     3     5 
27  5636 48902  5588    33     1     1

What I would like is to create a data frame with all table()’s output for my whole tick sample.
Any idea?
thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:09:54+00:00Added an answer on June 9, 2026 at 12:09 am

    Just use a 2-dimensional table, using as.Date(index(x)) as the rows:

    # create some example data
    set.seed(21)
    p <- sort(runif(6))*(1:6)^2
    p <- c(p,rev(p)[-1])
    p <- p/sum(p)
    P <- sample(-5:5, 1e5, TRUE, p)
    x <- .xts(P, (1:1e5)*5)
    # create table
    table(as.Date(index(x)), x)
    #             x
    #                -5   -4   -3   -2   -1    0    1    2    3    4    5
    #   1970-01-01   22  141  527 1623 2968 6647 2953 1700  538  139   21
    #   1970-01-02   31  142  548 1596 2937 6757 2874 1677  529  167   22
    #   1970-01-03   26  172  547 1599 2858 6814 2896 1681  504  163   20
    #   1970-01-04   23  178  537 1645 2855 6805 2891 1626  537  165   18
    #   1970-01-05   23  139  490 1597 3028 6740 2848 1724  505  158   28
    #   1970-01-06   21  134  400 1304 2266 5496 2232 1213  397  112   26
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data like this: 1 2 3 4 5 9 2 6
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a view passing on information from a database: def serve_article(request, id): served_article
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a reasonable size flat file database of text documents mostly saved in
I don't have much knowledge about the IPv6 protocol, so sorry if the question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.