Package org.archfirst.bfoms.domain.account.brokerage.order

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


    }
   
    public void processOrderCancelReject(Long orderId, OrderStatus newStatus) {
       
        // Get the order
        Order order = this.findOrder(orderId);
        if (order == null) {
            logger.error("OrderCancelReject: order {} not found", orderId);
        }

        // Send the new status to the order
        order.cancelRequestRejected(newStatus, orderEventPublisher);
    }
View Full Code Here


        if (orderEstimate.getCompliance() != OrderCompliance.Compliant) {
            throw new IllegalArgumentException("Order is not compliant with the account");
        }

        // Place order
        Order order = new Order(params);
        brokerageAccountRepository.persistAndFlush(order);
        this.addOrder(order);
        orderEventPublisher.publish(new OrderCreated(order));
        return order;
    }
View Full Code Here

        return order;
    }
   
    public void processExecutionReport(ExecutionReport executionReport) {
        logger.debug("Processing ExecutionReport: {}", executionReport);
        Order order =
            brokerageAccountRepository.findOrder(executionReport.getClientOrderId());
        Trade trade = order.processExecutionReport(
                executionReport, brokerageAccountRepository, orderEventPublisher);
        if (trade != null) {
            this.addTransaction(trade);
            if (trade.getSide() == OrderSide.Buy) {
                cashPosition = cashPosition.plus(
View Full Code Here

    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);
        }
View Full Code Here

                null,
                OrderTerm.GoodTilCanceled,
                false);
        Long orderId = this.brokerageAccountService.placeOrder(
                USERNAME1, brokerageAccount1Id, orderParams);
        Order order = this.brokerageAccountService.findOrder(orderId);
       
        // Acknowledge the order
        ExecutionReport executionReport = ExecutionReport.createNewType(order);
        this.brokerageAccountService.processExecutionReport(executionReport);
       
View Full Code Here

                null,
                OrderTerm.GoodTilCanceled,
                false);
        Long orderId = this.brokerageAccountService.placeOrder(
                USERNAME1, brokerageAccount1Id, orderParams);
        Order order = this.brokerageAccountService.findOrder(orderId);
       
        // Acknowledge the order
        ExecutionReport executionReport = ExecutionReport.createNewType(order);
        this.brokerageAccountService.processExecutionReport(executionReport);
       
View Full Code Here

        if (this.referenceDataService.lookup(params.getSymbol()) == null) {
            throw new InvalidSymbolException();
        }
       
        // Place order
        Order order = account.placeOrder(params, marketDataService);
        exchangeTradingService.placeOrder(order);
        return order.getId();
    }
View Full Code Here

    }
   
    public void cancelOrder(String username, Long orderId) {

        // Check authorization on account
        Order order = brokerageAccountRepository.findOrder(orderId);
        checkAccountAuthorization(
                getUser(username),
                order.getAccount().getId(),
                BrokerageAccountPermission.Trade);
       
        // Cancel order
        order.pendingCancel(orderEventPublisher);
        exchangeTradingService.cancelOrder(order);
    }
View Full Code Here

TOP

Related Classes of org.archfirst.bfoms.domain.account.brokerage.order.Order

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.