Skip to content

CPositionInfo

CPositionInfo

CPositionInfo is a class for easy access to the open position properties.

Description

CPositionInfo class provides easy access to the open position properties.

Declaration

class CPositionInfo : public CObject

Title

#include <Trade\PositionInfo.mqh>

Inheritance hierarchy

CObject

CPositionInfo

Class methods by groups

Access to integer type properties
TimeGets the time of position opening
TimeMscReceives the time of position opening in milliseconds since 01.01.1970
TimeUpdateReceives the time of position changing in seconds since 01.01.1970
TimeUpdateMscReceives the time of position changing in milliseconds since 01.01.1970
PositionTypeGets the position type
TypeDescriptionGets the position type as a string
MagicGets the ID of expert, that opened the position
IdentifierGets the ID of position
Access to double type properties
VolumeGets the volume of position
PriceOpenGets the price of position opening
StopLossGets the price of position’s Stop Loss
TakeProfitGets the price of position’s Take Profit
PriceCurrentGets the current price by position symbol
CommissionGets the amount of commission by position
SwapGets the amount of swap by position
ProfitGets the amount of current profit by position
Access to text properties
SymbolGets the name of position symbol
CommentGets the comment of the position
Access to MQL5 API functions
InfoIntegerGets the value of specified integer type property
InfoDoubleGets the value of specified double type property
InfoStringGets the value of specified string type property
Selection
SelectSelects the position
SelectByIndexSelects the position by index
SelectByMagicSelects a position with the specified symbol name and magic number
SelectByTicketSelects the position by ticket
State
StoreStateSaves the position parameters
CheckStateChecks the current parameters against the saved parameters

Methods inherited from class CObject

: Prev, Prev, Next, Next, Save, Load, Type, Compare

Last updated on