Exemplo n.º 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);
        }