Compressing tick data

Use this forum to discuss data providers like CSI, charting, or other non testing software.
Post Reply
Sam
Senior Member
Senior Member
Posts: 41
Joined: Wed May 14, 2003 5:40 pm
Location: London, United Kingdom

Compressing tick data

Post by Sam » Thu Jan 13, 2005 11:56 am

I have some tick data in ascii/csv format that I would like to compress into open-high-low-close time bars (e.g. 5 sec, 15 sec, 1 minute etc), again as ascii or csv format.

How can I do this using either using Excel or some other software?

I would be grateful for any suggestions.

Sam

ksberg
Roundtable Knight
Roundtable Knight
Posts: 208
Joined: Fri Jan 23, 2004 1:39 am
Location: San Diego

Post by ksberg » Thu Jan 13, 2005 9:41 pm

If you've access, knowledge, and a setup for Java, you can leverage the built-in ZIP compression for file IO ...

Code: Select all

import java.io.*;
import java.util.zip.*;

...

try {
  FileOutputStream fos = new FileOutputStream(fileName);
  GZIPOutputStream gos = new GZIPOutputStream(fos);
  // ... write your output
  gos.close();
Done

Cheers,

Kevin

Sam
Senior Member
Senior Member
Posts: 41
Joined: Wed May 14, 2003 5:40 pm
Location: London, United Kingdom

Post by Sam » Fri Jan 14, 2005 9:05 am

Kevin,

Many thanks for this. Unfortunately I don't have Java. However I have now managed to convert price ticks to 5 sec bars using Amibroker (with the developer's help).

Cheers,

Sam

Post Reply