avatar
NÉ TIN

Guest 41 17th Feb, 2021

CPP 1.28 KB
                                           
                         //+------------------------------------------------------------------+
int OnInit()
  {
//---
   readNew();

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
string dongtienlienquan;
datetime thgianxayratintieptheo;

void readNew()
  {
   datetime thgiangannhat = TimeCurrent() + 7*24*60*60;
   
   
   for(int i =0; i< ObjectsTotal(); i++)
     {
      string name = ObjectName(i);
      
      if(ObjectType(name)!= OBJ_TEXT)
        {
         continue;
        }
      string quocgia = ObjectGetString(0,name,OBJPROP_TEXT,0);
      if(StringFind(Symbol(),quocgia,0)<0)
  //                    NZDUSD        USD
        {
         continue;
        }
        
      datetime timenews = ObjectGet(name, OBJPROP_TIME1);
      if(timenews< TimeCurrent())// tin da qua roi
        {
         continue;
        }

      if(timenews<thgiangannhat)
        {
         thgiangannhat = timenews;
         dongtienlienquan = quocgia;
        }
     }// end for
     ////////////////////////////////////////////////

   Print(dongtienlienquan +"/"+TimeToStr(thgiangannhat,TIME_DATE|TIME_MINUTES));
   
   thgianxayratintieptheo = dongtienlienquan;// bien chung

  }
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data

Comments

Authentication required

You must log in to post a comment.

Log in
    There are no comments yet.
Tắt Quảng Cáo [X]
Tắt Quảng Cáo [X]