public OrderParams(EOrderSide side, EOrderType type, ETimeInForce tif, decimal amount_base, decimal?price_q2b, decimal?stop_price) { Side = side; Type = type; TimeInForce = tif; AmountBase = amount_base; PriceQ2B = price_q2b; StopPriceQ2B = stop_price; IcebergAmountBase = null; }
public static string ToString(EOrderSide order_type) { switch (order_type) { default: throw new Exception($"Unknown order type: {order_type}"); case EOrderSide.Buy: return("buylimit"); case EOrderSide.Sell: return("selllimit"); } }
public static string ToString(EOrderSide order_type) { switch (order_type) { default: throw new ArgumentException("order_type"); case EOrderSide.Buy: return("buy"); case EOrderSide.Sell: return("sell"); } }
/// <summary>Create an order to buy/sell. Returns a unique order ID</summary> public async Task <TradeResult> SubmitTrade(CurrencyPair pair, EOrderSide type, decimal price_q2b, decimal amount_base, CancellationToken?cancel = null) { var jtok = await PostData(Method.Account, Conv.ToString(type), cancel, new Params { { "currencyPair", pair.Id }, { "rate", price_q2b }, { "amount", amount_base }, }); return(ParseJsonReply <TradeResult>(jtok)); }
/// <summary>Create an order to buy/sell. Returns a unique order ID</summary> public async Task <TradeResult> SubmitTrade(CurrencyPair pair, EOrderSide type, decimal price_q2b, decimal amount_base, CancellationToken?cancel = null) { // https://api.bittrex.com/api/v1.1/market/selllimit?apikey=API_KEY&market=BTC-LTC&quantity=1.2&rate=1.3 // https://api.bittrex.com/api/v1.1/market/buylimit?apikey=API_KEY&market=BTC-LTC&quantity=1.2&rate=1.3 var jtok = await GetData(Method.Market, Conv.ToString(type), cancel, new Params { { "market", pair.Id }, { "rate", price_q2b }, { "quantity", amount_base }, }); return(ParseJsonReply <TradeResult>(jtok)); }
/// <summary></summary> private static List <Offer> ParseOffers(List <string[]> offers, EOrderSide order_type) { var output = new List <Offer>(offers.Count); foreach (var order in offers) { output.Add(new Offer( order_type, decimal.Parse(order[0], CultureInfo.InvariantCulture), decimal.Parse(order[1], CultureInfo.InvariantCulture))); } return(output); }
public static long ToOrderSide(EOrderSide orderSide) { switch (orderSide) { case EOrderSide.Buy: return(Buy); case EOrderSide.Sell: return(Sell); default: throw new BinanceDexException($"Unhandled orderSide: {orderSide}"); } }
internal Order(EOrderSide order_type, decimal price, decimal volume) { Type = order_type; PriceQ2B = price; AmountBase = volume; }
internal Offer(EOrderSide type, decimal price, decimal volume) { Type = type; Price = price; AmountBase = volume; }
public OrderParams(EOrderSide side, EOrderType type, ETimeInForce tif = ETimeInForce.GTC) : this(side, type, tif, 0, null, null) { }