Class TickFileWriter

java.lang.Object
com.quantfinlib.data.TickFileWriter
All Implemented Interfaces:
AutoCloseable

public final class TickFileWriter extends Object implements AutoCloseable
Writer for the QFLT binary tick format — compact capture of live tick streams for deterministic replay (28 bytes per tick, buffered sequential writes).

Format: magic "QFLT" + version byte, then framed records: type 1 = symbol definition (int id, UTF-8 name), type 0 = tick (int symbolId, double price, double size, long timestampNanos). Symbol definitions may appear anywhere before the first tick that references them, so symbols can be added mid-capture.

  • Constructor Details

  • Method Details

    • defineSymbol

      public void defineSymbol(int symbolId, String symbol) throws IOException
      Registers a symbol id (idempotent; must precede its first tick).
      Throws:
      IOException
    • write

      public void write(int symbolId, double price, double size, long timestampNanos) throws IOException
      Throws:
      IOException
    • tickCount

      public long tickCount()
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException