MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Automated Trading Language Documentation

Subscribe to signal
Akderli1
14.94%, 110 611.04 USD
Screenshot
AUDUSD-, M15
Real
How to Export Quotes from МetaTrader 5 to .NET Applications Using WCF Services How to Export Quotes from МetaTrader 5 to .NET Applications... FractalsPowerCalculatorFractalsPowerCalculator Try product
FractalsPowerCalculator
Author: Manov
Sine Wave Indicator
Sine Wave
Author: GODZILLA

Position Properties

Execution of trade operations results in the opening of a position, changing of its volume and/or direction, or its disappearance. Trade operations are conducted based on orders, sent by the OrderSend() function in the form of trade requests. For each financial security (symbol) only one open position is possible. A position has a set of properties available for reading by the PositionGet...() functions.

For the function PositionGetInteger()

ENUM_POSITION_PROPERTY_INTEGER

Identifier

Description

Type

POSITION_TIME

Position open time

datetime

POSITION_TIME_MSC

Position opening time in milliseconds since 01.01.1970

long

POSITION_TIME_UPDATE

Position changing time in seconds since 01.01.1970

long

POSITION_TIME_UPDATE_MSC

Position changing time in milliseconds since 01.01.1970

long

POSITION_TYPE

Position type

ENUM_POSITION_TYPE

POSITION_MAGIC

Position magic number (see ORDER_MAGIC)

long

POSITION_IDENTIFIER

Position identifier is a unique number that is assigned to every newly opened position and doesn't change during the entire lifetime of the position. Position turnover doesn't change its identifier.

long

For the function PositionGetDouble()

ENUM_POSITION_PROPERTY_DOUBLE

Identifier

Description

Type

POSITION_VOLUME

Position volume

double

POSITION_PRICE_OPEN

Position open price

double

POSITION_SL

Stop Loss level of opened position

double

POSITION_TP

Take Profit level of opened position

double

POSITION_PRICE_CURRENT

Current price of the position symbol

double

POSITION_COMMISSION

Commission

double

POSITION_SWAP

Cumulative swap

double

POSITION_PROFIT

Current profit

double

For the function PositionGetString()

ENUM_POSITION_PROPERTY_STRING

Identifier

Description

Type

POSITION_SYMBOL

Symbol of the position

string

POSITION_COMMENT

Position comment

string

 

Direction of an open position (buy or sell) is defined by the value from the ENUM_POSITION_TYPE enumeration. In order to obtain the type of an open position use the PositionGetInteger() function with the POSITION_TYPE modifier.

ENUM_POSITION_TYPE

Identifier

Description

POSITION_TYPE_BUY

Buy

POSITION_TYPE_SELL

Sell

 

 


Updated: 2013.03.15