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()); }
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)); } }
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)); } }
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()}"); }