com.fluxtion.server.lib.pnl.TradeBatch Maven / Gradle / Ivy
/*
* SPDX-FileCopyrightText: © 2024 Gregory Higgins
* SPDX-License-Identifier: AGPL-3.0-only
*/
package com.fluxtion.server.lib.pnl;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class TradeBatch {
private List trades = new ArrayList<>();
private double fee = 0;
public static TradeBatch of(double fee, Trade... trades) {
TradeBatch tradeBatch = new TradeBatch();
for (Trade position : trades) {
tradeBatch.getTrades().add(position);
}
tradeBatch.setFee(fee);
return tradeBatch;
}
public static TradeBatch of(Trade... trades) {
return TradeBatch.of(0.0, trades);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy