Download MetaTrader 5

oldest open Position price - mql5

To add comments, please log in or register
Mohamed Adel
124
Mohamed Adel  

 Hello,

 

now i can get the last/newest position info buy this code

 

 PositionSelect(_Symbol) ;

ulong position_ID=PositionGetInteger(POSITION_IDENTIFIER);

long create_time_msc=PositionGetInteger(POSITION_TIME_MSC);

long update_time_sec=PositionGetInteger(POSITION_TIME_UPDATE);

long update_time_msc=PositionGetInteger(POSITION_TIME_UPDATE_MSC);

 

my problem is that i need to get the oldest open position by ticket id

 

thanks in advance; 

Mohamed Adel
124
Mohamed Adel  

waiting for help :) 

Marco vd Heijden
Moderator
4752
Marco vd Heijden  

i have no idea what you are trying to accomplish but

ENUM_POSITION_PROPERTY_INTEGER

Identifier

Description

Type

POSITION_TIME

Position open time

datetime

is position open time so if you need the oldest i suggest you compare all of them by < is smaller then or > is larger then in a loop.

To add comments, please log in or register