コード例 #1
0
ファイル: Routes.cs プロジェクト: Domer79/CIAPI.CS
        // ***********************************
        // UpdateOrder
        // ***********************************


        /// <summary>
        /// Update an order *(for adding a stop/limit or attaching an OCO relationship)*.
        /// </summary>
        /// <param name="order">The update order request.</param>
        public virtual ApiTradeOrderResponseDTO UpdateOrder(UpdateStopLimitOrderRequestDTO order)
        {
            string uriTemplate = "/updatestoplimitorder";
            return _client.Request<ApiTradeOrderResponseDTO>(RequestMethod.POST,"order", uriTemplate ,
            new Dictionary<string, object>
            {
                { "order", order}
            },ContentType.JSON,ContentType.JSON, TimeSpan.FromMilliseconds(0),30000,0 );
        }
コード例 #2
0
ファイル: Routes.cs プロジェクト: Domer79/CIAPI.CS
 /// <summary>
 /// Update an order *(for adding a stop/limit or attaching an OCO relationship)*.
 /// </summary>
 /// <param name="order">The update order request.</param>
 /// <param name="callback"></param>
 /// <param name="state"></param>
 public virtual void BeginUpdateOrder(UpdateStopLimitOrderRequestDTO order, ReliableAsyncCallback callback, object state)
 {
     string uriTemplate = "/updatestoplimitorder";
     _client.BeginRequest(RequestMethod.POST, "order", uriTemplate , 
     new Dictionary<string, object>
     {
         { "order", order}
     },ContentType.JSON,ContentType.JSON, TimeSpan.FromMilliseconds(0), 30000,0 ,callback, state);
 }
コード例 #3
0
 // ***********************************
 // UpdateOrder
 // ***********************************
 /// <summary>
 /// <p>Update an order (for adding a stop/limit or attaching an OCO relationship). Post an <a onclick="dojo.hash('#type.UpdateStopLimitOrderRequestDTO'); return false;" class="json-link" href="#">UpdateStopLimitOrderRequestDTO</a> to the uri specified below</p>
 /// </summary>
 /// <param name="order"><p>Update an order (for adding a stop/limit or attaching an OCO relationship).  Post an <a onclick="dojo.hash('#type.UpdateStopLimitOrderRequestDTO'); return false;" class="json-link" href="#">UpdateStopLimitOrderRequestDTO</a> to the uri specified below</p></param>
 public ApiTradeOrderResponseDTO UpdateOrder(UpdateStopLimitOrderRequestDTO order)
 {
     return Request<ApiTradeOrderResponseDTO>("order", "/updatestoplimitorder", "POST",
     new Dictionary<string, object>
     {
         { "order", order}
     }, TimeSpan.FromMilliseconds(0), "default");
 }
コード例 #4
0
 /// <summary>
 /// <p>Update an order (for adding a stop/limit or attaching an OCO relationship). Post an <a onclick="dojo.hash('#type.UpdateStopLimitOrderRequestDTO'); return false;" class="json-link" href="#">UpdateStopLimitOrderRequestDTO</a> to the uri specified below</p>
 /// </summary>
 /// <param name="order"><p>Update an order (for adding a stop/limit or attaching an OCO relationship).  Post an <a onclick="dojo.hash('#type.UpdateStopLimitOrderRequestDTO'); return false;" class="json-link" href="#">UpdateStopLimitOrderRequestDTO</a> to the uri specified below</p></param>
 /// <param name="callback"></param>
 /// <param name="state"></param>
 public void BeginUpdateOrder(UpdateStopLimitOrderRequestDTO order, ApiAsyncCallback<ApiTradeOrderResponseDTO> callback, object state)
 {
     BeginRequest(callback, state, "order", "/updatestoplimitorder", "POST",
     new Dictionary<string, object>
     {
         { "order", order}
     }, TimeSpan.FromMilliseconds(0), "default");
 }
コード例 #5
0
 public void CanUpdateOrder()
 {
     var update = new UpdateStopLimitOrderRequestDTO();
     var response = _rpcClient.TradesAndOrders.UpdateOrder(update);
 }
コード例 #6
0
        public void CanUpdateOrder()
        {
            var rpcClient = BuildRpcClient();

            AccountInformationResponseDTO accounts = rpcClient.AccountInformation.GetClientAndTradingAccount();
            UpdateStopLimitOrderRequestDTO update = new UpdateStopLimitOrderRequestDTO();
            var response = rpcClient.TradesAndOrders.UpdateOrder(update);
        }
コード例 #7
0
ファイル: Example.cs プロジェクト: fandrei/SimpleCiapiTest
        public void TestUpdateOrder()
        {
            var accountInfo = _client.AccountInformation.GetClientAndTradingAccount();
            var openPositions = _client.TradesAndOrders.ListOpenPositions(accountInfo.SpreadBettingAccount.TradingAccountId);
            var stopLimitOrders = _client.TradesAndOrders.ListActiveStopLimitOrders(accountInfo.SpreadBettingAccount.TradingAccountId);

            const int orderId = 472307456;
            var order = _client.TradesAndOrders.GetActiveStopLimitOrder(orderId.ToString()).ActiveStopLimitOrder;

            var request = new UpdateStopLimitOrderRequestDTO
            {
                OrderId = orderId,
                TradingAccountId = (int)order.TradingAccountId,
                Direction = order.Direction,
                MarketId = order.MarketId,
                Quantity = order.Quantity,
                OfferPrice = order.TriggerPrice * 0.9M,
                TriggerPrice = order.TriggerPrice,
                BidPrice = order.TriggerPrice * 1.1M,
            };
            request.IfDone = new[]
                             	{
                             		new ApiIfDoneDTO
                             			{
                             				Limit = new ApiStopLimitOrderDTO { TriggerPrice = order.TriggerPrice * 0.9M, },
                                            Stop = new ApiStopLimitOrderDTO { TriggerPrice = order.TriggerPrice * 1.1M, }
                             			}
                             	};

            var resp = _client.TradesAndOrders.UpdateOrder(request);
            _client.MagicNumberResolver.ResolveMagicNumbers(resp);

            var order2 = _client.TradesAndOrders.GetActiveStopLimitOrder(orderId.ToString()).ActiveStopLimitOrder;
        }