예제 #1
0
        private async Task MarketOrderAsync()
        {
            await _wsClient.NewMarketOrderAsync(CommonFuncs.NewClOrdId("market-order"), "BTC/USDT", Side.Sell, 0.01M, SpotAccountId).ConfigureAwait(false);

            var command = OrderExtensions.NewMarketOrder(CommonFuncs.NewClOrdId("market-order"), "BTC/USDT", Side.Sell, 0.01M, SpotAccountId);
            await _wsClient.SendCommandAsync(command).ConfigureAwait(false);
        }
예제 #2
0
        /// <inheritdoc />
        public async Task NewMarketOrderAsync(
            string clOrdId,
            string symbol,
            string side,
            decimal orderQty,
            ulong account,
            string timeInForce      = null,
            string[] execInst       = null,
            ulong positionId        = 0,
            decimal stopLossPrice   = 0,
            decimal takeProfitPrice = 0,
            string text             = null,
            string groupId          = null)
        {
            var command = OrderExtensions.NewMarketOrder(
                clOrdId,
                symbol,
                side,
                orderQty,
                account,
                timeInForce,
                execInst,
                positionId,
                stopLossPrice,
                takeProfitPrice,
                text,
                groupId);

            await SendCommandAsync(command).ConfigureAwait(false);
        }
예제 #3
0
        /// <inheritdoc />
        public async Task <ExecutionReport> NewMarketOrderAsync(
            string clOrdId,
            string symbol,
            string side,
            decimal orderQty,
            ulong account,
            string timeInForce                  = null,
            string[] execInst                   = null,
            ulong positionId                    = 0,
            decimal stopLossPrice               = 0,
            decimal takeProfitPrice             = 0,
            string text                         = null,
            string groupId                      = null,
            CancellationToken cancellationToken = default)
        {
            var command = OrderExtensions.NewMarketOrder(
                clOrdId,
                symbol,
                side,
                orderQty,
                account,
                timeInForce,
                execInst,
                positionId,
                stopLossPrice,
                takeProfitPrice,
                text,
                groupId);

            return(await NewOrderAsync(command, cancellationToken).ConfigureAwait(false));
        }