public EntityResponse SetAutomaticOptionExercisingParameters(CustomerAutomaticOptionExercisingInformation information)
        {
            if (string.IsNullOrWhiteSpace(information.CustomerAccountCode))
            {
                return(EntityResponse <List <CustomerAutomaticOptionExercisingInformation> > .Error(
                           ErrorCode.SZKingdomLibraryError,
                           ErrorMessages.SZKingdom_CustomerCodeEmpty));
            }

            List <SZKingdomArgument> arguments = new List <SZKingdomArgument>();

            arguments.Add(SZKingdomArgument.CustomerCode(information.CustomerCode));
            arguments.Add(SZKingdomArgument.CustomerAccountCode(information.CustomerAccountCode));
            arguments.Add(SZKingdomArgument.StockBoard(information.TradeSector));
            arguments.Add(SZKingdomArgument.TradeAccount(information.TradingAccount));

            arguments.Add(SZKingdomArgument.ExercisingQuantity(information.ExercisingQuantity));
            arguments.Add(SZKingdomArgument.AutomaticExerciseControl(information.AutomaticExcerciseControl));
            arguments.Add(SZKingdomArgument.ExercisingStrategyType(information.ExercisingStrategyType));
            arguments.Add(SZKingdomArgument.ExercisingStrategyValue(information.ExercisingStrategyValue));
            arguments.Add(SZKingdomArgument.OptionNumber(information.ContractNumber));
            arguments.Add(SZKingdomArgument.Remark(information.Remark));

            EntityResponse result =
                _marketDataLibrary.ExecuteCommand(SZKingdomRequest.SetAutomaticOptionExercisingParameters, arguments);

            return(result);
        }
Exemple #2
0
        public void SetCustomerAutomaticOptionExercisingInformation(string customerCode, string customerAccountCode, string tradeSector, CustomerAutomaticOptionExercisingViewModel viewModel)
        {
            CustomerAutomaticOptionExercisingInformation information = Mapper.Map <CustomerAutomaticOptionExercisingViewModel, CustomerAutomaticOptionExercisingInformation>(viewModel);

            information.CustomerCode        = customerCode;
            information.CustomerAccountCode = customerAccountCode;
            information.TradeSector         = tradeSector;
            information.TradingAccount      = DefaultTradeSector;

            _portfolioManager.SetAutomaticOptionExercisingParameters(information);
        }