Examples of OrderEstimate


Examples of org.archfirst.bfoms.domain.account.brokerage.order.OrderEstimate

                quantity,
                OrderType.Market,
                null,
                OrderTerm.GoodTilCanceled,
                false);
        OrderEstimate estimate = this.brokerageAccountService.getOrderEstimate(
                USERNAME1, brokerageAccount1Id, orderParams);
       
        return (estimate.getCompliance() == OrderCompliance.Compliant) ?
                "accepted" : "rejected";
    }
View Full Code Here

Examples of org.archfirst.bfoms.domain.account.brokerage.order.OrderEstimate

                quantity,
                OrderType.Market,
                null,
                OrderTerm.GoodTilCanceled,
                false);
        OrderEstimate estimate = this.brokerageAccountService.getOrderEstimate(
                USERNAME1, brokerageAccount1Id, orderParams);
       
        return (estimate.getCompliance() == OrderCompliance.Compliant) ?
                "accepted" : "rejected";
    }
View Full Code Here

Examples of org.archfirst.bfoms.domain.account.brokerage.order.OrderEstimate

        }
    }
   
    public Order placeOrder(OrderParams params, MarketDataService marketDataService) {
        // Check compliance
        OrderEstimate orderEstimate =
            this.calculateOrderEstimate(params, marketDataService);
        if (orderEstimate.getCompliance() != OrderCompliance.Compliant) {
            throw new IllegalArgumentException("Order is not compliant with the account");
        }

        // Place order
        Order order = new Order(params);
View Full Code Here

Examples of org.archfirst.bfoms.domain.account.brokerage.order.OrderEstimate

        Money cashAvailable = cashPosition;
       
        // Reduce cash available by estimated cost of buy orders
        List<Order> orders = brokerageAccountRepository.findActiveBuyOrders(this);
        for (Order order : orders) {
            OrderEstimate orderEstimate =
                order.calculateOrderEstimate(marketDataService);
            cashAvailable =
                cashAvailable.minus(orderEstimate.getEstimatedValueInclFees());
        }
       
        return cashAvailable;
    }
View Full Code Here

Examples of org.archfirst.bfoms.domain.account.brokerage.order.OrderEstimate

    public OrderEstimate calculateOrderEstimate(
            OrderParams params,
            MarketDataService marketDataService) {

        Order order = new Order(params);
        OrderEstimate orderEstimate = order.calculateOrderEstimate(marketDataService);

        // Determine account level compliance
        if (orderEstimate.getCompliance() == null) {
            OrderCompliance compliance = (order.getSide() == OrderSide.Buy) ?
                    calculateBuyOrderCompliance(order, orderEstimate, marketDataService) :
                    calculateSellOrderCompliance(order);
            orderEstimate.setCompliance(compliance);
        }

        return orderEstimate;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.