Esempio n. 1
0
        private async Task <OrderResponse> NewMarketOrder(string side, string symbol, decimal quantity)
        {
            var timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();

            string totalParams = string.Format("symbol={0}&side={1}&type={2}&quantity={3}&timestamp={4}", symbol, side, "MARKET", quantity, timestamp);
            string sign        = CalculateSignature(totalParams, _config.Secret);

            var data = new Dictionary <string, object> {
                { "symbol", symbol },
                { "side", side },
                { "type", "MARKET" },
                { "quantity", quantity },
                { "timestamp", timestamp },
                { "signature", sign }
            };

            return(await _binance.NewOrder(_config.ApiKey, data));
        }