Class TradeCsvWriter


  • public final class TradeCsvWriter
    extends Object
    Writes trades to a CSV file.

    This takes a Strata Trade instance and creates a matching CSV file.

    • Method Detail

      • standard

        public static TradeCsvWriter standard()
        Obtains an instance that uses the standard set of reference data.
        Returns:
        the loader
      • of

        public static TradeCsvWriter of​(TradeCsvInfoSupplier supplier)
        Obtains an instance that uses the specified supplier for additional information.
        Parameters:
        supplier - the supplier used to extract additional information to output
        Returns:
        the loader
      • write

        public void write​(List<? extends Trade> trades,
                          Appendable output)
        Write trades to an appendable in the applicable full details trade format.

        The output is written in full details trade format.

        Parameters:
        trades - the trades to write
        output - the appendable to write to
        Throws:
        IllegalArgumentException - if the metadata does not contain tenors
        UncheckedIOException - if an IO error occurs