/// <summary> /// Initializes a new instance of the <see cref="UpdateOrderRequest"/> class /// </summary> /// <param name="time">The time the request was submitted</param> /// <param name="orderId">The order id to be updated</param> /// <param name="fields">The fields defining what should be updated</param> public UpdateOrderRequest(DateTime time, int orderId, UpdateOrderFields fields) : base(time, orderId, fields.Tag) { Quantity = fields.Quantity; LimitPrice = fields.LimitPrice; StopPrice = fields.StopPrice; }
/// <summary> /// Submits an <see cref="UpdateOrderRequest"/> with the <see cref="SecurityTransactionManager"/> to update /// the ticket with tag specified in <paramref name="tag"/> /// </summary> /// <param name="tag"></param> /// <returns><see cref="OrderResponse"/> from updating the order</returns> public OrderResponse UpdateTag(string tag) { var fields = new UpdateOrderFields() { Tag = tag }; return(Update(fields)); }
/// <summary> /// Submits an <see cref="UpdateOrderRequest"/> with the <see cref="SecurityTransactionManager"/> to update /// the ticker with stop price specified in <paramref name="stopPrice"/> and with tag specified in <paramref name="tag"/> /// </summary> /// <param name="stopPrice"></param> /// <param name="tag"></param> /// <returns><see cref="OrderResponse"/> from updating the order</returns> public OrderResponse UpdateStopPrice(decimal stopPrice, string tag = null) { var fields = new UpdateOrderFields() { StopPrice = stopPrice, Tag = tag }; return(Update(fields)); }
/// <summary> /// Submits an <see cref="UpdateOrderRequest"/> with the <see cref="SecurityTransactionManager"/> to update /// the ticker with limit price specified in <paramref name="limitPrice"/> and with tag specified in <paramref name="tag"/> /// </summary> /// <param name="limitPrice"></param> /// <param name="tag"></param> /// <returns><see cref="OrderResponse"/> from updating the order</returns> public OrderResponse UpdateLimitPrice(decimal limitPrice, string tag = null) { var fields = new UpdateOrderFields() { LimitPrice = limitPrice, Tag = tag }; return(Update(fields)); }
/// <summary> /// Submits an <see cref="UpdateOrderRequest"/> with the <see cref="SecurityTransactionManager"/> to update /// the ticket with quantity specified in <paramref name="quantity"/> and with tag specified in <paramref name="quantity"/> /// </summary> /// <param name="quantity"></param> /// <param name="tag"></param> /// <returns><see cref="OrderResponse"/> from updating the order</returns> public OrderResponse UpdateQuantity(decimal quantity, string tag = null) { var fields = new UpdateOrderFields() { Quantity = quantity, Tag = tag }; return(Update(fields)); }
/// <summary> /// Submits an <see cref="UpdateOrderRequest"/> with the <see cref="SecurityTransactionManager"/> to update /// the ticker with trigger price specified in <paramref name="triggerPrice"/> and with tag specified in <paramref name="tag"/> /// </summary> /// <param name="triggerPrice">The new price which, when touched, will trigger the setting of a limit order.</param> /// <param name="tag">The new tag for this order ticket</param> /// <returns><see cref="OrderResponse"/> from updating the order</returns> public OrderResponse UpdateTriggerPrice(decimal triggerPrice, string tag = null) { var fields = new UpdateOrderFields() { TriggerPrice = triggerPrice, Tag = tag }; return(Update(fields)); }
/// <summary> /// Submits an <see cref="UpdateOrderRequest"/> with the <see cref="SecurityTransactionManager"/> to update /// the ticket with data specified in <paramref name="fields"/> /// </summary> /// <param name="fields">Defines what properties of the order should be updated</param> /// <returns>The <see cref="OrderResponse"/> from updating the order</returns> public OrderResponse Update(UpdateOrderFields fields) { _transactionManager.UpdateOrder(new UpdateOrderRequest(_transactionManager.UtcTime, SubmitRequest.OrderId, fields)); return(_updateRequests.Last().Response); }