public void printTransactions(boolean writeHeader, String fileNameTransactions){
        try{
            String outputFileName = folder + fileNameTransactions;
            FileWriter writer = new FileWriter(outputFileName, true);
            if (writeHeader){
                writer.write("moHFT;mo;loHFT;lo;tradeTime;FV;Price;buyerPV;sellerPV;buyMO;buyerCosts;sellerCosts;timeLO;" + "\r");
            }
            int sz = history.size();
            double mo;                               // payoff from market order
            double lo;                               // payoff from limit order
            double loTime;                           // time of limit order submission
            int moHFT;                               // is the MO submitter HFT
            int loHFT;                               // is the LO submitter HFT
            int buyMO;
            for (int i = 0; i < sz; i++){
                Trade t = history.get(i);
                if (t.getTimeBuyer() < t.getTimeSeller()){           // distinguishing if seller initiated
                    mo = t.getPrice() - t.getSellerPV() - t.getFV();
                    moHFT = t.isSellerIsHFT() ? 1 : 0;
                    lo = t.getFV() + t.getBuyerPV() - t.getPrice();
                    loHFT = t.isBuyerIsHFT() ? 1 : 0;
                    buyMO = 0;                                      // seller initiated order
                    loTime = t.getTimeBuyer();
                } else {
                    mo = t.getFV() + t.getBuyerPV() - t.getPrice();
                    moHFT = t.isBuyerIsHFT() ? 1 : 0;
                    lo = t.getPrice() - t.getSellerPV() - t.getFV();
                    loHFT = t.isSellerIsHFT() ? 1 : 0;
                    buyMO = 1;                                      // buyer initiated order
                    loTime = t.getTimeSeller();
                }
                //writer.writeDecisions(history.get(i).printTrade());
                writer.write(moHFT + ";" + mo + ";" + loHFT + ";" + lo + ";"  + t.getTimeTrade() +  ";"
                        + t.getFV() + ";" + t.getPrice() + ";" + t.getBuyerPV() + ";" +
                        t.getSellerPV() + ";" + buyMO + ";"
                        + t.getTrCostsBuyer() + ";" + t.getTrCostsSeller() + ";" + loTime + ";" +
                        t.getFVbeforeBuyer() + ";" + t.getFVbeforeSeller() + ";" + "\r");
            }
            writer.close();
        }
        catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }