public List <HistoricalOptionOrderInformation> GetHistoricalOptionOrders(string accountCode, string beginDate = null, string endDate = null) { HistoricalOptionOrdersArguments arguments = new HistoricalOptionOrdersArguments { CustomerAccountCode = accountCode }; return(_orderManager.GetHistoricalOptionOrders(arguments)); }
public List <HistoricalOrderViewModel> GetHistoricalOptionOrders(string beginDate, string endDate) { DateTime begin, end; bool success = DateTime.TryParseExact(beginDate, SZKingdomDateFormat, null, DateTimeStyles.None, out begin); success &= DateTime.TryParseExact(endDate, SZKingdomDateFormat, null, DateTimeStyles.None, out end); if (!success) { return(null); } HistoricalOptionOrdersArguments arguments = new HistoricalOptionOrdersArguments { CustomerAccountCode = FCIdentity.CustomerAccountCode, BeginDate = begin, EndDate = end }; List <HistoricalOptionOrderInformation> results = _orderManager.GetHistoricalOptionOrders(arguments); return(Mapper.Map <List <HistoricalOrderViewModel> >(results)); }
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); }