public List <OptionOrderViewModel> PostOptionOrder(OptionOrderTicketViewModel[] orderTickets)
        {
            List <OptionOrderViewModel> results = new List <OptionOrderViewModel>();

            foreach (OptionOrderTicketViewModel orderTicket in orderTickets)
            {
                OptionOrderArguments orderArguments = new OptionOrderArguments
                {
                    CustomerAccountCode = FCIdentity.CustomerAccountCode,
                    TradeAccount        = FCIdentity.TradeAccount,
                    OptionNumber        = orderTicket.OptionNumber,
                    SecurityCode        = orderTicket.SecurityCode ?? orderTicket.UnderlyingCode,
                    StockBusiness       = StockBusiness.Parse(orderTicket.StockBusiness),
                    StockBusinessAction = StockBusinessAction.Parse(orderTicket.OrderType),
                    OrderQuantity       = orderTicket.OrderQuantity,
                    OrderPrice          = orderTicket.OrderPrice,
                    Password            = FCUser.Password
                };

                OptionOrderInformation order = _orderManager.SubmitOptionOrder(orderArguments);

                OptionOrderViewModel result = Mapper.Map <OptionOrderInformation, OptionOrderViewModel>(order);
                results.Add(result);
            }
            return(results);
        }
Example #2
0
        public OptionOrderInformation ExerciseOptionPosition(OptionOrderTicketViewModel orderTicket)
        {
            OptionOrderArguments orderArguments = new OptionOrderArguments
            {
                CustomerAccountCode = orderTicket.AccountCode,
                TradeAccount        = orderTicket.TradeAccount,
                OptionNumber        = orderTicket.OptionNumber,
                OrderQuantity       = orderTicket.OrderQuantity,
                StockBusiness       = StockBusiness.Parse(orderTicket.StockBusiness),
                StockBusinessAction = StockBusinessAction.OrderDeclaration,
                Password            = orderTicket.Password,
                ClientInfo          = orderTicket.ClientInfo
            };

            OptionOrderInformation result = _orderManager.SubmitOptionOrder(orderArguments);

            return(result);
        }
Example #3
0
        public EntityResponse <OptionOrderInformation> SubmitOptionOrder(OptionOrderArguments orderArguments)
        {
            List <SZKingdomArgument> arguments = new List <SZKingdomArgument>();

            arguments.Add(SZKingdomArgument.CustomerAccountCode(orderArguments.CustomerAccountCode));
            arguments.Add(SZKingdomArgument.StockBoard(orderArguments.StockBoard));
            arguments.Add(SZKingdomArgument.TradeAccount(orderArguments.TradeAccount));
            arguments.Add(SZKingdomArgument.OptionNumber(orderArguments.OptionNumber));
            arguments.Add(SZKingdomArgument.SecurityCode(orderArguments.SecurityCode));
            arguments.Add(SZKingdomArgument.OrderQuantity(orderArguments.OrderQuantity));
            arguments.Add(SZKingdomArgument.StockBusiness(orderArguments.StockBusiness));
            arguments.Add(SZKingdomArgument.StockBusinessAction(orderArguments.StockBusinessAction));
            arguments.Add(SZKingdomArgument.SecurityLevel(orderArguments.SecurityLevel));
            arguments.Add(SZKingdomArgument.OrderPrice(orderArguments.OrderPrice));
            arguments.Add(SZKingdomArgument.CustomerCode(orderArguments.CustomerCode));
            arguments.Add(SZKingdomArgument.TradeUnit(orderArguments.TradeUnit));
            arguments.Add(SZKingdomArgument.OrderBatchSerialNo(orderArguments.OrderBatchSerialNo));
            arguments.Add(SZKingdomArgument.ClientInfo(orderArguments.ClientInfo));
            arguments.Add(SZKingdomArgument.InternalOrganization(orderArguments.InternalOrganization));

            if (orderArguments.SecurityLevel != SecurityLevel.NoSecurity)
            {
                if (!string.IsNullOrWhiteSpace(orderArguments.SecurityInfo))
                {
                    arguments.Add(SZKingdomArgument.SecurityInfo(orderArguments.SecurityInfo));
                }
                else if (!string.IsNullOrWhiteSpace(orderArguments.Password))
                {
                    orderArguments.SecurityInfo = _marketDataLibrary.EncryptPassword(orderArguments.CustomerAccountCode, orderArguments.Password);
                }
                else
                {
                    EntityResponse <OptionOrderInformation> entityResponse = EntityResponse <OptionOrderInformation>
                                                                             .Error(ErrorCode.SZKingdomLibraryError, "No security info");

                    return(entityResponse);
                }
            }

            EntityResponse <OptionOrderInformation> result =
                _marketDataLibrary.ExecuteCommandSingleEntity <OptionOrderInformation>(SZKingdomRequest.OptionOrder, arguments);

            return(result);
        }
