Package com.quantcomponents.algo

Examples of com.quantcomponents.algo.TradeBean


    }
    int signedTradeAmount = orderInfo.order.getSide() == OrderSide.BUY ? tradeAmount : -tradeAmount;
    double tradeCommissionAmount = commissionCalculator.calculateCommission(orderInfo.order, tradeAmount, executionPrice);
    double tradeCashFlow = -(signedTradeAmount * multiplier * executionPrice) - tradeCommissionAmount;
    double tradeAveragePrice = Math.abs(tradeCashFlow / multiplier / tradeAmount);
    TradeBean trade = new TradeBean(orderInfo.order, "Simulated", getLastPriceTimestamp(contract), tradeAmount, executionPrice, tradeAveragePrice);
    trades.add(trade);
    positionCalculator.onTrade(trade);
    for (IOrderStatusListener listener : orderStatusListeners) {
      listener.onOrderFilled(Integer.toString(orderInfo.internalId), tradeAmount, orderInfo.order.getAmount() == tradeAmount, executionPrice);
    }
View Full Code Here

TOP

Related Classes of com.quantcomponents.algo.TradeBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.