public KrakenOrder CreateOpeningOrder(OrderType type, KrakenOrderType orderType, decimal enteringPrice, decimal volume, string pair = "XXBTZEUR", bool viqc = false, bool validateOnly = false) { KrakenOrder order = new KrakenOrder(); order.Pair = pair; order.Type = type.ToString(); order.OrderType = orderType.ToString().Replace("_", "-"); order.Price = enteringPrice; order.Volume = volume; if (viqc) { order.OFlags = OFlag.viqc.ToString(); } order.Validate = validateOnly; return(order); }
public KrakenOrder CreateOpeningOrder2(OrderType type, KrakenOrderType orderType, decimal enteringPrice, decimal volume, decimal stopPrice, string pair = "XXBTZEUR", bool viqc = false, bool validateOnly = false) { KrakenOrder order = new KrakenOrder(); order.Pair = pair; order.Type = type.ToString(); order.OrderType = orderType.ToString().Replace("_", "-"); order.Price = enteringPrice; order.Volume = volume; if (viqc) { order.OFlags = OFlag.viqc.ToString(); } order.Validate = validateOnly; var closeDictionary = new Dictionary <string, string>(); closeDictionary.Add("ordertype", "stop-loss"); closeDictionary.Add("price", stopPrice.ToString()); closeDictionary.Add("price2", null); order.Close = closeDictionary; return(order); }