Example #4
0
        public OptionOrderInformation PostOptionOrder(OptionOrderTicketViewModel orderTicket)
        {
            OptionOrderArguments orderArguments = new OptionOrderArguments
            {
                CustomerAccountCode = orderTicket.AccountCode,
                TradeAccount        = orderTicket.TradeAccount,
                OptionNumber        = orderTicket.OptionNumber,
                SecurityCode        = orderTicket.UnderlyingCode,
                OrderQuantity       = orderTicket.OrderQuantity,
                OrderPrice          = orderTicket.OrderPrice,
                StockBusiness       = StockBusiness.Parse(orderTicket.StockBusiness),
                StockBusinessAction = StockBusinessAction.Parse(orderTicket.OrderType),
                Password            = orderTicket.Password,
                ClientInfo          = orderTicket.ClientInfo
            };

            OptionOrderInformation result = _orderManager.SubmitOptionOrder(orderArguments);

            return(result);
        }
        public OptionOrderViewModel PostExerciseOptionPosition(OptionOrderTicketViewModel orderTicket)
        {
            OptionOrderArguments orderArguments = new OptionOrderArguments
            {
                CustomerAccountCode = FCIdentity.CustomerAccountCode,
                TradeAccount        = FCIdentity.TradeAccount,
                OptionNumber        = orderTicket.OptionNumber,//11000033
                OrderQuantity       = orderTicket.OrderQuantity,
                StockBusiness       = StockBusiness.Parse(orderTicket.StockBusiness),
                //StockBusiness = StockBusiness.ExerciseCallOption,
                StockBusinessAction  = StockBusinessAction.OrderDeclaration,
                Password             = FCUser.Password,
                InternalOrganization = Convert.ToString(FCUser.InternalOrganization)
            };

            OptionOrderInformation order = _orderManager.SubmitOptionOrder(orderArguments);

            OptionOrderViewModel result = Mapper.Map <OptionOrderInformation, OptionOrderViewModel>(order);

            return(result);
        }
        public OptionOrderViewModel PostOptionOrder(OptionOrderTicketViewModel orderTicket)
        {
            OptionOrderArguments orderArguments = new OptionOrderArguments
            {
                CustomerAccountCode  = FCIdentity.CustomerAccountCode,
                TradeAccount         = FCIdentity.TradeAccount,
                OptionNumber         = orderTicket.OptionNumber,
                SecurityCode         = orderTicket.UnderlyingCode,
                StockBusiness        = StockBusiness.Parse(orderTicket.StockBusiness),
                StockBusinessAction  = StockBusinessAction.Parse(orderTicket.OrderType),
                OrderQuantity        = orderTicket.OrderQuantity,
                OrderPrice           = orderTicket.OrderPrice,
                InternalOrganization = Convert.ToString(FCUser.InternalOrganization),
                Password             = FCUser.Password
            };

            OptionOrderInformation order = _orderManager.SubmitOptionOrder(orderArguments);

            OptionOrderViewModel result = Mapper.Map <OptionOrderInformation, OptionOrderViewModel>(order);

            return(result);
        }