Beispiel #1
0
 public NewOrderResponse ExecuteOrder(OrderSymbol symbol, decimal amount, decimal price, OrderExchange exchange, OrderSide side, OrderType type)
 {
     NewOrderRequest req = new NewOrderRequest(Nonce, symbol, amount, price, exchange, side, type);
     string response = SendRequest(req,"POST");
     NewOrderResponse resp = NewOrderResponse.FromJSON(response);
     return resp;
 }
 //public bool is_hidden=false;
 public NewOrderRequest(string nonce, OrderSymbol symbol, decimal amount, decimal price, OrderExchange exchange, OrderSide side, OrderType type)
 {
     this.symbol   = EnumHelper.EnumToStr(symbol);
     this.amount   = amount.ToString(CultureInfo.InvariantCulture);
     this.price    = price.ToString(CultureInfo.InvariantCulture);
     this.exchange = EnumHelper.EnumToStr(exchange);
     this.side     = EnumHelper.EnumToStr(side);
     this.type     = EnumHelper.EnumToStr(type);
     this.nonce    = nonce;
     this.request  = "/v1/order/new";
 }
Beispiel #3
0
        public async Task <NewOrderResponse> ExecuteOrder(decimal amount, decimal price, OrderExchange exchange, OrderSymbol symbol, OrderSide side, OrderType type)
        {
            NewOrderRequest req      = new NewOrderRequest(Nonce, symbol, amount, price, exchange, side, type);
            string          response = await SendRequestAsync(req, "POST");

            NewOrderResponse resp = NewOrderResponse.FromJSON(response);

            return(resp);
        }
Beispiel #4
0
 public async Task <NewOrderResponse> ExecuteSellOrderAsync(decimal amount, decimal price, OrderExchange exchange, OrderSymbol symbol, OrderType type)
 {
     return(await ExecuteOrder(amount, price, exchange, symbol, OrderSide.Sell, type));
 }
Beispiel #5
0
 //public bool is_hidden=false;
 public NewOrderRequest(string nonce, OrderSymbol symbol, decimal amount, decimal price, OrderExchange exchange, OrderSide side, OrderType type)
 {
     this.symbol = EnumHelper.EnumToStr(symbol);
     this.amount = amount.ToString(CultureInfo.InvariantCulture);
     this.price = price.ToString(CultureInfo.InvariantCulture);
     this.exchange = EnumHelper.EnumToStr(exchange);
     this.side = EnumHelper.EnumToStr(side);
     this.type = EnumHelper.EnumToStr(type);
     this.nonce = nonce;
     this.request = "/v1/order/new";
 }
Beispiel #6
0
 public NewOrderResponse ExecuteSellOrderBTC(decimal amount, decimal price, OrderExchange exchange, OrderType type)
 {
     return ExecuteOrder(OrderSymbol.BTCUSD, amount, price, exchange, OrderSide.Sell, type);
 }
Beispiel #7
0
        public NewOrderResponse ExecuteOrder(string symbol, decimal amount, decimal price, OrderExchange exchange, OrderSide side, OrderType type)
        {
            NewOrderRequest  req      = new NewOrderRequest(Nonce, symbol, amount, price, exchange, side, type);
            string           response = SendRequest(req, "POST");
            NewOrderResponse resp     = NewOrderResponse.FromJSON(response);

            return(resp);
        }
Beispiel #8
0
 public NewOrderResponse ExecuteSellOrderBTC(decimal amount, decimal price, OrderExchange exchange, OrderType type)
 {
     return(ExecuteOrder(OrderSymbol.BTCUSD, amount, price, exchange, OrderSide.Sell, type));
 }
Beispiel #9
0
 public NewOrderResponse ExecuteBuyOrderETH(decimal amount, decimal price, OrderExchange exchange, OrderType type)
 {
     return(ExecuteOrder(OrderSymbol.ETHUSD, amount, price, exchange, OrderSide.Buy, type));
 }
Beispiel #10
0
 public NewOrderResponse ExecuteSellOrder(string pair, decimal amount, decimal price, OrderExchange exchange, OrderType type)
 {
     return(ExecuteOrder(pair, amount, price, exchange, OrderSide.Sell, type));
 }