Class Order
- Namespace
- Balsam
- Assembly
- Balsam.Backtester.dll
An abstract base class representing an order.
public abstract class Order : IOrder, ICloneable, ITrade
- Inheritance
-
Order
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
Order(OrderSide, double, string)
Instantiates a new order object.
protected Order(OrderSide side, double quantity, string symbol)
Parameters
Properties
ATR
Gets/sets ATR for use in position sizing.
public double ATR { get; set; }
Property Value
ChildOrders
Gets a collection of child orders.
public OrderCollection ChildOrders { get; }
Property Value
ExecQuantity
Gets the executed quantity.
public double ExecQuantity { get; }
Property Value
Expiration
Gets/sets an expiration date for the order if any. Ignored unless TimeInForce is GTD.
public DateTime? Expiration { get; set; }
Property Value
Fill
Gets/sets the fill associated this order if any.
public Execution Fill { get; }
Property Value
HasChildOrders
Returns true if this is a spread order. Should be called before iterating through the Legs collection to avoid instantiating an empty legs collection unnecessarily.
public bool HasChildOrders { get; }
Property Value
HasVariables
Returns true if the order has variables associated with it.
public bool HasVariables { get; }
Property Value
Id
Gets the order id.
public long Id { get; }
Property Value
Instrument
Gets/sets the instrument that will be traded.
public Instrument Instrument { get; set; }
Property Value
IsActive
Returns true if the order has not been processed yet and is not in a completed state.
public bool IsActive { get; }
Property Value
IsBuy
Returns true if order is a buy or cover.
public bool IsBuy { get; }
Property Value
IsCanceledOrRejected
Returns true if the order has been canceled or rejected.
public bool IsCanceledOrRejected { get; }
Property Value
IsFilled
Returns true if the order has been executed.
public bool IsFilled { get; }
Property Value
IsMultiplier
Returns true for multiplier trades.
public bool IsMultiplier { get; }
Property Value
IsOpening
Returns true for Buy or SellShort order types.
public bool IsOpening { get; }
Property Value
Leaves
Gets the quantity remaining.
public double Leaves { get; }
Property Value
ParentId
Gets the id of the parent order, if any.
public long? ParentId { get; }
Property Value
- long?
PriceAdjustment
Gets the value used to convert backadjusted prices to unadjusted prices that existed at the time the order would have been placed.
public double PriceAdjustment { get; }
Property Value
Quantity
Gets/sets the quantity submitted.
public double Quantity { get; set; }
Property Value
Reason
Gets the reason for an order cancellation or rejection, otherwise null.
public string Reason { get; }
Property Value
Side
Gets/sets the order side (Buy, Sell, SellShort, Cover).
public OrderSide Side { get; set; }
Property Value
SignalName
Gets/sets the name of the signal that triggered the order.
public string SignalName { get; set; }
Property Value
Status
Gets the order status.
public OrderStatus Status { get; }
Property Value
StrategyName
Gets the name of the strategy this order is associated with.
public string StrategyName { get; }
Property Value
SubmitTime
Gets the time the order was submitted.
public DateTime SubmitTime { get; }
Property Value
Symbol
Gets/sets the symbol to be traded.
public string Symbol { get; set; }
Property Value
Tag
Gets/sets a convenience property for the user to store any arbitrary object.
public object Tag { get; set; }
Property Value
TimeInForce
Gets/sets the time in force.
public TimeInForce TimeInForce { get; set; }
Property Value
UpdateTime
Gets the time the order was last updated (due to fill, cancellation, etc.)
public DateTime UpdateTime { get; }
Property Value
Variables
Gets a collection of trade variables associated with this order.
public VariableDictionary Variables { get; }
Property Value
Methods
Clone()
Returns a copy of this order.
public Order Clone()
Returns
OnGetDescription()
Returns a string representation of this order. Called by ToString().
protected virtual string OnGetDescription()
Returns
OnGetPrice()
Gets the price associated with this order if any.
protected virtual double? OnGetPrice()
Returns
ToString()
Returns a string representation of this order.
public override string ToString()