Page 1 of 1

Compressing tick data

Posted: Thu Jan 13, 2005 11:56 am
by Sam
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

Posted: Thu Jan 13, 2005 9:41 pm
by ksberg
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

Posted: Fri Jan 14, 2005 9:05 am
by Sam
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