Table of Contents

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

side OrderSide
quantity double
symbol string

Properties

ATR

Gets/sets ATR for use in position sizing.

public double ATR { get; set; }

Property Value

double

ChildOrders

Gets a collection of child orders.

public OrderCollection ChildOrders { get; }

Property Value

OrderCollection

ExecQuantity

Gets the executed quantity.

public double ExecQuantity { get; }

Property Value

double

Expiration

Gets/sets an expiration date for the order if any. Ignored unless TimeInForce is GTD.

public DateTime? Expiration { get; set; }

Property Value

DateTime?

Fill

Gets/sets the fill associated this order if any.

public Execution Fill { get; }

Property Value

Execution

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

bool

HasVariables

Returns true if the order has variables associated with it.

public bool HasVariables { get; }

Property Value

bool

Id

Gets the order id.

public long Id { get; }

Property Value

long

Instrument

Gets/sets the instrument that will be traded.

public Instrument Instrument { get; set; }

Property Value

Instrument

IsActive

Returns true if the order has not been processed yet and is not in a completed state.

public bool IsActive { get; }

Property Value

bool

IsBuy

Returns true if order is a buy or cover.

public bool IsBuy { get; }

Property Value

bool

IsCanceledOrRejected

Returns true if the order has been canceled or rejected.

public bool IsCanceledOrRejected { get; }

Property Value

bool

IsFilled

Returns true if the order has been executed.

public bool IsFilled { get; }

Property Value

bool

IsMultiplier

Returns true for multiplier trades.

public bool IsMultiplier { get; }

Property Value

bool

IsOpening

Returns true for Buy or SellShort order types.

public bool IsOpening { get; }

Property Value

bool

Leaves

Gets the quantity remaining.

public double Leaves { get; }

Property Value

double

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

double

Quantity

Gets/sets the quantity submitted.

public double Quantity { get; set; }

Property Value

double

Reason

Gets the reason for an order cancellation or rejection, otherwise null.

public string Reason { get; }

Property Value

string

Side

Gets/sets the order side (Buy, Sell, SellShort, Cover).

public OrderSide Side { get; set; }

Property Value

OrderSide

SignalName

Gets/sets the name of the signal that triggered the order.

public string SignalName { get; set; }

Property Value

string

Status

Gets the order status.

public OrderStatus Status { get; }

Property Value

OrderStatus

StrategyName

Gets the name of the strategy this order is associated with.

public string StrategyName { get; }

Property Value

string

SubmitTime

Gets the time the order was submitted.

public DateTime SubmitTime { get; }

Property Value

DateTime

Symbol

Gets/sets the symbol to be traded.

public string Symbol { get; set; }

Property Value

string

Tag

Gets/sets a convenience property for the user to store any arbitrary object.

public object Tag { get; set; }

Property Value

object

TimeInForce

Gets/sets the time in force.

public TimeInForce TimeInForce { get; set; }

Property Value

TimeInForce

UpdateTime

Gets the time the order was last updated (due to fill, cancellation, etc.)

public DateTime UpdateTime { get; }

Property Value

DateTime

Variables

Gets a collection of trade variables associated with this order.

public VariableDictionary Variables { get; }

Property Value

VariableDictionary

Methods

Clone()

Returns a copy of this order.

public Order Clone()

Returns

Order

OnGetDescription()

Returns a string representation of this order. Called by ToString().

protected virtual string OnGetDescription()

Returns

string

OnGetPrice()

Gets the price associated with this order if any.

protected virtual double? OnGetPrice()

Returns

double?

ToString()

Returns a string representation of this order.

public override string ToString()

Returns

string