public EntityResponse <List <IntradayOptionOrderBasicInformation> > GetCancellableOrders(IntradayOptionOrderArguments intradayOrderArguments) { List <SZKingdomArgument> arguments = new List <SZKingdomArgument>(); if (intradayOrderArguments.CustomerCode == null && intradayOrderArguments.CustomerAccountCode == null) { EntityResponse <List <IntradayOptionOrderBasicInformation> > entityRespose = EntityResponse <List <IntradayOptionOrderBasicInformation> > .Error(ErrorCode.SZKingdomLibraryError, SameCodesErrorMessage); return(entityRespose); } arguments.Add(SZKingdomArgument.CustomerCode(intradayOrderArguments.CustomerCode)); arguments.Add(SZKingdomArgument.CustomerAccountCode(intradayOrderArguments.CustomerAccountCode)); arguments.Add(SZKingdomArgument.StockBoard(intradayOrderArguments.StockBoard)); arguments.Add(SZKingdomArgument.TradeAccount(intradayOrderArguments.TradeAccount)); arguments.Add(SZKingdomArgument.OptionNumber(intradayOrderArguments.OptionNumber)); arguments.Add(SZKingdomArgument.OptionUnderlyingCode(intradayOrderArguments.OptionUnderlyingCode)); arguments.Add(SZKingdomArgument.OrderId(intradayOrderArguments.OrderId)); arguments.Add(SZKingdomArgument.QueryPosition(intradayOrderArguments.QueryPosition)); EntityResponse <List <IntradayOptionOrderBasicInformation> > result = _marketDataLibrary .ExecuteCommandList <IntradayOptionOrderBasicInformation>(SZKingdomRequest.CancelableOptionOrders, arguments); return(result); }
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 BaseResponse CancelOptionOrder(OptionOrderCancellationArguments cancellationArguments) { List <SZKingdomArgument> arguments = new List <SZKingdomArgument>(); arguments.Add(SZKingdomArgument.CustomerAccountCode(cancellationArguments.CustomerAccountCode)); arguments.Add(SZKingdomArgument.StockBoard(cancellationArguments.StockBoard.ToString())); arguments.Add(SZKingdomArgument.InternalOrganization(cancellationArguments.InternalOrganization)); arguments.Add(SZKingdomArgument.OrderId(cancellationArguments.OrderId)); arguments.Add(SZKingdomArgument.OrderBatchSerialNo(cancellationArguments.OrderBatchSerialNo)); if (string.IsNullOrWhiteSpace(cancellationArguments.OrderId) && cancellationArguments.OrderBatchSerialNo == null) { EntityResponse <OptionOrderCancellationInformation> entityResponse = EntityResponse <OptionOrderCancellationInformation> .Error(ErrorCode.SZKingdomLibraryError, "Order Id and Order BSN cannot be empty at the same time"); return(entityResponse); } BaseResponse result = _marketDataLibrary.ExecuteCommand(SZKingdomRequest.CancelOptionOrder, arguments); return(result); }