コード例 #1
0
ファイル: GDAXBrokerage.Utility.cs プロジェクト: denalta/Lean
        private static string ConvertOrderType(Orders.OrderType orderType)
        {
            if (orderType == Orders.OrderType.Limit || orderType == Orders.OrderType.Market)
            {
                return(orderType.ToString().ToLower());
            }
            else if (orderType == Orders.OrderType.StopMarket)
            {
                return("stop");
            }

            throw new Exception("GDAXBrokerage.ConvertOrderType: Unsupported order type:" + orderType.ToString());
        }
コード例 #2
0
        public string ConvertToTimeInForce(Orders.OrderType orderType)
        {
            switch (orderType)
            {
            case QuantConnect.Orders.OrderType.Market:
                return(CashDefinition.TIF_IOC);

            case QuantConnect.Orders.OrderType.Limit:
                return(CashDefinition.TIF_DAY);

            default:
                throw new InvalidEnumArgumentException("order.OrderType", (int)orderType, typeof(Orders.OrderType));
            }
        }
コード例 #3
0
        public string ConvertToOrdType(Orders.OrderType orderType)
        {
            switch (orderType)
            {
            case QuantConnect.Orders.OrderType.Market:
                return(CashDefinition.ORDTYPE_MARKET);

            case QuantConnect.Orders.OrderType.Limit:
                return(CashDefinition.ORDTYPE_LIMIT);

            default:
                throw new InvalidEnumArgumentException("order.OrderType", (int)orderType, typeof(Orders.OrderType));
            }
        }
コード例 #4
0
        private static string ConvertOrderType(Orders.OrderType orderType)
        {
            if (orderType == Orders.OrderType.Limit || orderType == Orders.OrderType.Market)
            {
                return(orderType.ToLower());
            }
            else if (orderType == Orders.OrderType.StopMarket)
            {
                return("stop");
            }
            else if (orderType == Orders.OrderType.StopLimit)
            {
                return("limit");
            }

            throw new NotSupportedException($"GDAXBrokerage.ConvertOrderType: Unsupported order type:{orderType.ToStringInvariant()}");
        }