/// <summary> /// Creates new order for execution using Alpaca REST API endpoint. /// </summary> /// <param name="orderBase">New order placement request parameters.</param> /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> /// <returns>Read-only order information object for newly created order.</returns> public Task <IOrder> PostOrderAsync( OrderBase orderBase, CancellationToken cancellationToken = default) { orderBase.EnsureNotNull(nameof(orderBase)).Validate(); return(postOrderAsync(orderBase.GetJsonRequest(), cancellationToken)); }
internal StopLossOrder( OrderBase order, Decimal stopPrice, Decimal?limitPrice) : base( order, OrderClass.OneTriggersOther) { LimitPrice = limitPrice; StopPrice = stopPrice; }
/// <summary> /// Creates new instance of the <see cref="OrderBase"/> class. /// </summary> /// <param name="baseOrder">Base order for getting parameters.</param> protected internal OrderBase( OrderBase baseOrder) : this( baseOrder.EnsureNotNull(nameof(baseOrder)).Symbol, baseOrder.Quantity, baseOrder.Side, baseOrder.Type) { Duration = baseOrder.Duration; ClientOrderId = baseOrder.ClientOrderId; ExtendedHours = baseOrder.ExtendedHours; }
internal OrderBase( OrderBase order) : this( order.Symbol, order.Quantity, order.Side, order.Type) { Duration = order.Duration; ClientOrderId = order.ClientOrderId; ExtendedHours = order.ExtendedHours; }
internal OrderBase( OrderBase baseOrder) : this( baseOrder.Symbol, baseOrder.Quantity, baseOrder.Side, baseOrder.Type) { Duration = baseOrder.Duration; ClientOrderId = baseOrder.ClientOrderId; ExtendedHours = baseOrder.ExtendedHours; }
internal TakeProfitOrder( OrderBase order, Decimal limitPrice) : base( order, OrderClass.OneTriggersOther) =>