示例#1
0
        public EntityResponse <List <HistoricalOptionTradeInformation> > GetHistoricalOptionTrades(HistoricalOptionOrdersArguments historicalOrderArguments)
        {
            List <SZKingdomArgument> arguments = new List <SZKingdomArgument>();

            if (historicalOrderArguments.CustomerCode == null && historicalOrderArguments.CustomerAccountCode == null)
            {
                EntityResponse <List <HistoricalOptionTradeInformation> > entityResponse = EntityResponse <List <HistoricalOptionTradeInformation> >
                                                                                           .Error(ErrorCode.SZKingdomLibraryError, SameCodesErrorMessage);

                return(entityResponse);
            }

            arguments.Add(SZKingdomArgument.CustomerCode(historicalOrderArguments.CustomerCode));
            arguments.Add(SZKingdomArgument.CustomerAccountCode(historicalOrderArguments.CustomerAccountCode));
            arguments.Add(SZKingdomArgument.StockBoard(historicalOrderArguments.StockBoard));
            arguments.Add(SZKingdomArgument.TradeAccount(historicalOrderArguments.TradeAccount));
            arguments.Add(SZKingdomArgument.OptionNumber(historicalOrderArguments.OptionNumber));
            arguments.Add(SZKingdomArgument.OptionUnderlyingCode(historicalOrderArguments.OptionUnderlyingCode));
            arguments.Add(SZKingdomArgument.OrderId(historicalOrderArguments.OrderId));
            arguments.Add(SZKingdomArgument.OrderBatchSerialNo(historicalOrderArguments.OrderBatchSerialNo));
            arguments.Add(SZKingdomArgument.BeginDate(historicalOrderArguments.BeginDate.ToString(SZKingdomMappingHelper.SZKingdomDateFormat)));
            arguments.Add(SZKingdomArgument.EndDate(historicalOrderArguments.EndDate.ToString(SZKingdomMappingHelper.SZKingdomDateFormat)));
            arguments.Add(SZKingdomArgument.PageNumber(historicalOrderArguments.PageNumber));
            arguments.Add(SZKingdomArgument.PageRecordCount(historicalOrderArguments.PageRecordCount));

            EntityResponse <List <HistoricalOptionTradeInformation> > result = _marketDataLibrary
                                                                               .ExecuteCommandList <HistoricalOptionTradeInformation>(SZKingdomRequest.HistoricalOptionTrades, arguments);

            return(result);
        }
        public EntityResponse <List <HistoricalFundTransfer> > GetHistoricalTransferFund(string customerAccountCode, string BeginDate, string EndDate, int qryPos, int qryNum)
        {
            var arguments = new List <SZKingdomArgument>();

            arguments.Add(SZKingdomArgument.CustomerAccountCode(customerAccountCode));
            arguments.Add(SZKingdomArgument.BeginDate(BeginDate));
            arguments.Add(SZKingdomArgument.EndDate(EndDate));
            arguments.Add(SZKingdomArgument.QueryNumer(qryNum));
            arguments.Add(SZKingdomArgument.QueryPosition(qryPos));


            EntityResponse <List <HistoricalFundTransfer> > results = _marketDataLibrary.ExecuteCommandList <HistoricalFundTransfer>(SZKingdomRequest.HistoricalFundTransfer, arguments);

            if (results.IsSuccess)
            {
                if (results.Entity.Count >= 1)
                {
                    List <HistoricalFundTransfer> resultList = (List <HistoricalFundTransfer>)results.Entity.OrderBy(u => u.OccurTime); // order by OccurTime to show

                    return(resultList);
                }
                return(EntityResponse <List <HistoricalFundTransfer> > .Error(ErrorCode.AuthenticationIncorrectIdentity, string.Format(ErrorMessages.InvalidDateRange, BeginDate, EndDate)));
            }
            return(EntityResponse <List <HistoricalFundTransfer> > .Error(results));
        }
示例#3
0
        public EntityResponse <List <AssignableHistoricalExerciseDetail> > AssignableHistoricalExerciseDetail(AssignableHistoricalExerciseDetailArguments assignableHistoricalExerciseDetailArguments)
        {
            List <SZKingdomArgument> arguments = new List <SZKingdomArgument>();

            arguments.Add(SZKingdomArgument.CustomerCode(assignableHistoricalExerciseDetailArguments.CustomerCode));
            arguments.Add(SZKingdomArgument.CustomerAccountCode(assignableHistoricalExerciseDetailArguments.CustomerAccountCode));
            arguments.Add(SZKingdomArgument.Currency(assignableHistoricalExerciseDetailArguments.Currency));
            arguments.Add(SZKingdomArgument.StockBoard(assignableHistoricalExerciseDetailArguments.StockBoard));

            arguments.Add(SZKingdomArgument.TradeAccount(assignableHistoricalExerciseDetailArguments.TradeAccount));
            arguments.Add(SZKingdomArgument.OptionNumber(assignableHistoricalExerciseDetailArguments.OptionNumber));
            arguments.Add(SZKingdomArgument.OptionUnderlyingCode(assignableHistoricalExerciseDetailArguments.OptionUnderlyingCode));
            arguments.Add(SZKingdomArgument.OptionType(assignableHistoricalExerciseDetailArguments.OptionType));
            arguments.Add(SZKingdomArgument.OptionCoveredFlag(assignableHistoricalExerciseDetailArguments.OptionCoveredFlag));
            arguments.Add(SZKingdomArgument.ExerciseSide(assignableHistoricalExerciseDetailArguments.ExerciseSide));
            arguments.Add(SZKingdomArgument.QueryPosition(assignableHistoricalExerciseDetailArguments.QueryPosition));
            arguments.Add(SZKingdomArgument.QueryNumer(assignableHistoricalExerciseDetailArguments.QueryNumer));
            arguments.Add(SZKingdomArgument.BeginDate(assignableHistoricalExerciseDetailArguments.BeginDate.ToString(SZKingdomMappingHelper.SZKingdomDateFormat)));
            arguments.Add(SZKingdomArgument.EndDate(assignableHistoricalExerciseDetailArguments.EndDate.ToString(SZKingdomMappingHelper.SZKingdomDateFormat)));
            //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 <List <AssignableHistoricalExerciseDetail> > result =
                _marketDataLibrary.ExecuteCommandList <AssignableHistoricalExerciseDetail>(SZKingdomRequest.AssignableHistoricalExerciseDetail, arguments);

            return(result);
        }