コード例 #1
0
        /// <summary>
        /// Place new margin order async
        /// </summary>
        /// <returns>Order</returns>
        public async Task <CallResult <HitBTCOrder> > PlaceMarginOrderAsync(
            string clientOrderId,
            string symbol,
            HitBTCSide side,
            HitBTCOrderType type,
            decimal price,
            decimal quantity,
            decimal stopPrice,
            HitBTCTimeInForce timeInForce = HitBTCTimeInForce.GTC
            )
        {
            var request = new PlaceMarginOrderRequest(
                NextId(),
                clientOrderId,
                symbol,
                side,
                type,
                price,
                quantity,
                stopPrice
                );

            var result = await Query <HitBTCSocketResponse <HitBTCOrder> >(request, true).ConfigureAwait(false);

            return(new CallResult <HitBTCOrder>(result.Data?.Result, result.Error));
        }
コード例 #2
0
 /// <summary>
 /// Place new margin order
 /// </summary>
 /// <returns>Order</returns>
 public CallResult <HitBTCOrder> PlaceMarginOrder(
     string clientOrderId,
     string symbol,
     HitBTCSide side,
     HitBTCOrderType type,
     decimal price,
     decimal quantity,
     decimal stopPrice,
     HitBTCTimeInForce timeInForce = HitBTCTimeInForce.GTC
     ) => PlaceMarginOrderAsync(
     clientOrderId,
     symbol,
     side,
     type,
     price,
     quantity,
     stopPrice,
     timeInForce
     ).Result;
コード例 #3
0
 public PlaceOrderRequest(
     int id,
     string clientOrderId,
     string symbol,
     HitBTCSide side,
     HitBTCOrderType type,
     decimal price,
     decimal quantity,
     decimal stopPrice             = -1,
     HitBTCTimeInForce timeInForce = HitBTCTimeInForce.GTC,
     bool strictValidate           = true
     ) : base(id, "newOrder")
 {
     this.AddParameter("clientOrderId", clientOrderId);
     this.AddParameter("symbol", symbol);
     this.AddParameter("side", side.ToString().ToLower());
     this.AddParameter("type", type.ToString().ToLower());
     this.AddParameter("price", price);
     this.AddParameter("quantity", quantity);
     this.AddParameter("stopPrice", stopPrice);
     this.AddParameter("timeInForce", timeInForce.ToString());
     this.AddParameter("strictValidate", strictValidate);
 }