Beginner's questions in MQL5. Professionals don't pass by. - page 3

 

Maybe it's time to call the moderators for help and ask them to delete the first two posts from the thread (I hope Mr. Yedelkin won't be offended, thanks to him for answering my questions) I hope mister Yedelkin isn't offended, this post and rename this topic to"wishes of enthusiasts on improvement of MT5" or something like that at their discretion... If you do not know what to do with it, just try to keep it as simple as possible.

Maybe some good will come out of it? Maybe they will hear it).

 

decided to read the hst file, butFileReadString gave out hieroglyphs.

How do I fight this?

I write the header µl4 of 5 "EURUSD " "(C)opyright 2003, MetaQuotes Software Corp. I'm looking at it.

I get everything but the lines, why is it like this?

sender 5

#define AMOUNT_OHLCV 5 
static double OLHCV[AMOUNT_OHLCV];

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void  OnStart()  {

  int Tmp[15];
  for(int t=0;t<ArraySize(Tmp);t++)
      Tmp[t]=0;
  string Symbol_Create  = "EURDDD";     
  string FileName = Symbol_Create + "1.hst";
  int handle = FileOpen(FileName, FILE_BIN|FILE_WRITE);
   
  string s="";
  s=s+"FileWriteInteger "+FileWriteInteger(handle, 400,4)+"\n";            
  s=s+"FileWriteString "+FileWriteString(handle, "(C)opyright 2003, MetaQuotes Software Corp.",32)+"\n"; 
  s=s+"FileWriteString "+FileWriteString(handle, Symbol_Create, 6)+"\n"; //Symbol      
  s=s+"FileWriteInteger "+FileWriteInteger(handle, 1,4)+"\n";   //Period        
  s=s+"FileWriteInteger "+FileWriteInteger(handle, 4,4)+"\n";  //Digits           
  s=s+"FileWriteArray "+FileWriteArray(handle, Tmp, 0, 15)+"\n";           
  Comment(s);


   MqlRates EURUSD[];
   int bars=CopyRates("EURUSD",1,0,Bars("EURUSD",1),EURUSD);
   ArraySetAsSeries(EURUSD,true);
   
   for(int i=bars-1;i>=0;i--){
        OLHCV[0] = EURUSD[i].open;
        OLHCV[1] = EURUSD[i].low;
        OLHCV[2] = EURUSD[i].high;
        OLHCV[3] = EURUSD[i].close;
        OLHCV[4] = EURUSD[i].real_volume;
        
        double Tmph = OLHCV[ArrayMaximum(OLHCV,0, AMOUNT_OHLCV - 1)];
        OLHCV[1] = OLHCV[ArrayMinimum(OLHCV, 0, AMOUNT_OHLCV - 1)];
        OLHCV[2] = Tmph;
        FileWriteInteger(handle,EURUSD[i].time,4);  
        FileWriteArray(handle, OLHCV, 0, AMOUNT_OHLCV);
    }
  FileFlush(handle);
  FileClose(handle);
return;
}

receiver 4

int start(){
  int Tmp[15];
  for(int t=0;t<ArraySize(Tmp);t++)
      Tmp[t]=0;
  string FileName = "EURDDD1.hst",s="";
  int handle = FileOpenHistory(FileName, FILE_BIN|FILE_WRITE|FILE_READ);

  s= s+FileReadInteger(handle,4)+"\n";            
  s= s+FileReadString(handle,64)+"\n"; 
  s= s+FileReadString(handle,12)+"\n";     
  s= s+FileReadInteger(handle,4)+"\n";           
  s= s+FileReadInteger(handle,4)+"\n";             
  s= s+FileReadArray(handle, Tmp, 0, 15)+"\n";  

  for(int i=20/*(FileSize(handle)-148)/44*/;i>=0;i--){
         s= s+TimeToStr(FileReadInteger(handle,4))+"\n";             
         s= s+FileReadDouble(handle,8)+"\n";             
         s= s+FileReadDouble(handle,8)+"\n";             
         s= s+FileReadDouble(handle,8)+"\n";             
         s= s+FileReadDouble(handle,8)+"\n";             
         s= s+FileReadDouble(handle,8)+"\n";            
         s= s+"-----------------------------------------"+"\n";
  }
  Comment(s);
  return;
}
 
costy_:

and FileReadString gave up hieroglyphics.

And it really is hieroglyphics... The consequences of outsourcing, or an easter egg in memory of Kim Jong-il)
 
Figar0:
And it really is in hieroglyphics... Consequences of outsourcing, or easter egg in memory of Kim Jong-il)
OUTROHLIFE AND JUNG SIM KIN :(
 

Dear MT5 experts, in the MT5 terminal I found out that the number of bars (on the minutes mainly) at the same time intervals is sometimes different.

I understand that if there was no price change during the bar formation, then the bar is not drawn at all, i.e. it is skipped.

I am shocked. I want to check it.

Is it true or not?

 
Edic:

Dear MT5 experts, in the MT5 terminal I found out that the number of bars (on the minutes mainly) at the same time intervals is sometimes different.

I understand that if there was no price change during the bar formation, then the bar is not drawn at all, i.e. it is skipped.

I am shocked. I want to check it.

Is it true or not?

If there were no ticks during the bar formation timeframe, the bar will not be drawn.
 

How can I process all graphical objects of a certain type (e.g. OBJ_HLINE)?

With ObjectsTotal I can find out the number of objects of this type on the chart, but how can I enumerate them through the same for, if I don't know the object name beforehand.

The specific task is that I need to enumerate all the horizontal lines of the graph and get their values into an array.

Thanks

 
Olegts:

How can I process all graphical objects of a certain type (e.g. OBJ_HLINE)?

With ObjectsTotal I can find out the number of objects of this type on the chart, but how can I enumerate them through the same for, if I don't know the object name beforehand.

The specific task is that I need to enumerate all the horizontal lines of the graph and get their values into an array.

Thanks

Use"ObjectName" after "ObjectsTotal".
 
barabashkakvn:
Use"ObjectName" after "ObjectsTotal".
Got it, thanks)
 
barabashkakvn:
If there were no ticks in the bar's timeframe, the bar is not built.
Thank you)
Reason: