On the picture above, blue horizontal line object is the oldest object, how to get it?
something like :
if (blue < yellow) && (blue < pink) && (blue < red)) { printf ("blue is the oldest object"); }
Do I need to use ibarshift? May I have example of code?
string oldestObjectName="", name;
datetime oldestObjectDate=INT_MAX, tmpDate;
for(int i=ObjectsTotal()-1;i>=0;i--)
{
name=ObjectName(i);
tmpDate=ObjectGetInteger(0,name,OBJPROP_TIME1);
if(tmpDate<oldestObjectDate)
{
oldestObjectDate=tmpDate;
oldestObjectName=name;
}
}
printf("oldest object is %s, its time1=%s",oldestObjectName,TimeToString(oldestObjectDate));