+ Reply to Thread
Results 1 to 10 of 10

help cleaning up data and retrieving the time of day for high and low values...

  1. #1
    Registered User
    Join Date
    06-10-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2011
    Posts
    26

    help cleaning up data and retrieving the time of day for high and low values...

    I have several files (txt) for different trading instruments that are in the following format:

    yyyymmdd hhmmss;open;high;low;close;volume

    There should be 1 line for every minute of each trading day going back to 2010. Some of these lines are missing. What I would like to first do is fill the gaps. If a minute value is missing I would like to create a line with the closing value of the previous line for all 4 values of the new line but only if it is between the hours of 9:30 and 14:15 and monday-friday (the pit trading session).

    The second thing I want to do is pullout the highest high value and the lowest low value of each day and the time that these values occurred but only during the pit session (9:30 to 14:15). I've included two files comprising almost 6 days of data if anyone can help.

    Also if I'm being stupid and this is better accomplished in excel please let me know.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: help cleaning up data and retrieving the time of day for high and low values...

    I don't understand your hours 9:30-14:15
    there are a lot of hours that aren't in that range
    Please Login or Register  to view this content.
    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    06-10-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: help cleaning up data and retrieving the time of day for high and low values...

    Most financial markets trade nearly 24 hours a day but there is a primary day session which runs from 9:30 am EST until 14:15 EST. In the data I provided the time stamps I believe are off by two hours which probably has to do with my time zone so it probably should be 7:30 until 12:15. This obviously means most of trading hours are outside this range.

    Thanks so much for having a crack at it. I'm going to take a look at your code and run it but I really appreciate the help. This data is very unwieldy going back several years by the minute.

  4. #4
    Registered User
    Join Date
    06-10-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: help cleaning up data and retrieving the time of day for high and low values...

    BASLV,

    Can I ask one more favor? Can you help me to amend the top line so that this will work on a Mac? I also got a compilation error complaining of "TrailingMinusNumbers" (named argument not found)

    Thanks again.
    Last edited by yertleturtle; 02-15-2014 at 05:34 PM.

  5. #5
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: help cleaning up data and retrieving the time of day for high and low values...

    see attachment

    sorry , an error with the weekday
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by bsalv; 02-15-2014 at 06:52 PM.

  6. #6
    Registered User
    Join Date
    06-10-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: help cleaning up data and retrieving the time of day for high and low values...

    I've actually figured out a way to export the data more cleanly. It now comes direct to excel and there is no overnight data. I just need help determining the open, high, low and close of each day as well as the time the high and low were made. I hope this is helpful.

    EDIT

    I posted this before I saw your post above. This looks amazing! Thank you. Is there a way I can exclude Sundays? Also - is there a way to know at what time the high and low were made? I really appreciate the help.
    Attached Files Attached Files
    Last edited by yertleturtle; 02-15-2014 at 06:54 PM.

  7. #7
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: help cleaning up data and retrieving the time of day for high and low values...

    Please Login or Register  to view this content.
    Last edited by bsalv; 02-15-2014 at 07:23 PM. Reason: new version

  8. #8
    Registered User
    Join Date
    06-10-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: help cleaning up data and retrieving the time of day for high and low values...

    bsalv,

    I'm very appreciative of your help but I still can't get this to work on my mac. I'm sure its something to do with file structure being different or a slightly different syntax but I can't get it to work. I wish I understood this stuff better but is there any chance you can upload one more excel file with the latest code?

    Sorry - I'm sure its something simple but I know almost nothing about programming.

    Thanks again.

  9. #9
    Registered User
    Join Date
    06-10-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: help cleaning up data and retrieving the time of day for high and low values...

    So I've tried "Step Into" to figure out what my mac doesn't like. When I get to the line Set Dict = CreateObject("scripting.dictionary") I get the error message "License information for this component not found..."

    If you have any idea of how to resolve this...

  10. #10
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: help cleaning up data and retrieving the time of day for high and low values...

    the old fashion way with an array
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Selecting a range of values from high frequency data
    By AledgG87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2012, 06:10 AM
  2. Excel 2007 : Ignore high values in data set
    By kevinjay1 in forum Excel General
    Replies: 2
    Last Post: 02-13-2012, 06:44 PM
  3. Run time error when retrieving data from array
    By ZahraShuaib in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2010, 05:12 AM
  4. cleaning rows from useless values
    By alessandro1964 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-27-2010, 09:05 AM
  5. Replies: 5
    Last Post: 02-13-2005, 08:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1