# MidaTrade()

Trades are represented by the MidaTrade class.

TIP

A trade or deal is the result of an order execution and represents the transaction occurred to entirely or partially fill the order requested volume. An order can be executed entirely or partially with one or more trades

  • Interface
class MidaTrade {
    get id: string;
    get orderId: string;
    get positionId: string;
    get tradingAccount: MidaTradingAccount;
    get symbol: string;
    get volume: MidaDecimal;
    get direction: MidaTradeDirection;
    get status: MidaTradeStatus;
    get purpose: MidaTradePurpose;
    get executionDate: MidaDate | undefined;
    get rejectionDate: MidaDate | undefined;
    get executionPrice: MidaDecimal | undefined;
    get grossProfit: MidaDecimal;
    get grossProfitAsset: string;
    get commission: MidaDecimal;
    get commissionAsset: string;
    get swap: MidaDecimal;
    get swapAsset: string;
    get rejection: MidaTradeRejection | undefined;
    get isOpening: boolean;
    get isClosing: boolean;
    get isExecuted: boolean;
    get isRejected: boolean;
}

# Opening trades

An opening trade represents the transfer of an asset into the trading account, opening trades result in creating a new position or adding volume to an existing one.

# Closing trades

A closing trade represents the transfer of an asset out of the trading account, closing trades result in entirely or partially closing the volume of an open position.