コード例 #1
0
        private static OrderStatus ToModel(Domain.InternalOrderStatus internalOrderStatus)
        {
            switch (internalOrderStatus)
            {
            case Domain.InternalOrderStatus.New:
            case Domain.InternalOrderStatus.Reserved:
            case Domain.InternalOrderStatus.Executed:
            case Domain.InternalOrderStatus.Transferred:
            case Domain.InternalOrderStatus.Failed:
                return(OrderStatus.InProgress);

            case Domain.InternalOrderStatus.Rejected:
            case Domain.InternalOrderStatus.Cancelled:
                return(OrderStatus.Reject);

            case Domain.InternalOrderStatus.Completed:
                return(OrderStatus.Done);

            default:
                throw new InvalidEnumArgumentException(nameof(internalOrderStatus), (int)internalOrderStatus,
                                                       typeof(Domain.InternalOrderStatus));
            }
        }
コード例 #2
0
        private static Common.ExchangeAdapter.SpotController.Records.OrderStatus ToSpotModel(
            Domain.InternalOrderStatus internalOrderStatus)
        {
            switch (internalOrderStatus)
            {
            case Domain.InternalOrderStatus.New:
            case Domain.InternalOrderStatus.Reserved:
            case Domain.InternalOrderStatus.Executed:
            case Domain.InternalOrderStatus.Transferred:
            case Domain.InternalOrderStatus.Failed:
                return(Common.ExchangeAdapter.SpotController.Records.OrderStatus.Active);

            case Domain.InternalOrderStatus.Rejected:
            case Domain.InternalOrderStatus.Cancelled:
                return(Common.ExchangeAdapter.SpotController.Records.OrderStatus.Canceled);

            case Domain.InternalOrderStatus.Completed:
                return(Common.ExchangeAdapter.SpotController.Records.OrderStatus.Fill);

            default:
                throw new InvalidEnumArgumentException(nameof(internalOrderStatus), (int)internalOrderStatus,
                                                       typeof(Domain.InternalOrderStatus));
            }
        }