Table of Contents

Class Order

Namespace
ViiSync.AccountApi
Assembly
ViiSync.AccountApi.dll

The MT5 "order" view (MT5 Order): an open position, a working pending order, or a closed trade (history). Ticket is the position id for positions/closed trades and the order id for pending orders.

public sealed class Order
Inheritance
Order
Inherited Members

Properties

CloseComment

Comment of the closing deal.

CloseLots

Closed volume of a closed trade, lots.

ClosePrice

Close price (closed trade) or current mark (open position).

CloseTime

Close time of a closed trade (UTC); default for open positions and pending orders.

CloseTimestampUTC

Unix ms of CloseTime.

CloseVolume

Closed volume, MT5 units (1e-8 lot).

Comment

Comment of the opening order.

Commission

Commission: of the opening deal for an open position, summed over all deals for a closed trade.

ContractSize

Symbol contract size (from the account's catalog).

DealInternalIn

The opening deal, when the API holds it.

DealInternalOut

The last closing deal of a closed trade.

DealType

Deal type of the position direction, or the balance-operation type.

Digits

Symbol digits (from the account's catalog).

ExpertId

Magic number.

ExpirationTime

Expiry of a pending order with a Specified time in force (UTC), else default.

ExpirationType

Time in force of a pending order.

Fee

Fees summed over the deals of a closed trade; 0 for open positions and pending orders.

FillPolicy

Filling policy of a pending order.

IsPending

True for a working pending order.

Login

ViiSync extra: account login.

Lots

Volume, lots.

Margin

Initial margin locked by this position, account currency (engine figure).

OpenPrice

Open price (volume-weighted over the opening deals for a closed trade); the order price for a pending order (the stop price of a stop-limit).

OpenTime

Open or placement time (UTC).

OpenTimestampUTC

Unix ms of OpenTime.

OrderInternal

The underlying order row of a pending order.

OrderType

Order type (Buy/Sell for positions and closed trades, Balance/Credit for balance operations).

PartialCloseDeals

The closing deals of a closed trade when there was more than one.

PartialFillDeals

The opening deals of a closed trade when there was more than one.

PlacedType

Who or what opened the position or placed the order (ORDER_REASON).

PositionId

Position id (0 for a working pending order).

Profit

Floating P/L (open position, as marked by the engine) or realised P/L (closed trade), deposit currency.

ProfitRate

Profit conversion rate. Not set by ViiSync (1); profit is already in the deposit currency.

Reason

ViiSync extra: the raw reason word from the server (for a closed trade, the reason of the closing deal).

RequestId

Local request number of the call that returned this order (the same number as RequestId on OnOrderProgress).

State

State: Filled for positions and closed trades, the order state for pending orders.

StopLimitPrice

Limit price of a stop-limit order.

StopLoss

SL price (0 = none). For a closed trade, the SL in force when it closed.

Swap

Swap accrued on the position (POSITION_SWAP): the charged accrual when the engine runs VIISYNC_SWAPS=1 (it counts in equity and is realised by the closing deal); a display-only estimate when swaps are off.

Symbol

Symbol name.

TakeProfit

TP price (0 = none). For a closed trade, the TP in force when it closed.

Ticket

Ticket: the position id for positions and closed trades, the order id for pending orders, the deal id for balance operations.

Volume

Volume, MT5 units (1e-8 lot).

Methods

Clone()

Shallow copy, with the deal arrays copied.

GetPartialCloseDeals(DealInternal[])

The OUT/OUT_BY deals of this position among deals, oldest first.

SortAndTrimDealsNotClosed(DealInternal[])

Deals sorted by time with those belonging to positions that are not closed trimmed away.

ToString()

Compact description: ticket, type, lots, symbol, price, SL, TP, state and P/L.